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
7750bb0d-18e5-48d6-8a88-7a467c5ad750
Shoyeb45/CompetitiveProgramming
Miscellaneous/AlgoZenithICPCContest/B-JourneyThroughTime.cpp
#include<bits/stdc++.h> using namespace std; #define range(x) (x).begin(), (x).end() #define NFS ios_base::sync_with_stdio(false); cin.tie(NULL); typedef long long ll; template<typename T> void debug(string v1, T t1) { cout << v1 << ": " << t1 << "\n"; } template<typename T, typename K> void debug(string v1, T t1, stri...
ALGO
0.9999
4.247935
{ "github_metadata": { "branch": "main", "commit_count": 1085, "repo_created_at": "2024-01-22T14:10:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69410ee88...
b6f16b57-ed20-4df6-9913-2e329af674a6
feliwir/libvp6
include/vp6/huffman.hpp
#pragma once #include <algorithm> #include <math.h> #include <stdint.h> #include <vector> namespace vp6 { struct Node { int Probability; int Symbol; Node *Left; Node *Right; }; class Huffman { public: Huffman(const uint8_t *model, const uint8_t *map, int size) { int a, b; m_b...
ALGO
0.999883
5.287683
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2019-05-18T18:21:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "fb7c06d00...
e559ccb7-1ea6-4bdc-9448-3e444246e47d
cfezequiel/self-driving-car-nd
P5_extended_kalman_filter/src/FusionEKF.cpp
/* Copyright 2020 Google LLC 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...
ALGO
0.943355
6.720621
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2020-08-07T00:00: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": "d3d856c21...
70e0b6da-d033-4677-a418-9422f220f66d
nachiketa3299/RPS
src/past/BOJ_14681.cpp
#include <iostream> #include <cassert> using namespace std; int whatQuadrant(int x, int y) { int quadrant_index = 0; assert(x > 0 || x < 0); assert(y > 0 || y < 0); assert(x <= 1000 && x >= -1000); assert(y <= 1000 && y >= -1000); assert(x != 0); assert(y != 0); if (x > 0 && y > 0) {...
ALGO
0.999578
4.252212
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2024-02-21T07:18: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": "d82da8967...
abc2e204-64f6-4425-bd7a-672c406b84db
atlas25git/DSA_FinalSolution
49GraphProblems/01BeautifulGraph.cpp
//problem basically asks if the graph is bipartite #include <bits/stdc++.h> using namespace std; const int N = int(3e5) + 999; const int MOD = 998244353; int n, m; vector <int> g[N]; int p2[N]; int cnt[2]; int col[N]; bool bad; void dfs(int v, int c){ col[v]=c; ++cnt[c]; for(auto to : g[v]){ if...
ALGO
0.999965
4.977956
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2021-05-06T03:02:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3dcb5656c...
caeb8a26-f56f-4662-9cf5-e569cb63527e
thisisrv/CodingNinjas
PriorityQueue/minPriorityQueue.cpp
#include<vector> #include<iostream> using namespace std; class PriorityQueue{ vector<int> pq; public: PriorityQueue(){ } bool isEmpty(){ return pq.size() == 0; } int getSize(){ return pq.size(); } int getMin(){ //check if pq is empty if(isEmp...
ALGO
0.99991
4.761583
{ "github_metadata": { "branch": "main", "commit_count": 74, "repo_created_at": "2022-03-03T13:32:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a81f55fc29e...
9a3ea564-16c6-4ade-8e8c-13f337cdc004
chauhankartik/UVa
Cses/SearchinSortings/Apartments.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(0),cin.tie(0); int n, m, k; cin >> n >> m >> k; vector<int> a(n), b(m); for(int i = 0; i < n; i++) { cin >> a[i]; } for(int j = 0; j < m; j++) { cin >> b[j]; ...
ALGO
0.999974
3.909067
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2021-05-03T16:38: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": "dbc28fd18...
eccc2adb-a225-4c44-8c1b-80b9ffb9c453
suddenlykevin/15418-final-abmeza-kevinx
pixImage.h
/** * @file pixImage.h * @author <NAME> () * <NAME> (abmeza) * @brief Header file with the contents of the pixImage object * * @version 0.1 * @date 2022-04-22 * * @copyright Copyright (c) 2022 * */ #include "helper.h" // GLOBAL CONSTANTS #define T_f 1.0f //<- T final, dictates when we finish o...
ALGO
0.912829
4.268451
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2022-03-23T15:44:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8eca01221a...
611db99b-1857-4c9b-808e-604b83025f78
yukikamome316/atcoder-archive
adt_all_20231026_2/abc285_b_46944895_TLE.cpp
/* * Author: yukikamome316 * Submission URL: https://atcoder.jp/contests/adt_all_20231026_2/submissions/46944895 * Submitted at: 2023-10-26 19:21:09 * Problem URL: https://atcoder.jp/contests/adt_all_20231026_2/tasks/abc285_b * Result: TLE * Execution Time: 2210 ms */ #include <bits/stdc++.h> #define rep(i, n) ...
ALGO
0.99996
4.248805
{ "github_metadata": { "branch": "main", "commit_count": 559, "repo_created_at": "2023-05-10T01:41: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": "f1c0507eda...
b71ec511-3ed4-4382-9774-48d1dccb43a0
anandbhalerao18/Questions-CPP
que7i.cpp
// 7. Write a function enqueue(int value) to insert a new element and display()to display all the elements currently present into the Circular Queue. #include <iostream> using namespace std; #define MAX 5 // Maximum size of the queue class CircularQueue { int front, rear, queue[MAX]; public: CircularQueue()...
ALGO
0.997162
5.837413
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-12-11T12:34: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": "a7b13c6698c8...
aaa380ba-555d-4ccb-92d5-162036befe81
ishandutta2007/codeforces-h
heltion/normal/1200/B.cpp
//Author: Heltion //Date: 08-12-2019 #include<bits/stdc++.h> using namespace std; using LL = long long; template<typename T>void no(T s){cout << s; exit(0);} void no(){cout << "NO"; exit(0);} constexpr int maxn = 1200000; int h[maxn]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cou...
ALGO
0.999917
3.443451
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01: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": "98b75f52b8a3...
948578f1-cce2-4757-bc0a-6a6cb1dd996f
mohitmcanitt/Programming-Code
Heap/07. Median of Running Stream.cpp
/* Leetcode 295 : https://leetcode.com/problems/find-median-from-data-stream/ Time Complexity: O(n Log n). Time Complexity to insert element in min heap is log n. So to insert n element is O( n log n). Auxiliary Space : O(n). The Space required to store the elements in Heap is O(n) ...
ALGO
0.999953
6.298689
{ "github_metadata": { "branch": "main", "commit_count": 394, "repo_created_at": "2021-03-02T05:29: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": "b419cc9f37...
5c340fe9-2b27-4b5c-9022-9d7c60f1c349
nightingale-media-player/nightingale-deps
xulrunner-1.9.2/mozilla/layout/tables/FixedTableLayoutStrategy.cpp
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // vim:cindent:ts=4:et:sw=4: /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except ...
TOOL
0.984687
6.369978
{ "github_metadata": { "branch": "xul-192-new", "commit_count": 1749, "repo_created_at": "2011-09-21T07:03:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23, "forks": 13, "issues": 12, "pull_requests": 0 }, "file_meta": { "content_id": "...
b3d27a47-fb73-4327-9357-e1bb341d7366
kifah-s/Fundamentals_Of_Programming
Gammal_Tech_Academy/Core_Courses/2_C++_Programming_Language/Les_6_C++_Sort/Exercises_2/Pro_4_Sort_Mixed_Array_Program/Sort_Mixed_Array_Program_V1.cpp
//* Sort Mixed Array Program (Version 1). /* * Create a program that sorts a mixed array of integers and floats in ascending order, * The array mixedArray is initially {9, 8.5, 7, 6.3, 5}. ! Output: ! Sorted Mixed Array: 5 6.3 7 8.5 9 */ #include <iostream> #include <array> #include <vector> #include <string> #inc...
ALGO
0.999415
4.608848
{ "github_metadata": { "branch": "main", "commit_count": 2110, "repo_created_at": "2023-04-07T14:22: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": "0a1ba9d22...
1cef50e5-c787-409d-a510-97fb8c00f455
mongodb/mongo
src/third_party/boost/libs/graph/include/boost/graph/wavefront.hpp
// //======================================================================= // Copyright 2002 <NAME> (<EMAIL>) // ETH Zurich, Center of Structure Technologies // (https://web.archive.org/web/20050307090307/http://www.structures.ethz.ch/) // // Distributed under the Boost Software License, Version 1.0. (See // accompan...
ALGO
0.999218
6.988689
{ "github_metadata": { "branch": "master", "commit_count": 90314, "repo_created_at": "2009-01-15T16:15:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 27329, "forks": 5655, "issues": 0, "pull_requests": 82 }, "file_meta": { "content_id": ...
99245e23-3ae6-4cf2-8cab-11b9d2b4634d
itsquasi23/itsquasi-cpp-projects
1.school/grade_9/Apr04/Cau1.cpp
//2025 = 45² = (20+25)² = 5²*9² = (1+2+3+4+5+6+7+8+9)² = 1³+2³+3³+4³+5³+6³+7³+8³+9³ //MΔDE BY ITSQUΔSI #include <bits/stdc++.h> #define ll long long using namespace std; bool prime[10000007]; void sieve(){ prime[1] = prime[0] = 1; for (int i = 2; i * i <= 10000007; ++i){ if (!prime[i]){ f...
ALGO
0.999914
4.852472
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-03-29T01:41: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": "9e598e256d0...
5178a156-00c7-40e1-8489-701ee68813fb
andreyAmaterasu/lab2
MatrixLowerTriangleMinFinder.cpp
#include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #define N 5 using namespace std; // Функция для нахождения минимума в нижнетреугольной части матрицы float findMimLowerTriangle(float matrix[N][N]) { float minValue = matrix[0][0]; for (int i = 0; i < N; i++) { for (int j = 0;...
ALGO
0.999993
5.332589
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-06-12T10:08:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b2412ca60...
6d49367a-8a4c-492b-a8d5-3e22fdc44179
Gin101/CS101
competition/P1596.cpp
#include <iostream> using namespace std; int n = 0; int m = 0; const int maxNM = 100; char lake[maxNM][maxNM] = {{0}}; int result = 0; void dfs(int row, int col) { lake[row][col] = '.'; if ((row + 1) < n && lake[row + 1][col] == 'W') { dfs(row + 1, col); } if ((row - 1) >= 0 && lake[row - 1][col] == 'W') { d...
ALGO
0.999721
4.73955
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2021-08-19T15:41: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": "053de88d5...
aa66d8fa-24cc-4809-b240-ad0cc514dea5
JosephJostar0/pat
甲级cpp/1074 Reversing Linked List.cpp
#include <iostream> #include <vector> #define MAXN 100000 int next[MAXN], data[MAXN]; int main() { int current, N, K, i, flag = 0; scanf("%d%d%d", &current, &N, &K); for (i = 0; i < N; i++) { int x; scanf("%d", &x); scanf("%d%d", data + x, next + x); } std::vector<int> v; ...
ALGO
0.999864
3.444157
{ "github_metadata": { "branch": "main", "commit_count": 208, "repo_created_at": "2022-01-17T08:40:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c2488418b2...
39d8ee30-2422-4134-b6c8-cf2f285d161a
bqi343/cp-notebook
Implementations/content/graphs (12)/Matching/Hungarian.h
/** * Description: Given J jobs and W workers (J <= W), computes the minimum cost * to assign each prefix of jobs to distinct workers. * * @tparam T a type large enough to represent integers on the order of J * * max(|C|) * @param C a matrix of dimensions JxW such that C[j][w] = cost to assign j-th * job to w-th...
ALGO
0.999982
6.088803
{ "github_metadata": { "branch": "master", "commit_count": 1350, "repo_created_at": "2017-07-11T03:52:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2642, "forks": 429, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "15...
6fbc4ac1-28ef-486a-990a-12d2a08362e7
wrf-model/WRF
var/da/da_physics/da_tpq_to_slp_lin.inc
subroutine da_tpq_to_slp_lin ( T, Q, P, TERR, PSFC, T9, Q9, P9, PSFC9, SLP9) !----------------------------------------------------------------------- ! Purpose: computes sea level pressure from the rule ! t1/t2=(p1/p2)**(gamma*r/g). ! ...
ALGO
0.998796
4.430948
{ "github_metadata": { "branch": "master", "commit_count": 6746, "repo_created_at": "2016-08-16T20:39:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1417, "forks": 765, "issues": 161, "pull_requests": 21 }, "file_meta": { "content_id": "...
ac009212-bdec-4595-9fba-75b35878918c
hyeongcheolkim/ProblemSolving
C++/ps_codeforce/contests/#Global_Round16/D2/main.cpp
#include <bits/stdc++.h> using namespace std; constexpr int mxN = 1, mxM = 3e2; struct person { int sight; int idx; person() {} person(const int &sight, const int &idx) { this->sight = sight; this->idx = idx; } bool operator<(const person &obj) const { if (this-...
ALGO
0.99995
4.212159
{ "github_metadata": { "branch": "master", "commit_count": 1287, "repo_created_at": "2021-03-21T12:07:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e480986...
6b5c1cc5-92f6-43ca-b35b-82aaceb84391
vikask-iitg/Striver-SDE-Sheet_Challenge-2023
Day 006/19. 2 Sum.cpp
******************** LeetCode : Only Index is returned ******************** // Problem : Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice...
ALGO
0.999922
5.659207
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-06-08T09:02: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": "dbff631b45d...
be59fd8b-6ef2-41ca-980a-2c0d7b5132d9
datastax/cpp-driver
src/third_party/mt19937_64/mt19937_64.hpp
// This is a C++ version of the mt19937-64 code found here: // http://www.math.sci.hiroshima-u.ac.jp/~%20m-mat/MT/VERSIONS/C-LANG/mt19937-64.c // This is the original copyright and license: /* Copyright (C) 2004, <NAME> and <NAME>, All rights reserved. Redistribution and use in source and binary forms, with...
ALGO
0.921576
7.101497
{ "github_metadata": { "branch": "master", "commit_count": 2877, "repo_created_at": "2013-11-04T22:47:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 412, "forks": 286, "issues": 0, "pull_requests": 17 }, "file_meta": { "content_id": "210...
43ac3bae-c501-4599-8f82-7c4d54dc40c7
NicholasFan235/Google-Kickstart
2021/RoundA/Checksum/solution.cpp
#include <bits/stdc++.h> int N; std::vector<std::vector<int>> A, B; std::vector<int> R, C; std::vector<std::vector<int>> edges; long total; void solve() { edges = std::vector<std::vector<int>>(2*N, std::vector<int>(2*N)); total = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) ...
ALGO
0.999984
4.588822
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-11-19T13:26: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": "47f029e723...
d8bc3324-2292-4432-b1b3-5af3720d2de7
Tahmid019/8085_simulator
Source/CPU.cpp
#include "../Headers/Head_1.h" #include "../Headers/CPU.h" #include "../Headers/utils.h" int CPU::execute(uint8_t opcode) { std::cout << "Executing Opcode: " << std::hex << static_cast<int>(opcode) << std::endl; switch (opcode) { // === ACI === case 0xCE: { uint8_t value = memory.read(++reg...
ALGO
0.945104
5.959198
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2025-03-07T15:49:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ddb44e1d8...
e0f9f0f4-a6ee-4052-9975-f94180631a5f
seyedparsa/sharificpc
code/point-in-circle.cpp
// returns positive if d is outside circle abc, // positive if d is inside it and 0 if it's on border int inCircle (point a, point b, point c, point d){ if (cross(b - a, c - a) < 0) swap(b, c); int x[4][4] = { 1, a.first, a.second, a.first * a.first + a.second * a.second, 1, b.first, b.second, b.first * b.first...
ALGO
0.994144
4.715468
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2019-03-19T12:27:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6cfef82fd...
b63d5012-fc2b-486d-84fc-92ebb29ceaff
cpe102/lab15-2562-2-Erzengel792
lab15_1.cpp
#include<iostream> #include<cstdlib> #include<ctime> using namespace std; void randData(double *,int,int); void findRowSum(const double *,double *,int,int); void showData(double *,int,int); int main(){ srand(time(0)); const int N = 7, M = 7; double data[N][M] = {}; double result[N] = {}; double *dPtr = data[0]...
ALGO
0.994333
3.147169
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-02-28T07:24:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ac3f3c3c17...
5b3edbae-8f49-455f-9451-4a5b6acc32f9
fifinani/ROB_MOB
plani/src/rrt.cpp
#include <cstdlib> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <iostream> #include <cmath> #include "Tree.h" #include "rrt.h" #include <geometry_msgs/Point.h> #include <geometry_msgs/PoseStamped.h> #include <ros/ros.h> #include "Communication.h" #if CV_MAJOR_VERSION == 2 // do...
ALGO
0.990469
3.434066
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2019-11-15T14:04: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": "939625fcd...
695eb42e-9077-4568-8c5b-39d3a9bdcdbe
Junghs-cloud/Baekjoon
Silver/5/_27919.cpp
#include <iostream> using namespace std; int main() { string str; int vote[4]; bool C = true; for (int i = 0; i < 4; i++) { vote[i] = 0; } cin >> str; for (int i = 0; i < (signed)str.length(); i++) { if (str[i] == 'U') { vote[0]++; } else if (str[i] == 'D') { vote[1]++; } else if (str[i]...
ALGO
0.999835
4.428044
{ "github_metadata": { "branch": "master", "commit_count": 816, "repo_created_at": "2023-01-08T13:47: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": "2d97fec3...
50cc7eda-db89-49aa-bb36-3a10a4ffa926
VastoLorde95/Competitive-Programming
Codeforces/284 Divison 2/Problem E/E.cc
#include<cstdio> #include<iostream> #include<cmath> #include<algorithm> #include<cstring> #include<map> #include<set> #include<vector> #include<utility> #include<queue> #include<stack> #define sd(x) scanf("%d",&x) #define sd2(x,y) scanf("%d%d",&x,&y) #define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z) #define fi first #define...
ALGO
0.999839
3.443834
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2017-07-25T11:08:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 171, "forks": 41, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f03bd...
cdff1465-73a1-49f9-839e-b1268dae7f18
daviyan5/estudos
prog-competitiva/polystring.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(nullptr); int t; cin >> t; while (t--){ int n; cin >> n; cin.ignore(); string s; getline(cin,s); cout << s << endl; bool foi=false; int lef...
ALGO
0.999724
3.959195
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2020-11-09T18:10: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": "fd070018ec5...
c42aca3a-8b15-4277-8b8f-04dc4788b912
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/08/0812/personal_submission/cf724d_tiger2005.cpp
int main() { int m; string s; cin >> m >> s; for (char c = 'a'; c <= 'z'; c ++) { bool flg = true; int cnt = 0; for (auto e: s) if (e <= c) cnt = 0; else if ((++ cnt) == m) flg = false; if (flg) { string ans = ""; cnt = 0; int cnt2 = 0; for (auto...
ALGO
0.999919
3.204672
{ "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": "86a6...
e190b3ae-f16e-43cd-8233-3cd473ef747b
UO-OACISS/tau2
examples/multicounter/simple.cpp
/* This demonstrates how data cache misses can affect the performance of an application. We show how the time/counts for a simple matrix multiplication algorithm dramatically reduce when we employ a strip mining optimization. */ #include <Profile/Profiler.h> #define SIZE 64 #define CACHE 64 double A[SIZE][SIZE], B[S...
ALGO
0.979091
4.809157
{ "github_metadata": { "branch": "master", "commit_count": 24768, "repo_created_at": "2019-01-28T23:30:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 48, "forks": 20, "issues": 13, "pull_requests": 2 }, "file_meta": { "content_id": "26b9...
52144e87-dc7c-483c-a0ce-90a8b08836d2
Adrian-Garcia/MyCppAlgorithms
String/LongestCommonPrefix.cpp
/* 14. Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight"] Output: "fl" Example 2: Input: ["dog","racecar","car"] Output: "" Explanation: There...
ALGO
0.99972
5.626896
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2019-05-23T14:46: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": "c275cda0...
a7d55a74-9426-4dfa-9558-92b835bdfbe0
JoudyElGayar/Final-Project-CS2-
C++ code/PlagiarismDetector.hpp
// // PlagiarismDetector.hpp // project 7 // // Created by <NAME> on 12/05/2023. // #ifndef PlagiarismDetector_hpp #define PlagiarismDetector_hpp #include "bruteForce.hpp" #include "Document.hpp" #include <iostream> using namespace std; #include <stdio.h> #include <cmath> const int prime = 101; class PlagiarismDet...
ALGO
0.95852
4.204037
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2023-05-13T12:05: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": "c19b943392f...
12bf9c1d-7e25-423c-96c4-fb108efd700f
Tolga-dev/LeetCodeSolutions
Dynamic/474OnesandZeroes.cpp
#include <bits/stdc++.h> #include <iostream> #include <cmath> //https://leetcode.com/problems/combination-sum-iv/description/ using namespace std; #define vi vector<int> #define vvi vector<vi> #define pii pair<int,int> #define vb vector<bool> #define qii vector<int> #define qpii queue<pii> #define umipii unordered_map<...
ALGO
0.999922
4.84976
{ "github_metadata": { "branch": "main", "commit_count": 66, "repo_created_at": "2022-11-20T06:27:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0525b9c2b38...
7b6133fd-1c2f-447f-880b-f4ebd7d9b560
kaykobadhossain/OS-LAB
Memory Allocation/worstfit.cpp
#include <iostream> using namespace std; void BestFit(int blockSize[], int m, int processSize[], int n) { int allocation[n]; for(int i = 0; i < n; i++) allocation[i] = -1; // initially not allocated for(int i = 0; i < n; i++) { int worstIndex = -1; for(int j = 0; j < m; j++) ...
ALGO
0.999861
4.610942
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-05-20T01:34: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": "877138774c6...
14f67c91-66ad-47c9-bb21-4dc959038d89
komilovmDev/Cpp2-
main.cpp
#include <iostream> #include <fstream> #include <cmath> int main() { // Input values double a, b, c, x; std::cout << "Enter values for a, b, c, and x: "; std::cin >> a >> b >> c >> x; // Open a file for writing std::ofstream outputFile("results.txt"); // Check the condition a^2 + 7b^3 > 4...
ALGO
0.997792
4.00302
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-11-23T11:07: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": "a14cb9a75af9...
066537ca-befb-4648-a899-ab4098113ecd
osamahatem/CompetitiveProgramming
TopCoder/SixteenBricks.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.998838
4.639586
{ "github_metadata": { "branch": "master", "commit_count": 125, "repo_created_at": "2017-12-09T14:02:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "441cb2e7...
40800158-fadc-4003-9d57-1c95749f174f
ishandutta2007/codeforces-w
wild_hamster/normal/144/A.cpp
#include <bits/stdc++.h> #define mp make_pair #define X first #define Y second #define pii pair<ll,ll> #define x1 dlfjl #define x2 dkfj #define x3 dflgkg #define y1 dskgj #define y2 dskfj #define y3 dfhgdh #define SQ 320 #define PI 3.14159265359 #define MOD 1000000007 #define ROW 5 #define COL 30000 typedef int ll; usi...
ALGO
0.999948
3.57628
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:34: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": "752e98beed9b...
282d0b22-bfcd-45a7-a3a6-3a689972ab79
Powerstar0/CS303_Assignment_2
main.cpp
#include <iostream> #include "SingleLinkedList.h" #include "Stack.h" //Purpose: Build a Single_Linked_List class. Your class should have the data members: //head, tail, and num_items. Write the following member functions, which perform the same //operations as the corresponding functions in the standard list class: /...
TOOL
0.992873
4.853478
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2024-09-23T02:37: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": "17e4170945...
646364ca-faac-45e0-9615-27f03078f83d
ishandutta2007/codeforces-k
kude/normal/1681/E.cpp
#include<bits/stdc++.h> namespace { using namespace std; #include <algorithm> #include <cassert> #include <vector> #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; return x; } constexpr int...
ALGO
0.999872
5.03485
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6ba9942c1d7...
fb361cb8-b3df-49df-b70c-2626a9be9ed2
boost-devs/coding-test-study
sally/shortest_path/18352_특정 거리의 도시 찾기.cpp
/* # DP # Problem: 18352 # Memory: 20436KB # Time: 428ms */ #include <iostream> #include <vector> #include <cmath> #include <queue> #include <algorithm> using namespace std; int N, M, K, X; vector<int> v[300002]; bool visit[300002] = {false,}; queue<int> q; vector<int> ret; int dep = 0; int main(void){ cin.tie(NU...
ALGO
0.999975
4.079657
{ "github_metadata": { "branch": "main", "commit_count": 1259, "repo_created_at": "2021-05-09T17:08:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 34, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a4c9cb4b9...
70f3f358-8e3f-42a3-b7fa-a60c8642daea
AkankshaBaghel79/Data-Structure-and-Algorithms
05 - 2D Array/10_Row_With_Max_1.cpp
#include<bits/stdc++.h> using namespace std; #define endl "\n"; int first(vector<int>arr, int low, int high) { if(high >= low) { int mid = low + (high - low)/2; if((mid == 0 || arr[mid-1] == 0) && arr[mid] == 1) { return mid; } else if(arr[mid] == 0) ...
ALGO
0.999763
4.451024
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2022-09-22T11:57:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "860b4b574...
b10eec5f-e0dd-4032-bdc2-49cac31adc2b
Eqno/GPLT-ExerciseRecord
2022/simulation/11.cpp
#include <cstddef> #include <errno.h> #include <queue> #include <iostream> #include <type_traits> #include <unordered_map> using namespace std; const int MAXN = 50; int inorder[MAXN], postorder[MAXN]; unordered_map<int, int> m; struct Node { int num, depth; Node* left, * right; }; Node* build(int t, int d, i...
ALGO
0.999991
4.286508
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-02-22T15:50: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": "2e0c7393aaa0...
73589d09-0a41-4ba2-9607-d6d71bce59bc
timprepscius/mailiverse
cpp/Lib/xcode-botan/Botan-1.10.3-clean/src/hash/whirlpool/whrlpool.cpp
/* * Whirlpool * (C) 1999-2007 <NAME> * * Distributed under the terms of the Botan license */ #include <botan/whrlpool.h> #include <botan/loadstor.h> namespace Botan { /* * Whirlpool Compression Function */ void Whirlpool::compress_n(const byte in[], size_t blocks) { static const u64bit RC[10] = { 0x1823...
ALGO
0.951036
5.74868
{ "github_metadata": { "branch": "master", "commit_count": 102, "repo_created_at": "2013-07-14T15:49:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "063f075d...
c64e758e-2d4f-49c2-b319-2da29e58b023
in0x/ctco
c8_10.cpp
#include <stdio.h> #include <vector> #include <deque> #include <unordered_set> int get_idx(int x, int y, int width) { return x + (width * y); } bool is_valid_tap(int x, int y, int width, int height) { if (x < 0 || x >= width) { return false; } if (y < 0 || y >= height) { return false; ...
ALGO
0.999771
5.577684
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2021-12-28T15:01:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17de011bd...
989c9347-9448-43df-8d76-75e5fcf6994d
vedprakash123github/Coding-Algo
Programs/Stack/ValidParenthesis.cpp
#include<iostream> #include<stack> using namespace std; bool validParen(string s) { if(s.length()==0) return true; stack<char> st; int i=0; while(i<s.length()) { cout<<"entering while : "<<i<<endl; if(s[i]=='(' || s[i]=='{' || s[i]=='[') { st.push(s[i]...
ALGO
0.986206
5.584689
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-07-10T14:11: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": "98e7fad125d8...
1a04baf4-e580-406e-ba42-d7c6054b395e
PsychoLeo/informatique
algorithmique/codeforces/dp/1844C.cpp
/* * Author: <NAME> * Created: 23/07/2024 16:26:34 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <deque> #include <unordered_map> #include <map> #include <unordered_set> #include <set> #include <stack> #include <queue> #include <complex> #include <string> #include <vector> #i...
ALGO
0.999937
5.19305
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2024-07-17T10:58: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": "2bc6e113330...
362feb5e-d267-4506-9904-fe5fd9d41ea2
sachuverma/DataStructures-Algorithms
DSA Crack Sheet/solutions/Merge k Sorted Arrays.cpp
/* Merge k Sorted Arrays ===================== Given K sorted arrays arranged in the form of a matrix of size K*K. The task is to merge them into one sorted array. Example 1: Input: K = 3 arr[][] = {{1,2,3},{4,5,6},{7,8,9}} Output: 1 2 3 4 5 6 7 8 9 Explanation:Above test case has 3 sorted arrays of size 3, 3, 3 arr[...
ALGO
0.999989
6.164518
{ "github_metadata": { "branch": "master", "commit_count": 1430, "repo_created_at": "2020-10-07T10:08:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2049, "forks": 541, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d1...
8ab35ef4-4ff4-49f4-8697-4f451fab8f37
IagoFloriano/DesafiosProg
sem6/E.cpp
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll oo=1987654321987654321; int main() { ll n, m; cin >> n >> m; vector<vector<ll>> grafo(n, vector<ll>(n,oo)); for(ll i = 0; i < m; i++){ ll u, v, w; cin >> u >> v >> w; grafo[u][v] = w; grafo[v][u] = w; } for(ll i = 0...
ALGO
0.999945
3.726991
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2022-06-15T00:28:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a894bde99...
afc0e997-c456-4331-aaac-69eb3f2d7d29
andiraarif/scientific-computing-with-cpp
chapter4-pointers/chapter4-exercises/e404.cpp
#include <iostream> int main(int argc, char* argv[]) { for (int iter = 0; iter < 1000000; iter++) { // Memory Dynamic Allocation int rows = 2, cols = 2; double** A; double** B; double** C; A = new double* [rows]; B = new double* [rows]; C = new d...
ALGO
0.969756
4.231751
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2021-07-11T23:42: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": "c9f34080d...
ad3cc828-0626-48ca-af8c-aef2ce16b82f
saged-sama/Algorithms
Number Theory/BigMod.cpp
#include <iostream> using namespace std; const long long int MOD = 1e9+7; long long int loop_big_mod(long long int n, long long int p){ long long int ret = 1ll; while(p){ if(p & 1) ret = (ret * n) % MOD; p >>= 1; n = (n * n) % MOD; } return ret; } long long int recursive_big_m...
ALGO
0.99994
4.570348
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2023-08-08T17:46: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": "ff354bf608f...
89d4297a-f177-4a35-9ebd-8dabcad66e6a
hello-world2005/course
xjoi/115/contest/1583/b.cpp
#include <cstdio> #define int long long const int MOD = 1e9 + 7; const int N = 20; int FastPow(int a, int b) { int res = 1; for (; b; b >>= 1, a = a * a % MOD) if (b & 1) res = res * a % MOD; return res; } int n; int l[N], a[N][2530]; int ans[N]; const int FAC = 318608048; const int INV = 800396831...
ALGO
0.999901
3.921299
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2020-05-11T09:44:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08edbca4...
521956fa-9577-49b6-9938-157c94a35cd0
yujin1292/BreakingCodingTest
Season 02/homework/Yujin/Week 15/1743 음식물 피하기.cpp
#include <iostream> #include <queue> #include <algorithm> using namespace std; const int MAX = 101; int map[MAX][MAX]; // 전역변수는 0으로 초기화 int visited[MAX][MAX]; int dc[4] = { 1,-1,0,0 }; int dr[4] = { 0,0,-1,1 }; int N, M, K; int answer = -1; void bfs(int row, int col) { queue<pair<int, int>> q; int area = 1; ...
ALGO
0.999933
4.435603
{ "github_metadata": { "branch": "main", "commit_count": 249, "repo_created_at": "2021-10-22T06:29:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 15, "pull_requests": 0 }, "file_meta": { "content_id": "eee26085d...
5b883661-ac7a-45e2-8d6f-bc61d4a74574
agorararmard/Dwarf-RV32ic-andAssemblyTestGenerator
randreg_new.cpp
#include <iostream> #include <fstream> #include <cstdio> #include <cstdlib> #include <vector> #include <string> #include <ctime> #include <climits> #include <cmath> #include <algorithm> using namespace std; vector <string> program; vector <int> brIndex; vector <vector<string>> blocks; const int funcBlock = 30; //the f...
TOOL
0.966538
3.081042
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-09-30T09:21:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47021bc8c1...
81ee1132-e18f-416d-8681-f457c7558c7a
gagandeepahuja09/Backtracking
InterviewBit/UniquePathsIII.cpp
/* Given a matrix of integers A of size N x M. There are 4 types of squares in it: 1. 1 represents the starting square. There is exactly one starting square. 2. 2 represents the ending square. There is exactly one ending square. 3. 0 represents empty squares we can walk over. 4. -1 represents obstacles that we canno...
ALGO
0.999957
4.967802
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-03-26T14:32:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df5e2f6ea...
b28da37c-ac64-4cc9-90d5-3d27a86550cd
mindspore-ai/mindspore
mindspore/lite/tools/converter/legacy_optimizer/graph/const_node_reorder_pass.cc
/** * Copyright 2023 Huawei Technologies Co., Ltd * * 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...
ALGO
0.999056
6.530153
{ "github_metadata": { "branch": "master", "commit_count": 83896, "repo_created_at": "2020-02-11T08:43:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4559, "forks": 740, "issues": 181, "pull_requests": 20 }, "file_meta": { "content_id": ...
007dfdc6-2005-4692-be3e-1fa61a9baa10
edweenie123/3D-Chess
cpp/include/solver.h
/* Solver class, contains our CHESS AI featuring 3 levels of difficulty */ #ifndef solver_h #define solver_h #include "turn.h" #include "board.h" #include "piece.h" #include "pawn.h" #include "queen.h" #include "globals.h" class Solver { private: // Instance variables int difficulty; // I...
ALGO
0.996798
5.902967
{ "github_metadata": { "branch": "main", "commit_count": 145, "repo_created_at": "2021-05-26T15:38:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8505670af...
551c722b-7f78-4faf-be70-4f236bd5b44e
mCRL2org/mCRL2
3rd-party/sylvan/src/sylvan_ldd.hpp
/* * Copyright 2011-2016 Formal Methods and Tools, University of Twente * Copyright 2016 <NAME>, <NAME> University Linz * * 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://...
TOOL
0.996035
4.501375
{ "github_metadata": { "branch": "master", "commit_count": 20251, "repo_created_at": "2018-04-07T15:35:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 99, "forks": 44, "issues": 60, "pull_requests": 5 }, "file_meta": { "content_id": "d778...
bcb565db-b116-436e-8d57-48560f89fc0b
WhiteKnight0003/DSA_c-
baitap/kt_tu_hoc/vector/cat_vector.cpp
/*Có 3 cách đơn giản để cắt vector - hàm front() cắt phần tử đầu tiên từ vector - hàm back() cắt phần tử cuối cùng từ vector - cắt 1 phạm vi */ /*hàm front() - là 1 thành viên trong class - có td tham chiếu đến phần tử đầu tiên trong vector - cú pháp : vt.front() - k dùng front cho vector trống #i...
TOOL
0.961922
3.439281
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-27T18:22: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": "3be4d9a3c0e9...
74be755c-386c-4e82-b1c5-7c35824be2b0
yangchenleon/programming-contest
Programming-Contest-Challenge/Beginner/2-5-4_2-单源最短路径-2-1.cpp
/* * Dijkstra算法 * 前提是不能存在负边,在未确认点中选出最短的路径 * (事先已经计算好各个可达的的最短路径,再在其中选最小的作为确认点) * 共更新V个顶点,更新每个顶点消耗V的时间寻找最短的新节点以及更新路况,所以时间复杂度是V*V * 使用邻接表的话,更新路况的时间变成E(只需操作表内记录的预期相连的即可), * 但是找新顶点还是需要遍历每个顶点从中选择也是消耗V,因此复杂度没变化 */ #include <cstdio> #include <algorithm> #define INF 0x3f3f3f3f #define MAX_V 100 using namespace std; int...
ALGO
0.999967
4.775132
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-10-25T01:03: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": "2fca99aac66...
27f1a5d1-4c31-4adf-959a-16a3be8331f4
Shad0wSeven/cppfund
Codeforces/Codeforces-EducationalCodeforcesRound112RatedforDiv.2/C.CoinRows.cpp
// time-limit: 2000 // problem-url: https://codeforces.com/contest/1555/problem/C #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef vector<pair<int, int> > vpi; #define FAR(i, a, b) for (int i=a; i<b; i++) #define FOR(i, a) for (int i=0; i<...
ALGO
0.99991
3.610299
{ "github_metadata": { "branch": "master", "commit_count": 112, "repo_created_at": "2020-04-24T05:37: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": "eb8141a9...
0676b054-f88d-4f13-9218-9a7dc34c46b8
thregium/practice_baekjoon
16000-16999/16696.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <queue> #include <unordered_map> using namespace std; /* 문제 : 40개 이하의 비트로 이루어진 문자열이 주어진다. 이때, 각 단계마다 임의의 K를 정해서 K개 이전 비트가 1이거나 현재 비트가 1인 경우 1이 되도록 할 때, 모든 비트를 1로 만들 수 있는 지 확인하고, 그러한 경우 그렇게 하기 위해 필요한 최소 단계 수를 구한다. 해결 방법 : BFS로 시간 내에 돌아가는 것...
ALGO
0.999964
3.956853
{ "github_metadata": { "branch": "main", "commit_count": 172, "repo_created_at": "2020-12-30T02:25:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9ca9ebe49...
09960a9b-6405-4b31-b35e-1e3b82774c0a
pruthig/algorithms
competitive_programming/interview_bit/Backtracking/combinations_dup_sum.cpp
/* Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. */ #include<iostream> #include<vector> #include<algorithm> using namespace std; namespace { vector<vector<int>> res{}; } void func(int index, vector<int> tmp, int k, vector<int...
ALGO
0.999825
5.134152
{ "github_metadata": { "branch": "master", "commit_count": 433, "repo_created_at": "2018-03-06T06:28:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "5e840e6e...
e37b8638-4503-41cf-9ef6-3441bea8b127
Hambardzum95/LeetCode
1116-maximum-level-sum-of-a-binary-tree/1116-maximum-level-sum-of-a-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999966
5.280316
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2023-06-11T21:30: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": "63521fb2885...
7efc3324-847c-4d47-9a2f-ac596a48e908
Kalaisgit/Practice-DSA
Problems/Linked List/3) Medium Problems of LL/13) Intersection node LL with more than one head/better.cpp
// O( N1- N2+ N2 + N1 + N2) // TC -> O(2N1 + N2) if N1 > N2 // sc-> O(1) #include <bits/stdc++.h> class Node { public: int data; Node *next; public: Node(int data1) { data = data1; next = nullptr; } Node() { data = 0; next = nullptr; } Node(int data1, Node *next1) { data = dat...
ALGO
0.999802
5.196558
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2024-04-18T13:02: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": "bf63593cbbd...
475ed213-1da9-498e-a113-f2cda01becca
toshirokubota/straight-polygon-grouping
include/Graph.h
#ifndef ___GRAPH_CSCI381_H___ #define ___GRAPH_CSCI381_H___ #include <vector> #include <limits> #include <iostream> enum VertexColor {Black, White, Gray, Red, Green, Blue}; enum EdgeType{Tr, Back, Forward, Cross}; template<class T> class Edge; template <class T> class Vertex { public: Vertex(T key) { this->key =...
ALGO
0.999106
4.874809
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2015-01-16T12:20:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ee0e8028...
83d13618-656c-4c17-b55a-6290bec33164
Anupam-USP/CP
Tutorial/Bit Manipulation/unique2.cpp
#include <bits/stdc++.h> using namespace std; ll main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll n, res = 0, no, a[100005]; cin >> n; for (ll i = 0; i < n; i++) { cin >> no; a[i] = no; res = (res ^ no); } ...
ALGO
0.999999
3.893127
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2021-05-11T05:38: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": "d4e571c1051...
5e039c22-ea8e-4df0-af66-f4192579b9ee
Prayrena/Duality-Engine
Engine/Code/Engine/Math/Mat44.hpp
#pragma once #include "Engine/Math/Vec4.hpp" #include "Engine/Math/Vec2.hpp" #include "Engine/Math/Vec3.hpp" #include "ThirdParty/OpenXR/src/common/xr_linear.h" //---------------------------------------------------------------------------------------------------------------------------------------------------- // A 4...
ALGO
0.907887
6.916776
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-09-15T06:23: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": "1f87f3085dcf...
e820e18a-cdd5-4d5a-b031-558b7a5dccac
NVIDIA/cutlass
include/cutlass/functional.h
/*************************************************************************************************** * Copyright (c) 2017 - 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are...
TOOL
0.919145
7.420237
{ "github_metadata": { "branch": "main", "commit_count": 667, "repo_created_at": "2017-11-30T00:11:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8078, "forks": 1336, "issues": 322, "pull_requests": 54 }, "file_meta": { "content_id": "7f...
e28c743d-20fd-44eb-868f-0afa4d663e10
encrypted-def/BOJ
1102.cpp
# pragma GCC optimize ("O3") # pragma GCC optimize ("Ofast") # pragma GCC optimize ("unroll-loops") #include <bits/stdc++.h> #pragma warning(disable:4996) #pragma comment(linker, "/STACK:336777216") using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef tuple<int, int, ...
ALGO
0.999907
3.960763
{ "github_metadata": { "branch": "master", "commit_count": 624, "repo_created_at": "2017-12-21T06:12:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 28, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a6c33...
b4475e50-5cb3-4504-b2df-dcca8a75789a
RussTedrake/drake
solvers/fbstab/test/ocp_generator.cc
#include "drake/solvers/fbstab/test/ocp_generator.h" #include <cmath> #include <iostream> #include <vector> #include <Eigen/Dense> #include "drake/common/drake_copyable.h" #include "drake/solvers/fbstab/fbstab_mpc.h" namespace drake { namespace solvers { namespace fbstab { namespace test { using VectorXd = Eigen::...
ALGO
0.997833
6.417583
{ "github_metadata": { "branch": "master", "commit_count": 27854, "repo_created_at": "2014-02-23T19:55:24.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "RobotLocomotion/drake", "stars": 48, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "c...
2aa692e0-10de-4a6d-b0b3-888d616546c9
hafidh2001/Tugas-FUNGSI
perkalianfungsi.cpp
#include <iostream> using namespace std ; int perkalian (int a, int b) { return a * b ; } int panjangInt(int aConst) { int berapa = 0; while (aConst != 0) { aConst /= 10; berapa++; } return berapa; } int main () { system ("title <NAME>") ; int a, b; cout << "Angka pertama = " ; cin >> a ; cout << "...
ALGO
0.99992
4.312146
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-10-28T10:33:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d49eb668d5...
4b465862-7122-4b65-bce4-260e31c2e129
enderpalm/comprog-2110104
map/telephone_dictionary.cpp
#include <iostream> #include <unordered_map> using namespace std; unordered_map<string, string> name2tel; unordered_map<string, string> tel2name; int main(int /*argc*/, const char ** /*argv*/) { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; cin.ignore...
ALGO
0.993188
4.677288
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2024-08-24T12:47:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24bafdf6a1c...
ccc5b691-6d7c-4cc1-b1a9-138adca4e3b9
erich666/jgt-code
Volume_10/Number_3/Singh2005/IBar/R2_Line_seg_i.H
template <class T> inline WINbool R2Line_segTC<T>::IsPtOnSeg(const R2PointTC<T> &in_pt) const { R2PointTC<T> out_pt; T out_t, out_d; return FindPtOnSeg(in_pt, out_pt, out_t, out_d); } template <class T> inline T R2Line_segTC<T>::Dist_to_seg(const R2PointTC<T> &in_pt) const { R2PointTC<T> out_pt; T ...
ALGO
0.983943
5.145397
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2015-10-07T13:59:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 477, "forks": 76, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7a5d07...
054b63bf-cdbe-4276-82db-7c23bc9ffe54
stevenlin0/csc343assignment7
main.cpp
#include <iostream> #include <thread> #include <mutex> #include <chrono> #include <random> using namespace std; //This is a lock mutex cout_mutex; // This is to show what the philosophers do void philosopher(int id, mutex& left_fork, mutex& right_fork) { random_device rd; mt19937 gen(rd()); uniform_real_...
ALGO
0.9986
4.763394
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-04-02T15:23:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6fd3faace29...
aa719a9f-a527-4f93-8c25-0bfa4fa56ccf
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/ai_code/train/0_0_1385.cpp
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int find(vector<int>& parent, int x) { if (parent[x] == x) return x; return parent[x] = find(parent, parent[x]); } void unionSet(vector<int>& parent, vector<int>& rank, int x, int y) { int rootX = find(parent, x); int...
ALGO
0.999998
5.613075
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59: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": "a6095787e2f...
8ed6f09b-cbb4-45f0-a209-78328d3385cc
samuel24276/LinearList
DLinkList.h
#include<iostream> template <class T> struct Node { T data; struct Node<T> *pri; struct Node<T> *next; }; template <class T> class DLink_List { Node <T> *front = NULL; Node <T> *rear = NULL; public: DLink_List() { front = rear = new Node <T>; rear->pri = rear; rear-...
ALGO
0.996909
3.662224
{ "github_metadata": { "branch": "DLinkList", "commit_count": 19, "repo_created_at": "2018-02-10T11:14:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "a3ea5d...
9871d2b3-cd7c-45a2-a40e-873e3f4d4d3f
UserisRatnesh/DSA_topics
Binary_search/book_allocation.cpp
#ifndef ONLINE_JUDGE #include "/usr/local/include/bits/stdc++.h" #else #include <bits/stdc++.h> #endif using namespace std; #define fastio() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
ALGO
0.999926
4.315659
{ "github_metadata": { "branch": "main", "commit_count": 118, "repo_created_at": "2024-11-12T14:03: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": "fb01aabcc9...
4e08f914-106e-4732-a5ad-15e18bfe5222
zerodeku/flagella-simu
src/single_flagella.cpp
// // Created by zerodeku on 7/3/2016. // #include <single_flagella.h> #include <utils.h> //#include <boost/phoenix/bind/bind_member_function.hpp> using namespace arma; namespace flagella { // Buid up grids of this iteration void SingleFlagella::build_grids() { grids_ = new Grid*[num_grids_]; Grid *g = new Grid...
ALGO
0.999206
5.221267
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-07-02T22:37: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": "9e8d4bd463...
7c83e1c2-2f16-40c5-9a5c-11fd9f45b43f
ishandutta2007/codeforces-c
cinnamoroll/normal/1400/G.cpp
// warm heart, wagging tail,and a smile just for you! // // // // // ...
ALGO
0.99994
3.727645
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17: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": "c6c8cee0286d...
134fd4d3-8ba8-41b1-aad7-16f0123a16b7
KratosMultiphysics/Kratos
applications/ShallowWaterApplication/custom_utilities/derivatives_recovery_utility.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: <NAME> // #ifndef KRATOS_DERI...
TOOL
0.905391
4.918028
{ "github_metadata": { "branch": "master", "commit_count": 106408, "repo_created_at": "2017-02-13T10:58:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1141, "forks": 265, "issues": 381, "pull_requests": 258 }, "file_meta": { "content_id"...
babfeaaf-5dcd-437e-851c-fcaf65592d60
dunningtonthomas/Aerospace-MATLAB-Files
Archive/ASEN1320/Fall22/FinalProject/Part2/lajoielauren_419298_56670380_part2a/main.cpp
#include "utilities.h" //including the header file int main() { //declaring the array size to be used for for loops and arrays int arraysize = 1441*3; //decalring the value of omega //both numbers have a .0 to make them doubles double w = (360.0/86400.0); //declaring gssize to be use...
ALGO
0.987388
4.031151
{ "github_metadata": { "branch": "main", "commit_count": 545, "repo_created_at": "2022-04-01T18:49: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": "8b0c6407bc...
ac899ebc-ad78-4988-980b-0d1c1e93528a
bill2247/Tucil2_13523072
src/header/QuadTreeNode.hpp
#ifndef QUADTREE_COMPRESSOR_H #define QUADTREE_COMPRESSOR_H #include "ImagePixel.hpp" #include "ErrorCalculator.hpp" #include <memory> #include <queue> struct QuadTreeNode { int x, y; int width, height; Pixel averageColor; bool isLeaf; std::unique_ptr<QuadTreeNode> children[4]; QuadTreeNo...
ALGO
0.99637
7.337688
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-03-26T11:03: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": "6b9921218fdd...
92e68b74-32f5-4c5d-b13d-af0fbad7deb4
michaugit/CPP_AGH
LAB_8_Szablony/main.cpp
#include <iostream> #include <memory> #include <initializer_list> #include <vector> #include <list> #include <map> #include <set> using namespace std; template<typename T, size_t resize_of_tabStep=5> class Vector{ size_t size_of_tab; size_t capacity; unique_ptr<T[]> data; public: Vector(): size_of_tab(0...
TOOL
0.953703
4.829359
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-05-11T12:13: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": "ce216a8a91...
75cc0cda-0571-458a-8b93-8c89035cb9a9
ShimuGuyue/AlgorithmPractice-Codes
Codeforces/题库/CF1352D.cpp
#include <iostream> #include <cstdint> #include <vector> void Solve(void); int main(void) { #ifdef Shimu_Guyue freopen(".in.in" , "r", stdin ); freopen(".out.out", "w", stdout); #define RUN_TIME \ std::clog << (clock() * 1.0 / CLOCKS_PER_SEC) * 1000 << " ms" << std::endl; #else #define RUN_TIME #endif ...
ALGO
0.999638
3.857229
{ "github_metadata": { "branch": "main", "commit_count": 399, "repo_created_at": "2024-11-05T08:06: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": "a579aba448...
bbc82a00-707e-4509-856f-6a48b4fafd32
siddharth94/competitive
Codechef/bitf2016/dmntion.cpp
#include <bits/stdc++.h> using namespace std; #define R(i,a,b) for(int i=a;i<b;i++) #define RE(i,a,b) for(int i=a;i<=b;i++) #define RR(i,a,b) for(int i=a;i>b;i--) #define RRE(i,a,b) for(int i=a;i>=b;i--) #define F(i,n) for(int i=0;i<n;i++) #define FE(i,n) for(int i=0;i<=n;i++) #define FR(i,n) for(int i=n;i>0;i--) #def...
ALGO
0.999629
4.09753
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-09-29T04:19: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": "2f51955749...
17be6882-a0c7-4266-b5d7-cec487155eec
b21quocbao/Competitive-Programming
P184SUMD.cpp
#include <bits/stdc++.h> #define fn "test" #define fn1 "" using namespace std; const int mn = 1 * (int)(1e5) + 10; const int mod = 1 * (int)(1e9) + 7; const int mm = 1 * (int)(1e3) + 10; const int base = 1 * (int)(1e9); const bool aNs = 0; int tt, ntest = 1; int a[mn], n, sol; void docfile() { ios::sync_with_s...
ALGO
0.999975
4.193148
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-02-22T14:52: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": "641978428a...
b05786c5-d011-4e15-acff-b3f1817ee47d
andrewqt/Competitive-Programming
CodeForces/_1355_F_GuessDivisorsCount/_1355_F_GuessDivisorsCount.cpp
// Problem : F. Guess Divisors Count // Contest : Codeforces - Codeforces Round #643 (Div. 2) // URL : https://codeforces.com/contest/1355/problem/F // Memory Limit : 256 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; vector<in...
ALGO
0.999393
3.90425
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-09-08T12:27:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "591de991c...
1ac69ba2-848b-498f-be86-71f11067ee6f
SusieGlitter/CS0501H-03
1530/1530.cpp
#include<iostream> #include<stdio.h> #include<cstring> using namespace std; //调试开关 #define DEBUG //主函数开关 #define MAIN #ifdef DEBUG #include<unistd.h> #include<fstream> #include<string.h> char file_path[256]; //获取路径 void get_path(); //切换到文件输入输出 void file_mode(); #endif //快读 inline void...
ALGO
0.999931
3.55015
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-10-05T10:12: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": "99986cf5a2da...
7a1cc08a-868d-4447-acce-689c2fb67213
akazad7567/Algorithms-Data-Structures
dp/light_oj_dp/D. Distance in Tree.cpp
#include<bits/stdc++.h> using namespace std; #define XOX (-D XOX typedef long long ll; //debug for single line start from here template<typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl //debug for single line ending here //debug for multiple line start fr...
ALGO
0.999867
4.061101
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2020-02-22T13:41: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": "5a9c4525f...
a1c9dd68-ddce-494f-b156-1ab2a9010db2
Shuniy/Codes
primeNumber.cpp
#include <iostream> #include <algorithm> using namespace std; //Prime Number less than equal to n using seive of eratosthenes void sieveoferathohenes(int n) { bool prime[n + 1]; for (int p = 2; p * p <= n; i++) { if (prime[p] == true) { for (int i = p * p; i <= n; i += p) ...
ALGO
0.999941
4.392014
{ "github_metadata": { "branch": "master", "commit_count": 189, "repo_created_at": "2019-10-05T09:35: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": "cdfb0cbe...
cc91393a-7a5e-4ec6-b8a3-e77cf7d0c1cb
ExXidad/RayTracing
myTypes.cpp
#include "myTypes.h" vectorDouble operator*(const vectorDouble &vector, const double num) { vectorDouble tmp(vector.size(), 0); for (int i = 0; i < vector.size(); ++i) { tmp[i] = vector[i] * num; } return tmp; } void operator*=(vectorDouble &vector, const double num) { for (double &item : ...
TOOL
0.954018
4.637451
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-04-18T09:16: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": "e4a2a8dcf...
2f0e12ef-fa76-40bc-8692-c88975a0ce2c
MtTsai/Codeforces
1111/1111B.cpp
#include <iostream> #include <algorithm> #include <vector> #include <iomanip> typedef unsigned long long ull; using namespace std; int main() { ull n, k, m; cin >> n >> k >> m; vector<ull> p(n); double sum = 0; for (ull i = 0; i < n; i++) { cin >> p[i]; sum += p[i]; } sor...
ALGO
0.999969
3.837562
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-02-09T15:27: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": "e9602f2282...
31f188e0-6627-4428-b56f-c93b2d67ec12
HenriHGS/competion-code
c,c++/algorithm/atcoder/ABC/217/e.cpp
#include <set> #include <queue> #include <cstdio> #include <cstring> #define For(i,x,y) for(int i = (x); i <= (y); i ++ ) #define fori(i,x,y) for(int i = (x); i < (y); i ++ ) using namespace std; int main(){ bool so = false; int q; queue<int>que; scanf("%d", &q); multiset<int>s; while(q--){ ...
ALGO
0.999459
3.688356
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-04-07T13:23: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": "9080dfbc87...
09a23e8d-acad-40e2-8294-a0c3d2e44983
montalvillo/Curso-Programacion-Juan
Tema11/Tema11Tarea01/main.cpp
#include <iostream> using namespace std; int main() { int n; /**< Declaracion de la variable n */ n = 15; /**< Inicializo n con valor 15 */ do { if (n%3 ==0 || n%5 == 0){ /**< Aqui divido n entre 3 y 5 si el cociente es 0 es multiplo con valor 15 la primera condicion es true y la segunda true imprime numero...
ALGO
0.998917
3.676314
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2015-05-30T16:31: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": "0abf95cf4...
2f0cbb38-a75c-4307-b4c8-1495e36ebdf3
DonaldoAyala/cp-solved-problems
Facebook Hack/c.cpp
#include <bits/stdc++.h> #define lli long long int #define pb push_back #define fi first #define se second using namespace std; vector<pair<int,int>> c; int n, q; lli f(lli x0, lli xn, lli yn, lli d) { return (-1 * x0) + xn + yn + d; } void solve() { lli x,y,d; cin >> x >> y >> d; lli ans = 0; for...
ALGO
0.999729
4.297484
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2021-08-08T06:30: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": "65dc83b45a3...
27c5244a-6170-4d67-9dd4-9f5b2500d605
elitonperin/redotica
main.cpp
/* * Main.cpp * * Created on: 01/04/2015 * Author: eliton_perin */ #include<stdio.h> #include<stdlib.h> #define MAX_N 100 #define MIN_N 0 #define MAX_M MAX_N*(MAX_N-1)/2 #define MIN_M 1 #define MAX_XYZ 100 #define MIN_XYZ 1 typedef struct arestas{ int nome1; int nome2; int dist; int conj; struct ares...
ALGO
0.999629
3.672123
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-07-01T20:09:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e997ef2de1...