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
526a869d-6635-40a3-a628-bf31c20b76ad
YongYuH/GPU
shallow_water_eq.cpp
#include <stdio.h> #include <math.h> #include <omp.h> #define N 200 #define L 1.0 #define DX (L/N) #define DT (0.1*DX) #define NO_STEPS 200 #define G 9.81 float U[2][N]; // Create U as a 2xN array here, U = n and nu float P[2][N]; // Primitives, n and u float U_new[2][N]; // New U array void Save_Results(); ...
ALGO
0.999994
4.520914
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2015-10-27T09:48:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40bff9575...
f6700eec-6184-4a55-935b-460003b3d33f
fengvyi/LeetCode
C++/399. Evaluate Division.cpp
class Solution { private: unordered_map<string, unordered_map<string, double>>weight; unordered_map<string, vector<string>>graph; public: vector<double> calcEquation(vector<pair<string, string>> equations, vector<double>& values, vector<pair<string, string>> queries) { vector<double>res; for...
ALGO
0.999952
5.92356
{ "github_metadata": { "branch": "master", "commit_count": 1188, "repo_created_at": "2017-08-06T09:52:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 144, "forks": 39, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "2ebb...
57c2eba1-c664-4e11-8a63-0bf1c9ee6d4b
Iskander-rzk/study-
alg/LAB3/alg_lab_3_#1.cpp
#include <iostream> #include <list> #include <random> #include <cstdlib> #include <fstream> #include <ctime> int* randA(int N); // Предварительное объявление функции int shell_sort(int *R, int size); int* best_sort(int N); int* worst_sort(int N); int main() { std::ofstream myfile; myfile.open("alg3_1.csv")...
ALGO
0.996915
4.676436
{ "github_metadata": { "branch": "laptop", "commit_count": 41, "repo_created_at": "2024-02-06T08:42: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": "b2e4cf2f1...
dfe1cba2-d06d-44e2-921d-95cb9e02fe1e
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/06/0621/personal_submission/cf242d_yawn_sean.cpp
#include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector<vector<int>> path(n); while (m --) { int u, v; cin >> u >> v; u --, v --; pa...
ALGO
0.999992
4.15286
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "3aa6...
d559bf63-17fd-446f-9d92-1ba766cb394c
PulkitGiddu/leetcode
ContestQuestions/724.Find_Pivot_Index.cpp
Q - 724. Find Pivot Index Code: // class Solution { // public: // int pivotIndex(vector<int>& nums) { // int n = nums.size(); // for(int i = 1; i<n; i++){ // -------> n // int leftSum = 0; // // So we were checking into left part of the it...
ALGO
0.999973
6.240829
{ "github_metadata": { "branch": "main", "commit_count": 333, "repo_created_at": "2022-08-25T17:20:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8c2a546d9...
7e7737e8-81f8-4a2b-b642-f9e042ac02f3
MIT-SPARK/Hydra
include/hydra/reconstruction/marching_cubes.h
/* ----------------------------------------------------------------------------- * Copyright 2022 Massachusetts Institute of Technology. * All Rights Reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * ...
ALGO
0.977406
7.099469
{ "github_metadata": { "branch": "main", "commit_count": 573, "repo_created_at": "2022-05-05T21:39:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 733, "forks": 90, "issues": 22, "pull_requests": 3 }, "file_meta": { "content_id": "66271f3...
05b53c65-b2b7-466e-a851-85213eaf789b
JosepHyv/Contest-Archive
entrenamiento/Shaass and Oskols.cpp
//PROBLEM LINK: //PROBLEM PATH: #include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define all(x) x.begin(), x.end() #define mcm( a, b) a*b/__gcd(a,b) using namespace std; typedef double db; typedef long long int ll; typedef vector < ll > vi; typedef vector < ll > vl; typedef vector < boo...
ALGO
0.999925
3.895003
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2020-04-12T00:42:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dcc0e878...
2933e8a2-99e1-41ad-b817-f366473d2d78
niaBaldoni/HackerRank-Challenges
cplusplus/01_introduction/variable-sized-arrays.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; /* SAMPLE INPUT 2 2 3 1 5 4 5 1 2 8 9 3 0 1 1 3 2 2 means we have to read 4 total rows = 2 rows of data, and 2 rows with a question each n = 2 q = 2 1 5 4 is our data for the first array, so we need an ...
ALGO
0.999905
3.835041
{ "github_metadata": { "branch": "main", "commit_count": 133, "repo_created_at": "2022-03-21T18:49: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": "7fc0e80cff...
4435e6d6-abb1-4af3-af86-00f92893489e
VladyslavUsenko/basalt
thirdparty/apriltag/src/apriltag.cpp
#include <basalt/utils/apriltag.h> #include <apriltags/TagDetector.h> #include <apriltags/Tag36h11.h> namespace basalt { struct ApriltagDetectorData { ApriltagDetectorData(int numTags) : doSubpixRefinement(true), maxSubpixDisplacement(0), minTagsForValidObs(4), minBorderDistance(4.0...
ALGO
0.959455
6.734407
{ "github_metadata": { "branch": "master", "commit_count": 435, "repo_created_at": "2019-04-17T10:53:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 782, "forks": 217, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "49e4...
f1c919dc-95a5-4184-9f46-e59b299c7106
bruhismyname/Toki-TLX-Solution-Courses
Course TLX/Pemrograman Kompetitif Dasar/10. Struktur Data Non-Linear/perkenalanDisjoint.cpp
#include <iostream> #include <vector> using namespace std; class DisjointSet { private: vector<int> parent; public: DisjointSet(int n) { parent.resize(n + 5); for (int i = 0; i < n + 5; i++) parent[i] = i; } int findParent(int a) { if (parent[a] == a) return a; return...
ALGO
0.999699
4.702177
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-27T07:37: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": "942c0410a0b0...
75112be2-fbef-4e18-8744-6f9d470d581a
Luisguslg/simulador-planificacion-cpu
proyecto/Core/algorithms/priority.cpp
#include "priority.h" #include <algorithm> using namespace std; namespace priority { void ejecutar(vector<Proceso>& procesos, int& tiempoTotal) { int n = procesos.size(); int completados = 0; int tiempoActual = 0; vector<bool> terminado(n, false); while (completados < n) ...
ALGO
0.999995
5.563189
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-07-05T02:13: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": "4dfac8e1439d...
4734707f-923c-4f09-9801-9c32d7102584
SpongeCodes/coding-contests
leetcode/weekly/weekly-406/3.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; /* 3 solutions 1. 4D -DP 2. 2D- DP also possible 3. Best solution is greedy - take the maximum between present vertical and horizontal cut to minimize the increase of the next opposite cuts */ // SOLUTION 1 - WILL FAIL FOR HIGHER CONSTRAINTS ...
ALGO
0.999974
4.824877
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2024-05-11T05:39: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": "9b32f633cc2...
b1d58b6a-c4f1-4073-8312-92d18d9bea02
Luftschlange/ms-steiner-puw
src/rfw_random.h
/* Algorithm for Steiner Problem in Graphs Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including w...
ALGO
0.998042
3.711496
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-08-25T02:08:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 6, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "6fcd59208...
b2bfd5e0-be2a-42fb-a2a1-c0cb81835d19
ishandutta2007/codeforces-b
bmerry/normal/915/F.cpp
#include <bits/stdc++.h> #ifndef ONLINE_JUDGE # include <sys/time.h> # include <sys/resource.h> #endif /*** TEMPLATE CODE STARTS HERE ***/ #ifndef M_PI #define M_PI 3.1415926535897932384626433832795028841971693993751 #endif using namespace std; typedef vector<string> vs; typedef long long ll; typedef complex<double...
ALGO
0.999858
3.952007
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d58de7d9dd56...
9627c75b-68a0-4e8c-a2d1-1810ff3813de
moonjs0614/Algorithm
백준/Gold/17142. 연구소 3/연구소 3.cc
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <queue> #include <vector> #include <cstring> #include <algorithm> using namespace std; int N, M; int map[50][50]; int dy[4] = { -1, 1, 0, 0 }; int dx[4] = { 0, 0, -1, 1 }; int stCnt = 0; bool virus_visited[10]; int result = 2500; struct Point { int y, x; }...
ALGO
0.999938
3.926221
{ "github_metadata": { "branch": "main", "commit_count": 113, "repo_created_at": "2024-05-20T11:30: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": "84dc306c48...
45c6352e-094c-40bd-b897-ea0a0d12c7d9
ICCD/RealTime_Robot
RealTimeRobot/matching.h
#include <model_point.h> #include <pcl/point_cloud.h> #include <pcl/octree/octree.h> #include <iostream> #include <vector> #include <ctime> #include <pcl/io/io.h> #include <pcl/io/pcd_io.h> #include <Eigen/Dense> #include <pcl/visualization/pcl_visualizer.h> #include <pcl/registration/icp.h> using namespace Eigen; usi...
ALGO
0.999658
3.633069
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2017-03-29T04:31:44.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "8443369f92...
3d8db7f2-e968-49b5-9fc9-f479a8763e6d
dxmtb/OICodeShare
HYBZ/2059.cpp
/* * Problem: [Usaco2010 Nov]Feed 购买饲料 * Time: 2011.04.11 * Author: dxmtb * State: Solved * Memo: dp+单调队列 */ #include <cstdio> #include <algorithm> #include <deque> #include <iostream> using namespace std; typedef long long s64; const int MAXN=505,MAXK=10005; const s64 oo=~0ull>>2; struct Node { int X...
ALGO
0.999916
3.689747
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2013-05-17T05:13: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": "696f774f6f...
1281c732-7dc5-479f-ab93-da1b094df838
ishandutta2007/codeforces-g
gepardo/normal/768/E.cpp
/** alex256 Contest CodeForces Round 399 (Div. 1 + Div. 2) Task D Date 20.02.2017 **/ /// Global defines #ifndef ONLINE_JUDGE #define LOCAL #endif //#define USE_LONGLONG //#define USE...
ALGO
0.999916
4.685616
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:55:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8dd0d4d9027f...
dbc9dfef-d322-4694-ad69-d7fe44045505
vasnastos/PROGRAMMING_TO_C
ΕΠΑΝΑΛΗΠΤΙΚΕΣ_ΑΣΚΗΣΕΙΣ_2ο_ΣΕΤ/cpp solutions/askisi_5(cpp).cpp
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <string> #include <sstream> class employee { std::string name; std::string lastname; int age; double sales[3]; public: employee() {} employee(std::string n,std::string ln,int a,double s1,double s2,double...
TOOL
0.974246
3.958489
{ "github_metadata": { "branch": "master", "commit_count": 240, "repo_created_at": "2020-04-09T16:04:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29266c84...
14cc7431-a996-40ee-8e5f-92f3512da85d
mhunicken/icpc-team-notebook-el-vasito
geometry/line_test.cpp
// SPOJ TAP2016D - AC // http://www.spoj.com/problems/TAP2016D/ #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fst first #define snd second #define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i) using namespace std; typedef long long ll; const double EPS=1e-6; // double inf const double DI...
ALGO
0.999528
4.330213
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2018-04-28T12:03:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 189, "forks": 21, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6549f...
ef340ba2-d9c3-400c-9b2c-e4c25cf66a93
google/earthenterprise
earth_enterprise/src/third_party/sgl/v0_8_6/src/SkTSort.h
/* libs/graphics/sgl/SkTSort.h ** ** Copyright 2006, 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 requ...
ALGO
0.999257
5.279935
{ "github_metadata": { "branch": "master", "commit_count": 1779, "repo_created_at": "2017-03-20T21:40:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2699, "forks": 891, "issues": 252, "pull_requests": 0 }, "file_meta": { "content_id": "1...
482c2238-3f40-4726-93a2-0b505b052ff2
ishandutta2007/codeforces-d
dlalswp25/normal/1606/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll pw[15]; int N, K; int A[15]; int mx[15]; ll f(int n, int k) { if(n == 1) return k; if(mx[n - 1] >= k) return f(n - 1, k); int t = (k - mx[n - 1]); return pw[A[n]] * t + f(n - 1, k - t); } int main() { pw[0] = 1; for(int i = 1; i <= 9; i++)...
ALGO
0.999736
3.751505
{ "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": "fbb14fe230d3...
6d7d3a46-3f4c-42c7-b25e-de8159a12ad3
ishandutta2007/codeforces-s
subscriber/normal/243/B.cpp
#include<stdio.h> #include<iostream> #include<vector> #include<cmath> #include<algorithm> #include<memory.h> #include<map> #include<set> #include<queue> #include<list> #include<sstream> #define mp make_pair #define pb push_back #define F first #define S second #define SS stringstream #define sqr(x) ((x)*(x)) #define m0...
ALGO
0.999959
3.084997
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "86c2debfcd10...
ca362d3c-4658-4032-97b1-2288c9f7ae9c
pulkitgaur07/Data-Structures-and-algorithm
Graph/count_the_number_of_complete_components.cpp
// Question : You are given an integer n. There is an undirected graph with n vertices, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting vertices ai and bi. // Return the number of complete connected components of the gra...
ALGO
0.999916
6.486532
{ "github_metadata": { "branch": "main", "commit_count": 227, "repo_created_at": "2025-01-03T17:22: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": "2863234628...
25a31f1f-c593-4d1f-8150-ee3a8025a5ee
ice-space/CPPlearning
TEST/MATH1/MATH1/顺序表.cpp
#include<stdio.h> #include<stdlib.h> //InitList(&L);初始化线性表 //DestroryList(&L);销毁线性表 //“&”是否使用在于是否要将结果“带回来” //sizeof(ElemType) 了解元素占用的内存大小 typedef int ElemType; //静态分配 #define MaxSize 10 typedef struct { ElemType data[MaxSize]; int length; }SqList; ////动态分配 //#define InitSize 10 // //typedef struct { // /*ElemT...
ALGO
0.985976
3.465188
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-11-19T11:38: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": "0ec04432865e...
e160a2fb-7bc6-4897-b358-6ceab7db3da6
nobi-nata/LeetCode-Problems
152-maximum-product-subarray/maximum-product-subarray.cpp
class Solution { public: int maxProduct(vector<int>& nums) { //TC: O(n^3) // int n = nums.size(); // int ans = INT_MIN; // for(int i = 0; i < n; i++){ // for(int j = i; j < n; j++){ // int prod = 1; // for(int k = i; k <= j; k++){ ...
ALGO
0.999956
6.015061
{ "github_metadata": { "branch": "main", "commit_count": 740, "repo_created_at": "2023-09-01T14:53: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": "7f17bb73c1...
63052e40-15c8-4d5a-801b-396a40ee216f
wrc042/GAMES101
assignments/Assignment4/code/main.cpp
#include <chrono> #include <iostream> #include <opencv2/opencv.hpp> std::vector<cv::Point2f> control_points; void mouse_handler(int event, int x, int y, int flags, void *userdata) { if (event == cv::EVENT_LBUTTONDOWN && control_points.size() < 4) { std::cout << "Left button of the mouse is clicked - posit...
ALGO
0.989585
6.052292
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2022-01-15T10:27:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d636c8fc...
48f6ac9d-3915-4f67-bad7-138209fd1f86
coolfluid/coolfluid3
plugins/UFEM/src/UFEM/demo/PoissonSpecialized.cpp
// Copyright (C) 2010-2011 <NAME> for Fluid Dynamics, Belgium // // This software is distributed under the terms of the // GNU Lesser General Public License version 3 (LGPLv3). // See doc/lgpl.txt and doc/gpl.txt for the license text. #define BOOST_PROTO_MAX_ARITY 10 #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 10 #inc...
TOOL
0.984138
6.430239
{ "github_metadata": { "branch": "master", "commit_count": 6081, "repo_created_at": "2011-08-08T12:37:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 78, "forks": 77, "issues": 60, "pull_requests": 0 }, "file_meta": { "content_id": "76cd7...
6379bca4-2a88-411d-9b48-ba87b16e362c
openvinotoolkit/openvino
src/plugins/intel_gpu/src/plugin/ops/topk.cpp
// Copyright (C) 2018-2025 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" #include "openvino/op/topk.hpp" #include "intel_gpu/primitives/arg_max_min.hpp" #include "intel_gpu/primitives/mutable_data.hpp" #include...
TOOL
0.977083
7.558641
{ "github_metadata": { "branch": "master", "commit_count": 19551, "repo_created_at": "2018-10-15T10:54:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8597, "forks": 2656, "issues": 303, "pull_requests": 258 }, "file_meta": { "content_id"...
553991ae-c990-414f-801d-595bcff31d7e
hamidreza004/NimRoo-ICPC
notebook/Number Theory/Chineese Reminder Theorem.cpp
#define lcm LLLCCM ll GCD(ll a, ll b) { return (b == 0) ? a : GCD(b, a % b); } inline ll LCM(ll a, ll b) { return a / GCD(a, b) * b; } inline ll normalize(ll x, ll mod) { x %= mod; if (x < 0) x += mod; return x; } struct GCD_type { ll x, y, d; }; GCD_type ex_GCD(ll a, ll b){ if (b == 0) return {1, 0, a}; GCD_type p...
ALGO
0.999813
4.00129
{ "github_metadata": { "branch": "main", "commit_count": 130, "repo_created_at": "2021-02-19T17:15: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": "e152903024...
adebadf9-8079-4ad8-a3b6-ae8b8e17abee
melissayin/competitive-programming
cses/number-spiral.cpp
#include <bits/stdc++.h> using namespace std; void solve() { long long diagonal, value, y, x, big; cin >> y >> x; big = max(y, x); diagonal = 1 + (big - 1) * (2 + 2 * (big - 1)) / 2; long long difference; if (y > x) { difference = y - x; if (y % 2 == 1) { ...
ALGO
0.999975
4.364418
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-09-01T22:47:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c31c777b19...
54c39c61-5725-4c09-b9d4-b414e4470eb5
howard36/Competitive-Programming
DMOJ/DMOPC/DMPG '18 G5 - Triangles.cpp
#include <vector> #include <algorithm> #include <complex> #include <cstdio> #define cd complex<double> using namespace std; vector<cd> Points, Hull; int H; bool CompareAngle(cd a, cd b) { return arg(a / b) < 0; } bool CompareImag(cd a, cd b) { return imag(a) < imag(b) || (imag(a) == imag(b) && abs(a) < abs(b)); } ...
ALGO
0.999875
4.389734
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2018-01-21T18:33: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": "494962cea...
89b158df-8a5c-4e64-b48f-3d50e7539852
bookpanda/2110327-ALGORITHM-DESIGN
da66_​m2_​change_​data/main.cpp
#include <iostream> #include <vector> #include <stack> #include <queue> #include <list> #include <set> #include <map> #include "student.h" using namespace std; // Add your code in student.h void change_1(stack<vector<queue<int>>> &a, int from, int to); void change_2(map<string, pair<priority_queue<int>, int>> &a, in...
ALGO
0.998637
4.332317
{ "github_metadata": { "branch": "main", "commit_count": 103, "repo_created_at": "2024-01-08T16:07:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8f66614df...
1f63289b-ae4b-4575-871f-d271520b0e9d
hiimmuc/CppPractices
Practices/P32-Stock.cpp
/** cSpell: disable * @file P32-Stock.cpp * @author Vieoney (<EMAIL>) * @brief Matrix prices (S x D) represents the S stocks in D days. The value of prices[i][j] is the price of stock i on day j. * ------ Having initial M dollars, find the maximum profit that can be made by buying and selling stocks. * @version ...
ALGO
0.999703
4.641018
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2024-08-29T18:29: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": "6a9039e90...
df9ac093-e927-459f-8414-de0c18c18c87
SanPen/Armadillo_tests
src/sparse_math.h
#ifndef SPARSE_MATH_H #define SPARSE_MATH_H #include <armadillo> /// Make working with std::complex<> nubmers suck less... allow promotion. ///////////////////////////////////////////// // Trick to allow type promotion below template <typename T> struct identity_t { typedef T type; }; #define COMPLEX_OPS(OP) ...
ALGO
0.988469
6.370905
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-04-21T16:35: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": "38cabc7da6...
f5b75673-90db-40aa-ba42-43432c6748fc
frankkn/I2P2
exercise/MRT/mrt_1.cpp
#include <iostream> #include <fstream> #include <map> #include <set> #include <list> #include <algorithm> using namespace std; using Graph = map<string,set<string>>; using Path = list<string>; Path has_path(Graph &g, string src, string dst, Path path, Path best_path) { if (src==dst) { path.push_back(dst)...
ALGO
0.99956
4.003273
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2023-09-29T06:23: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": "5d6bc393b...
7702b013-d5a2-4337-b716-f1b4efc64384
oki-azure/Cpp-Practice-Projects
Problems/Chapter6.cpp
#include <cstdio> /******************************************************************************************************** 6-1 The mode of a series of values is the value that appears most commonly. Implement a mode function using the following signature: int mode(const int* values, size_t length). If you encoun...
ALGO
0.986934
4.419091
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-12-27T21:54: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": "2196bf33096...
2300f8e9-2218-4eb8-b0ee-f7b7f3ba556a
alexandraback/datacollection
solutions_1485488_0/C++/pwahs/b.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999559
3.367787
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc96de5a8...
92689139-728e-476c-98e0-3338cc174773
GulshanSinghAIT/DSA
DSA_CODES/TBST_1.cpp
#include<bits/stdc++.h> using namespace std; struct Node { Node *left, *right; int info; bool lthread; bool rthread; }; Node *insert(Node *root, int ikey) { Node *ptr = root; Node *par = NULL; while (ptr != NULL) { if (ikey == (ptr->info)) { cout<<"Duplicate Key"<<endl; return roo...
ALGO
0.999978
4.059356
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-06T21:31: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": "4ab4dc51bcfa...
c28cd81b-694d-4f9a-91de-a9d05f4d4042
Rolight/ACM_ICPC
Other/百度之星 初赛/1004.cpp
#include <cstdio> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <cstring> #include <climits> #include <cmath> #include <algorithm> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <ctime> #include <cstdlib> typedef long long LL; const in...
ALGO
0.999759
3.439467
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2014-12-10T08:06:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e50719585...
5db1784d-aa83-45dc-a57a-3a95030b998c
Zzzode/myLeetCode
2.两数相加.cpp
/* * @lc app=leetcode.cn id=2 lang=cpp * * [2] 两数相加 * * https://leetcode-cn.com/problems/add-two-numbers/description/ * * algorithms * Medium (35.90%) * Likes: 5040 * Dislikes: 0 * Total Accepted: 581.1K * Total Submissions: 1.5M * Testcase Example: '[2,4,3]\n[5,6,4]' * * 给出两个 非空 * 的链表用来表示两个非负的整数...
ALGO
0.999975
6.411833
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2020-09-13T20:23:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6db0cfbbf...
2003c658-4b89-4587-a962-68f53dc28435
perfectteatimer/ads_dsba
main.cpp
#include <iostream> #include <vector> #include <algorithm> int main() { long long n; std::cin >> n; std::vector<long long> a(n); long long max_spaces = 0; for (long long& ai: a) { std::cin >> ai; max_spaces = std::max(max_spaces, ai); } const long long MAX_SPACES = 42949672...
ALGO
0.999973
4.041239
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2023-12-22T16:57:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c7801198...
8a16bb69-c537-4d6c-b14a-92d584f3cf3c
ismailsalim/producer-consumer
helper.cc
/****************************************************************** * The helper file that contains the following helper functions: * check_arg - Checks if command line input is a number and returns it * sem_create - Create number of sempahores required in a semaphore array * sem_init - Initialise particular semaph...
TOOL
0.917745
4.656641
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-10-14T18:48: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": "16391f9bbcb3...
d8a4ee10-8d94-4094-a7f4-31d2beb9bb80
yuhanqiuu/Self-Balancing-Bot
utils/movement.cpp
// pwm.cpp #include "movement.h" #include <math.h> #include "Arduino_BMI270_BMM150.h" // float theta_n = 0; unsigned long ct = 0; //------------------------------------------------------------------------- // Convert RPM to PWM for left and right motors float rpm_to_pwm_left(float rpm) { return 7.58 * exp(7.89E-3...
ALGO
0.997186
5.229301
{ "github_metadata": { "branch": "main", "commit_count": 169, "repo_created_at": "2025-01-09T16:49: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": "fccb72a6b0...
4dc846f8-163f-4288-bf6f-5f2814b8ee4e
Ara-yjx/cs24arash
lab07/alph.cpp
// alph.cpp - some recursive print functions // NAME(S), DATE #include <iostream> using namespace std; // recursively prints letter sequence 'a'..c void alph(char c) { if (islower(c)) { if (c > 'a') alph(c - 1); cout << c; } } // recursively prints letter sequence c..'a' void ralp...
ALGO
0.981369
4.50824
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2017-10-18T03:38:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e92d33f56...
1a83d325-7996-4fdc-8b65-435b059b86ee
gefeng/cp
atcoder/abc249/C.cpp
#include <iostream> #include <cassert> #include <algorithm> #include <cmath> #include <array> #include <string> #include <vector> using namespace std; void run_case() { int N, K; cin >> N >> K; vector<string> A(N); for(int i = 0; i < N; i++) { cin >> A[i]; } int ans = 0; for(...
ALGO
0.999963
4.885125
{ "github_metadata": { "branch": "main", "commit_count": 980, "repo_created_at": "2022-07-19T19:38:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c36edcc8d9...
a85938ce-5ed2-445f-bafd-7f4a9dabed7e
pranavkushawaha/cp
HEX.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll ; #define mp make_pair #define pb push_back #define f(i,a,b) for(int i=a;i<b;i++) #define fr(j,a,b) for(int j=a;j>b;j--) #define vi vector<int> #define vvi vector<vi> #define trav(a,x) for (auto& a : x) #define all(x) x.begin(), x.end() int dx[] =...
ALGO
0.999909
3.895237
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2022-10-03T12:55:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 12, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8012ef0d4...
355e2155-5860-41ba-addc-3077a42c283b
rsalesc/cp-includes
Complex.cpp
#ifndef _LIB_COMPLEX #define _LIB_COMPLEX #include <bits/stdc++.h> namespace lib { using namespace std; template <typename T> struct Complex { T re, im; Complex(T a = T(), T b = T()) : re(a), im(b) {} T real() const { return re; } T imag() const { return im; } explicit operator T() const { return re; } tem...
ALGO
0.945336
5.682119
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2018-07-25T21:32:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "829de21e...
d9c10e25-f1a8-40fa-9fc4-afaeef989494
XDEv11/Codeforces
Helvetic_Coding_Contest_2017/I.cpp
//#pragma GCC optimize ("O3") #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; class SAM { struct vertex_t { int len, fp, link; bool cloned; map<int, int> next{}; explicit vertex_t(int l, int f, int lk = -1, bool c = false, const map<int, int>&...
ALGO
0.999931
4.508311
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-02-06T13:58: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": "657a047be8...
d9ed9ca3-7621-4828-97b8-79310e43bcce
Eveneko/LeetCode
4.寻找两个有序数组的中位数.cpp
/* * @lc app=leetcode.cn id=4 lang=cpp * * [4] 寻找两个有序数组的中位数 * * https://leetcode-cn.com/problems/median-of-two-sorted-arrays/description/ * * algorithms * Hard (35.22%) * Likes: 1164 * Dislikes: 0 * Total Accepted: 61.9K * Total Submissions: 175.4K * Testcase Example: '[1,3]\n[2]' * * 给定两个大小为 m 和 ...
ALGO
0.999996
6.407002
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2019-09-30T09: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": "f85b1d1a6...
feae64bf-b8d8-4f54-9f5b-517d9d97aab2
a07458666/lsof
hw1.cpp
#include <stdio.h> #include <vector> #include <string> #include <cstring> #include <getopt.h> #include "lsof.h" int GetOpt(int argc, char* argv[], std::vector<std::string> &commandFilter, std::vector<std::string> &typeFilter, std::vector<std::string> &filenamesFilter) { int flags, opt; ...
TOOL
0.915045
3.734411
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2022-03-14T12:44: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": "c821b82d720...
98cfaaff-4b5d-4a8e-824a-600e36932009
hundeboll-silicom/oneccl
src/common/comm/l0/topology/ring/thread_group_ring_creator.hpp
/* Copyright 2016-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
TOOL
0.948737
6.677661
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2021-07-15T08:30: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": "a52517b1079...
6b6b752c-5e12-415d-a675-048964e1f543
Nauh24/CPP-Codeptit
CPP0353_DienThoaiCucGach.cpp
#include <bits/stdc++.h> using namespace std; char mapToDigit(char c) { c = toupper(c); if (c >= 'A' && c <= 'C') return '2'; if (c >= 'D' && c <= 'F') return '3'; if (c >= 'G' && c <= 'I') return '4'; if (c >= 'J' && c <= 'L') return '5'; if (c >= 'M' && c <= 'O') return '6'; if (c >= 'P' && c <= 'S') return '...
ALGO
0.999922
4.240034
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-06-27T04:22: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": "83d0db36c37...
17eb3efb-dc3f-421f-9593-670fc677bbdd
arnabnath01/GFG-solutions
Difficulty: Medium/Find the number of islands/find-the-number-of-islands.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; bool isValid(int i, int j, int &n ,int &m, vector<vector<char>> &g){ return (i>=0 && j>=0 &&...
ALGO
0.999808
6.317632
{ "github_metadata": { "branch": "main", "commit_count": 923, "repo_created_at": "2023-08-19T16:31:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e8f64d3079...
f99461cc-230e-41d6-9267-e8d2d359cdfd
sudoLife/n-particle-simulator
openmpi/openmpi.cpp
#include "constants.hpp" #include "defaults.hpp" #include "partial_grid.hpp" #include "particles.hpp" #include <chrono> #include <cxxopts.hpp> #include <fmt/os.h> #include <mpi.h> #include <unistd.h> typedef std::chrono::high_resolution_clock hclock; using std::chrono::duration_cast; typedef std::chrono::microseconds ...
ALGO
0.998601
5.816711
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-03-22T14:26: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": "2b3a83d8773...
9901e23a-f2ca-4334-ad8c-ecd4856897af
DishaSharma-dev/DataStructure
count_ways.cpp
/* Count ways There exists a special graph which has directed M edges and N nodes and graph contains no cycles. Count the number of ways to reach different nodes from S. A way is called different from others if the destination node or used edges differ. As the ways can be large, print the ways modulo 1000000007. Inclu...
ALGO
0.99993
5.178055
{ "github_metadata": { "branch": "master", "commit_count": 269, "repo_created_at": "2021-02-10T12:22:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b18c3e58...
ac6e7bf0-afad-4cf3-b528-d0848c82d8f9
czajkatony/ExtraCredit1_Czajka
main.cpp
#include <cstring> #include <iostream> #include <fstream> #include <string> #include <map> #include <vector> using namespace std; // This function pulls data on preferences from a text file, name given by user // Formatting should be the same as 'matching-data.txt' with departments first // rows represent preference ...
ALGO
0.998704
4.204215
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-02-20T22:07: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": "2f726f1e1c9d...
37e6d423-6bc2-483d-b5c5-b93009bf2643
ThereWillBeOneDaypyf/Summer_SolveSet
hdu/multi_train_8/11.cpp
#include <iostream> #include <string.h> #include <stdio.h> using namespace std; typedef long long LL; const LL p = 1e9 + 7; const LL MOD = 1e9 + 7; long long C[2005][2005]; void fun() { C[0][0] = 1; C[1][0] = C[1][1] = 1; for(int i = 2;i< 2005;i++) { C[i][0] = 1; for(int j = 1;j<=i;j++) { C[i][j...
ALGO
0.999988
4.10593
{ "github_metadata": { "branch": "master", "commit_count": 310, "repo_created_at": "2017-06-13T13:45:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c1b3ce91...
db1a42d6-e10b-4611-b411-e2b0c72d3403
nstroustrup/lifespan
external_compile_libraries/InsightToolkit-4.10.0/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx
/*========================================================================= * * Copyright Insight Software Consortium * * 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 * * h...
TEST
0.955599
6.343378
{ "github_metadata": { "branch": "flow", "commit_count": 1446, "repo_created_at": "2012-10-31T22:29:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23, "forks": 16, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "151ae54...
435f6c5a-a525-4cf2-8680-e70cf9d7957e
samuelili/reskewer
app/test.cpp
#include <iostream> #include <cctype> #include <cassert> #include <cstring> using namespace std; const int MAX_WORD_LENGTH = 20; const int MAX_TOOTH_LENGTH = 240; void toLowerCase(char* str) { while (*str) { *str = tolower((unsigned char)*str); str++; } } bool hasOnlyLetters(const char* str...
ALGO
0.992518
4.882039
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T19:21: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": "89cbd91a5e24...
2184214f-e8da-46db-b14c-a910fb39de1b
ishandutta2007/codeforces-f
flashmt/normal/452/D.cpp
#include <bits/stdc++.h> using namespace std; int fWash[1111], fDry[1111], fFold[1111]; set < pair<int,int> > sWash, sDry, sFold; int main() { ios::sync_with_stdio(0); int k, n1, n2, n3, t1, t2, t3; cin >> k >> n1 >> n2 >> n3 >> t1 >> t2 >> t3; for (int i = 1; i <= n1; i++) sWash.insert(make_pair(0, i)); for (...
ALGO
0.999476
3.473582
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43: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": "344b8bfbb343...
f9c68489-8868-45bb-9c79-1eebf722bc29
ericniebler/range-v3
include/range/v3/numeric/inner_product.hpp
/// \file // Range v3 library // // Copyright <NAME> 2013-present // Copyright <NAME> 2014 // // Use, modification and distribution is subject to 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) // // Project home: https://gi...
ALGO
0.996816
7.638611
{ "github_metadata": { "branch": "master", "commit_count": 2541, "repo_created_at": "2013-11-11T16:05:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4273, "forks": 457, "issues": 262, "pull_requests": 24 }, "file_meta": { "content_id": ...
c666ffc3-613d-4f33-8f95-c01879a6ecf9
bskumawat09/dsa-prep
dp/16-grid-unique-paths-2.cpp
/* * https://leetcode.com/problems/unique-paths-ii/ * */ #include <cstring> #include <iostream> #include <vector> using namespace std; class SolutionMemo { public: int gridUniquePaths(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); dp = vector<vector<int>>(m, ...
ALGO
0.999954
6.163037
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2022-07-27T05:44: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": "fcfb6774835...
3bf18e07-5b09-44e5-8b67-5d917043277b
peppapighs/submissions
OI/BOI/2019/nautilus.cpp
#include <bits/stdc++.h> using namespace std; const int N = 505; const int M = 5e3 + 5; int r, c, m; char a[N][N], dir[M]; bitset<N> mask[N], dp[N]; int main() { scanf("%d %d %d", &r, &c, &m); for (int i = 0; i < r; i++) { scanf(" %s", a[i]); for (int j = 0; j < c; j++) { if (a[i...
ALGO
0.999983
4.454722
{ "github_metadata": { "branch": "master", "commit_count": 297, "repo_created_at": "2019-03-26T03:29:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d0c9ba...
1dee95ee-9707-4759-9dac-b22ba3c1cde4
CTU-IIG/green-scheduling-bab
Iirc.EnergyStatesAndCostsScheduling/Iirc.EnergyStatesAndCostsScheduling.Shared/cpp/src/datastructs/FixedPermCostComputation.cpp
// This file is released under MIT license. // See file LICENSE.txt for more information. #include <algorithm> #include <numeric> #include <stdexcept> #include <cassert> #include "FixedPermCostComputation.h" #include "../input/Instance.h" namespace escs { FixedPermCostComputation::FixedPermCostComputation( ...
ALGO
0.999907
4.33545
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-30T11:43:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4eb24ddad20b4...
e0a0b1a0-15c3-4991-a575-38645a82049f
Jamesuhao/C-
每日一题/每日一题14/每日一题14/test.cpp
//#1计算日期到天数转换 #if 0 /* 题目描述 根据输入的日期,计算是这一年的第几天。。 详细描述: 输入某年某月某日,判断这一天是这一年的第几天? 输入描述: 输入三行,分别是年,月,日 输出描述: 成功:返回outDay输出计算后的第几天; 失败:返回-1 示例1 输入 2012 12 31 输出 366 */ #include<iostream> using namespace std; int main() { int days[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int year, month, day; cin >> year >> month >>...
ALGO
0.997983
3.278558
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2019-10-23T03:56: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": "415926e04...
65f729d7-861c-480d-b681-c35ac7c3788f
showmic96/Online-Judge-Solution
UVA/10307/16856234_AC_20ms_0kB.cpp
// In the name of Allah the Most Merciful. #include<bits/stdc++.h> using namespace std; typedef long long ll; int n , m , par[55*55] , lvl[55][55]; string ar[55]; struct edges{ int u , v , w; edges(int _u , int _v , int _w){ u = _u; v = _v; w = _w; } }; vector<edges>v; bool c...
ALGO
0.998763
4.508892
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2019-12-26T03:05: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": "2dbe6b55a...
411e52c0-3302-4abf-aae2-0885709845c1
ChristophS198/AoC_2023
23/sol_23.cpp
#include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <set> #include "../utility.h" namespace Day23 { struct Vertex; using TPos = int; using TVId = int; using TEdge = std::pair<int,TVId>; constexpr char PATH{ '.' }; constexpr char FOREST{ '#' }; con...
ALGO
0.99985
5.516703
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2023-12-03T07:31: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": "76dea1d44...
ca16def3-52b0-4ba0-ac94-9ab3ac404824
enderdzz/algorithm_problem_solutions
cproj/trash/11997.cpp
#include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> #define minD 562510 #define minK 760 #define INF 0x3f3f3f3f int N, D, min[4*minD], a[minK][minK], ans[minK]; void init(){ for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ std::cin>>a[i][j]; } std::sort(a[i], a[i]+N); } fo...
ALGO
0.999844
3.302253
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2015-08-28T13:25:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "c6272de5d...
c0e503ab-ebd8-4151-8564-56c8e8d80acb
goretkin/kwc-ros-pkg
pkg/branches/josh/vision/calonder_descriptor/src/test/directed_test.cpp
#include "calonder_descriptor/matcher.h" #include "calonder_descriptor/rtree_classifier.h" #include "fast.h" #include <cvwimage.h> #include <highgui.h> #include <vector> #include <ctime> #include <cstdio> using namespace features; xy* fast(const IplImage* image, int threshold, int barrier, int* num_nonmax) { int nu...
ALGO
0.989408
5.883462
{ "github_metadata": { "branch": "master", "commit_count": 8093, "repo_created_at": "2015-06-03T00:00:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5246df2...
48aeca2f-b405-463d-97b7-22bc0900ccb7
mindcont/open-source
Facebook/Surround360/surround360_render/source/calibration/IntrinsicCalibration.cpp
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE_render file in the root directory of this subproject. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #include <i...
ALGO
0.943943
6.754331
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2015-10-23T11:14:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2323cac5...
2af81b0e-a500-4ed9-804d-ab0bd7f4c150
im281/Sherwood
cpp/demo/source/DensityEstimationExample.h
#pragma once #include <math.h> #include <iostream> #include <string> #include <vector> #include <sstream> #include <limits> #include "Graphics.h" #include "Sherwood.h" #include "CumulativeNormalDistribution.h" #include "DataPointCollection.h" #include "Features.h" #include "StatisticsAggregators.h" #include "Dens...
ALGO
0.975111
3.531501
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-03-30T20:11:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfa4b0ca45...
948ab9a1-da2c-455a-b491-608009e37e33
Sefayet-Alam/New-CP-submissions_vol_3
L_Binary_String.cpp
///********************** بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ **********************/// /** * author: <NAME> * date : 2024-02-27 11:37:28 **/ #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mod 1000000007 #define inf...
ALGO
0.999974
4.254702
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-10-15T14:27: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": "6d8554835f5...
470ef83b-b50f-431c-941e-e1101dc45575
giackserva/adventofcode
2019/day10/10_2.cpp
#include <iostream> #include <vector> #include <string> #include <limits> #include <algorithm> #include <queue> struct Point { int x; int y; }; double slope(Point p1, Point p2) { if (p1.x - p2.x) return (double) (p2.y - p1.y) / (double) (p1.x - p2.x); return std::numeric_limits<double>::infinity(); } ...
ALGO
0.999949
4.726876
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-12-01T10:35: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": "399fe45ca...
8bed3aa1-e8af-4b93-865b-cc0ce18d5290
mohammad-umer79/Cpp_programs
shapes/rhombus_angle.cpp
#include<iostream> using namespace std; int main(){ int n; cout <<"Enter the number: "; cin>>n; for (int i = 1; i <=n; i++) { for (int j = n; j >= i; j--) { cout <<" "; } for (int k = 1; k <= i; k++) { cout <<"l "; } cout<<endl; } // bottom loo...
ALGO
0.999002
3.301754
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2025-07-01T09:03: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": "0d56b4a06a0...
e73a6321-565a-4ab1-a52d-53a0edecb569
edmondium/high-performance-scientific-computing-in-cxx
Book/chapter2/examples/overload0.cc
// examples/overload0.cc #include <iostream> #include <cmath> #include <limits> auto power(double x, int n) -> double { if (n == 0) return 1.; else if (n < 0) return 1.0/power(x, -n); auto ans{1.}; while (n--) ans *= x; std::cout << "Using a simple loop to calculate power\n"; return ans; } aut...
ALGO
0.939177
6.379898
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-11-02T08:09:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57dee0a4917b...
d0298f0b-1258-4914-8641-9b62fe47d93b
MaheshAravindV/CP
1561/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define nl "\n" template <typename A, typename B>ostream& operator<<(ostream& os, const pair<A, B>& p) { return os << '(' << p.first << ' ' << p.second << ')'; } template <typename X, typename T = typename enable_if<!is_same<X, string>::value, typenam...
ALGO
0.999872
3.913038
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-08-09T13:56: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": "a6a8695a5d5...
61d41e1e-0bc3-4089-b58e-74572ae3f666
reyoung/Paddle
paddle/legacy/math/Matrix.cpp
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
TOOL
0.935045
6.888211
{ "github_metadata": { "branch": "develop", "commit_count": 19339, "repo_created_at": "2016-09-02T03:14:43.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "PaddlePaddle/Paddle", "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "con...
e7dbacec-a64b-4f5e-94ac-c65b2284c31c
ninhngocnhi/C-Demo
phandoan.cpp
#include <bits/stdc++.h> using namespace std; struct node { long long l, r, ans, pos; }; long long n, N = 200006; long long BIT[200006]; node a[200006]; vector <int> v; int comp2 (node a, node b) { return (a.pos < b.pos); } int comp1 (node a, node b) { if (a.r < b.r || (a.r == b.r && a.l > b.l)) return 1; els...
ALGO
0.999932
4.299826
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-07-26T06:40: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": "6e65635064d9...
cec37968-ba67-4bd9-9dbe-8d8f50a7bd1f
Dhananjaykul/CPP
lect_13/code.cpp
// Leetcode problem 50(Pow) // Calculating power of (x^n) // 5^3 = 5*5*5 But not an Optimized way | time complexity will be O(n) // Optimize way will have time complexity of O(logn) // 3^5 = 3*3*3*3*3 | now 5 in binary = 101 | let's use loop on this binary form instead of power | We associate a specific number to eac...
ALGO
0.999441
5.273074
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-05-14T05:55:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7d7f6a52397...
c94c65a2-49d6-40a4-9457-b74b97a58739
AltimorTASDK/TribesRebirth
darkstar/Terrain/Code/grdHeight.cpp
//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- #include "grdBlock.h" #include "grdHeight.h" //---------------------------------------------------------------------------- void GridHeight::getNormal(const...
ALGO
0.997239
5.441738
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2015-07-17T12:10:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 14, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e453c95...
fd32d4d4-7759-422f-aa5a-74d78df053e3
emon4075/CodeForces
A_Cover_in_Water.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define PB push_back #define All(V) V.begin(), V.end() #define F first #define S second const int MOD = 1e9 + 7; const int INF = INT_MAX; void FASTIO() { ios::sync_with_stdio(false); cin.tie(NULL); } int main() { FASTIO...
ALGO
0.999717
3.929401
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2023-09-14T14:12: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": "6b5e9a19...
32b225b5-eaa4-4934-a505-0a28eeb76c97
maitreyeekhunte/LP_5
A2_PRAC.cpp
#include<iostream> #include<chrono> #include<vector> #include<omp.h> #include<bits/stdc++.h> using namespace std; using namespace chrono; void parallelBubbleSort(vector<int>& arr){ int n=arr.size(); #pragma omp parallel for for(int i=0;i<n-1;++i){ for(int j=0;j<n-i-1;++j){ if(arr[...
ALGO
0.999875
5.819683
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-04-29T23:47: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": "9a2d03d25025...
606db932-1986-4915-aa4f-cff5c8a305c5
mikehung/competitive-programming
codeforces/35/C/sol.cc
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> #include <climits>...
ALGO
0.99999
3.69136
{ "github_metadata": { "branch": "master", "commit_count": 182, "repo_created_at": "2018-10-18T09:10: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": "3642809f...
e83697da-b95c-4efd-ba38-a8a17d08fc28
hasanulmukit/Programming-Problems
Intermediate/31.Solve the Fractional Knapsack Problem/Solution.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Item { int weight; int value; double ratio; }; bool compareItems(const Item &a, const Item &b) { // Sort in descending order of ratio return a.ratio > b.ratio; } int main() { int n; cout << "Enter the n...
ALGO
0.999982
5.493646
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2025-02-17T04:57:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00eb9b8026f...
822e5668-552e-4584-841e-fb00bd3921fd
alcap-org/AlcapDAQ
analyzer/compress/n2fadc_tpc_compress.cpp
////////////////////////////////////////////////////////////////////// // // New Louvain/Berkeley Flash ADC compression // ////////////////////////////////////////////////////////////////////// #include <stdio.h> #include "midas.h" #include "mucap_compress.h" #include "mucap_structures.h" BOOL should_compress_n2f...
DATA
0.914541
6.163601
{ "github_metadata": { "branch": "R15b", "commit_count": 4271, "repo_created_at": "2014-05-19T00:44:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 0, "issues": 28, "pull_requests": 1 }, "file_meta": { "content_id": "a5e511ed4...
f36f8304-f5ef-4a1e-8169-9c4d82767e6c
ArtemPustunniy/ITMO_Algorithms
lab №13/8.cpp
#include "iostream" #include "vector" using namespace std; int del = 1e9 + 7; vector<vector<int>> pole; long long first_cord = 0; long long second_cord = 0; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; pole.resize(n, vector<int>(m, 0)); for (int i...
ALGO
0.999859
5.322365
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2024-06-12T18:28: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": "a5b5c7b426...
b4c3e470-01a3-42b7-9ec0-cdd6ff85e78e
ayush-tiwari57/competitive-programming
Codeforces/1324E.cpp
#include <bits/stdc++.h> using namespace std; bool in(int x, int l, int r) { return l <= x && x <= r; } int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #endif int n, h, l, r; cin >> n >> h >> l >> r; vector<int> a(n); for (auto &it : a) cin >> it; vector<v...
ALGO
0.999739
4.03628
{ "github_metadata": { "branch": "master", "commit_count": 305, "repo_created_at": "2020-03-06T16:46:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ca72f8e...
6259a49a-4084-46dd-8be4-0ee14a5159d7
projeto-de-algoritmos/DC_LeetCode_
LeetCode_493/reverse_pairs.cpp
#include <vector> class Solution { private: int count; // Contador para os pares inversos public: Solution() : count(0) {} // Inicializa o contador int reversePairs(std::vector<int>& nums) { mergeSort(nums, 0, nums.size() - 1); // Inicia a ordenação e contagem return count; // Retorna...
ALGO
0.999941
6.382413
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2024-08-20T00:23:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17b8fa266d...
7fcef42e-ecd5-435e-8d50-93b48eaac448
Voidminded/conquerVoidLand
Template.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ int main() { int playerCount; // the amount of players (between 2 to 4 ) int myId; // my p...
ALGO
0.99308
3.477189
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2015-05-13T20:51:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d43e91e2e...
7dd8678d-c845-43d9-9eb2-2842134f03c6
alexandru-dinu/programming-challenges
competitive-programming/codeforces/round_638_div_2/phoenix_and_balance.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long void better_solve() { /* * there's this pattern: * 2^n + sum(2^1 ... 2^(n/2 - 1) - sum(2^n/2 ... 2^(n-1)) */ int n; cin >> n; int mid = n / 2; ll d = 1 << n; for (int i = 1; i < mid; i++) ...
ALGO
0.999677
4.292738
{ "github_metadata": { "branch": "main", "commit_count": 270, "repo_created_at": "2020-12-12T20:10:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 20, "pull_requests": 0 }, "file_meta": { "content_id": "971abd05b...
58ed3108-673d-4578-a3a7-f4befdf0a32b
RoBorregos/RescueMaze2024
algorithm/algoritmo.cpp
#include<iostream> #include<vector> #include<unordered_map> #include<stack> #include<climits> using namespace std; #include "Tile.cpp" constexpr TileDirection directions[] = {TileDirection::kUp, TileDirection::kDown, TileDirection::kLeft, TileDirection::kRight}; vector<vector<char>> maze = { // {'#', '#', '...
ALGO
0.999505
4.689513
{ "github_metadata": { "branch": "main", "commit_count": 252, "repo_created_at": "2023-11-11T07:05:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 7, "pull_requests": 5 }, "file_meta": { "content_id": "f7d3adfb50f...
7e71949d-1a9a-4e01-a3b4-1701588ac0a6
iRobot42/Geeks-for-Geeks
Easy/Maximum value.cpp
long long findMaxValue( long long a[], int n ) { if ( n < 4 ) return -1; long long aj{ 0 - a[ 0 ] }, ai{ aj + a[ 1 ] }, al{ ai - a[ 2 ] }, ak{ al + a[ 3 ] }; for ( int i{ 4 }; i < n; ++i ) aj = max( aj, 0 - a[ i-3 ] ), ai = max( ai, aj + a[ i-2 ] )...
ALGO
0.999387
4.043982
{ "github_metadata": { "branch": "main", "commit_count": 956, "repo_created_at": "2023-05-17T17:13:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70a273888b...
7437f456-7f57-412a-ba4f-2e5cf037a425
aminjonshermatov/competitive_programming
codeforces/div3/797/E.cpp
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define f first #define s second #define ll int64_t #define ull uint64_t #define pll pair<ll, ll> #define pull pair<ull, ull> #define all(x) (x)....
ALGO
0.999949
4.054149
{ "github_metadata": { "branch": "master", "commit_count": 1009, "repo_created_at": "2022-06-30T12:19:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18c34ad...
0ecba5a7-ca50-4c80-a303-3010b1c0bc88
2997ms/Competitive-programming-problems
POJ/3243/15449256_RE.cpp
//#pragma comment(linker, "/STACK:655360000") #pragma warning(disable:4996) #include <iostream> #include <functional> #include <algorithm> #include <cstring> #include <vector> #include <string> #include <cstdio> #include <cmath> #include <queue> #include <stack> #include <deque> #include <set> #include <map> using na...
ALGO
0.999976
3.458764
{ "github_metadata": { "branch": "master", "commit_count": 179, "repo_created_at": "2016-05-05T02:53:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f70733e...
cd9a8d15-f97c-47a1-90b0-c7594689748b
CFGSME2024/Girasol
Arduino/008_Girasol/008_Girasol.ino
/********************************************************************************** ** ** ** <NAME> ** ** 23/11/23 ** ...
TOOL
0.925116
4.680157
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-10-20T16:24:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d2cb7b459e5...
d028730c-1256-4daf-959c-421aefa012f0
sheriby/LuoGu
Problems/P1042/main.cpp
#include <iostream> #include <string> using namespace std; int l[2]{0}; int r[2]{0}; int score[2]{11, 21}; string res[2]{"", ""}; void judge(int i) { if (l[i] >= score[i] && l[i] - r[i] >= 2 || r[i] >= score[i] && r[i] - l[i] >= 2) { res[i] += std::to_string(l[i]) + ":" + std::to_string(r[i]) + "\...
ALGO
0.999746
3.566777
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2022-01-24T08:13:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "612e0d47f...
9c89f958-9c90-4ea3-a404-f8dd4e3e1e5d
aoggg/cpp
AtCoder/abc131_d.cpp
// Problem: D - Megalomania // Contest: AtCoder - AtCoder Beginner Contest 131 // URL: https://atcoder.jp/contests/abc131/tasks/abc131_d // Memory Limit: 1024 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <iostream> #include <utility> #include <algorithm> using namespace std; c...
ALGO
0.999995
4.611721
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2021-11-14T09:08: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": "8d5b9033c5...
5621a9d6-2a7d-4368-8e4a-5b0f1ee45b6c
Krish3914/leetcode
checkifstring_canbe_madeequal.cpp
static const int __ = []() { std::ios::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); return 0; }(); class Solution { public: bool checkStrings(string s1, string s2) { int i, j; int n1 = s1.size(); int n2 = s2.size(); unordered_map<char, int> mpo1, mpo2, mpe1, mpe2; for (...
ALGO
0.999432
4.87121
{ "github_metadata": { "branch": "main", "commit_count": 75, "repo_created_at": "2023-10-08T12:17: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": "398deadc8d2...
8a29ed7b-4e85-454a-9d7c-c51f514906f8
kgoel9899/CF_Solutions
codeforces/1787/C.cpp
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define mod 998244353 #define int long long #define setpres cout << fixed << setprecision(10) #define all(x) (x).begin(), (x).end() #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" const int INF = 1e18; #ifdef DEBUG #de...
ALGO
0.999969
5.15667
{ "github_metadata": { "branch": "master", "commit_count": 1962, "repo_created_at": "2020-12-21T08: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": "5558224...