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
02efe1b9-9031-4895-aa7d-4c5d8bb5ccdb
Shashankiitr/Nongamba-
Codeforces/B_Minimize_the_error.cpp
#include <bits/stdc++.h> #define int long long using namespace std; void solve(){ int N, K1, K2; cin >> N >> K1 >> K2; vector<int> A(N), B(N), C(N); for(auto &x : A) cin >> x; for(auto &x : B) cin >> x; int sum = 0; for(int i = 0 ; i < N ; ++i){ C[i] = abs(A[i] - B[i]); sum += C[i]; } if(sum > K1 + K2){ int K = K1...
ALGO
0.999974
4.091609
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-02-04T10:11: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": "52259e68753...
d3fa92b9-0c60-447c-9b13-c326398f4917
nakazkan/BigInteger-Rational
BigInteger+Rational.cpp
#pragma once #include <iostream> #include <vector> #include <math.h> #include <iomanip> class BigInteger; class Rational; BigInteger operator/(int x, const BigInteger &other); BigInteger operator+(int x, const BigInteger &other); BigInteger operator-(int x, const BigInteger &other); BigInteger operator*(int x, con...
ALGO
0.955047
5.27061
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-04-26T21:53:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c4d734edb3c...
68c71ea0-4781-4dc5-9960-d65a981168dc
psi4/psi4attic
psi3_attic/libmatrix/elemental_wrapper.h
/* *@BEGIN LICENSE * * PSI4: an ab initio quantum chemistry software package * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any ...
TOOL
0.924771
6.344264
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2016-01-19T18:33:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "c3db909e63...
66cc694e-cbad-4196-acb6-b25ffbacf231
mrunelov/code-puzzlers
equivalences.cpp
/* * Proving Equivalences * https://kth.kattis.scrool.se/problems/equivalences * * @author <NAME> * * General idea: * Being in the same strongly connected component means that there is an equivalence relation within the SCC. * Binding all SCC's together is the goal. Connecting two SCC's requires an edge in both...
ALGO
0.999715
5.078591
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2013-06-14T09:59:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5db6d40a8...
01c3ec36-37c1-436b-931b-15e72b9ac97e
neverland-haha/interesing-algorithm
妙趣横生的算法/DoubleList.cpp
#include<iostream> using namespace std; template<typename T>class DoubleList; template<typename T>class DoubleListNode { private: friend class DoubleList<T>; DoubleListNode() // 空构造函数 { m_pprior = NULL; m_pnext = NULL; } // 构造函数 DoubleListNode(const T item, DoubleListNod...
ALGO
0.997301
4.259986
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2022-03-21T14:25:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "3e83c739c22...
864bc02e-c713-4e10-927a-df9c603d6a43
ArisQ/leetcode
78-subsets/main.cc
#define CATCH_CONFIG_MAIN #include <catch.hpp> using namespace std; template<typename T> ostream &operator<<(ostream &os, const vector<T> &array) { for (auto element:array) { os.width(3); os << element; } os << endl; return os; } class Solution { public: vector<vector<int>> subse...
ALGO
0.999559
6.631522
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2018-11-06T08:13: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": "adcae121...
d7be29ce-0248-4fea-8097-ed2729887e73
libgdx/libgdx
extensions/gdx-bullet/jni/src/bullet/BulletCollision/CollisionDispatch/btUnionFind.h
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 <NAME> http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is ...
ALGO
0.945425
4.806109
{ "github_metadata": { "branch": "master", "commit_count": 15526, "repo_created_at": "2012-08-10T19:34:38.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 24195, "forks": 6492, "issues": 240, "pull_requests": 81 }, "file_meta": { "content_id"...
51d6dc2e-82d2-44c7-a38e-1d80be32eeb9
bodhiye/CCF
20170902.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int n, k, w, s, c, key[1001]; struct Teacher//定义教师结构体 { int key;//钥匙编号 int time;//使用钥匙时间 int flag;//设置标识符 }; bool cmp(const Teacher& t1, const Teacher& t2)//自定义比较函数 { if (t1.time != t2.time)//使用时间少的先还 { return t1.time < t2.time;...
ALGO
0.99999
3.326725
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2017-11-26T03:47:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5d37ee2a...
6b0b700e-c0c3-48b5-a8c3-29a601f508a7
austinjhunt/320Code
C++/CPPWorksheet1/main.cpp
#include <iostream> void swapFirstTwoElem(int myArray[]){ int temp = myArray[0]; myArray[0] = myArray[1]; myArray[1] = temp; } int sumAllElem(int myArray[], int length) { int sum = 0; for (int i = 0; i < length; i++ ) { sum += myArray[i]; } return sum; } int * incrementAll(int my...
ALGO
0.999772
4.580092
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-12-07T00:45:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f4d6936e1...
f36a7ac8-5052-419b-9745-89903a8d9110
648trindade/polyhedra_combiner
src/Face.h
#pragma once #include "BoundingBox.h" #include "Edge.h" /*! * A face specifies by one or more contours a set of finite two-dimensional patches in the same * plane. A normal and a distance from the origin define the plane in which the patches lie. Each * contour divides the face's plane into two areas: a finite are...
ALGO
0.985464
7.174654
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-03-29T02: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": "151fd06ab3a...
72a7346b-6bb4-428b-8a58-91ee7e27f337
toki0411/BOJ
14500.cpp
// // Copyright (c) 2022 <NAME> All rights reserved. // #include <iostream> #include <algorithm> #include <vector> using namespace std; int arr[501][501]; int n,m; int blue(int max){ int val = 0; for(int i=0;i<n;i++){ //긴 일자형 for(int j=0;j<m-3;j++){ if(val < arr[i][j]+arr[i][j+1]+arr[i][j+...
ALGO
0.999792
4.292107
{ "github_metadata": { "branch": "main", "commit_count": 289, "repo_created_at": "2021-05-16T07:24: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": "35cae6ce6e...
8f62f222-8bc4-4309-920e-d50d9697a6e2
rsingh09/Database-System-Implementation
GroupBy.cc
#include "GroupBy.h" GroupBy::GroupBy() { } GroupBy::~GroupBy() { } void GroupBy::Run(Pipe &inPipe, Pipe &outPipe, OrderMaker &groupAtts, Function &computeMe) { _inPipe = &inPipe; _outPipe = &outPipe; _groupAtts = &groupAtts; _computeMe = &computeMe; pthread_create(&workerThread, NULL, RunWorker, (void*)this);...
TOOL
0.986926
4.533027
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-07-29T14:18:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc09e4679d...
bd8560d2-e56c-4029-af39-95728cf1aa04
vi5hnuu/love-babbar-dssa-sheet-sol
1839. Longest Substring Of All Vowels in Order.cpp
/* A string is considered beautiful if it satisfies the following conditions: Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least once in it. The letters must be sorted in alphabetical order (i.e. all 'a's before 'e's, all 'e's before 'i's, etc.). For example, strings "aeiou" and "aaaaaaeiiiioo...
ALGO
0.999931
6.287467
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2022-08-02T00:45: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": "796e4dca0...
1cfd5379-3de8-41ec-90f7-ba02dd076dbb
ohil17yo36/CodeChef-Long
CodeChef/Maylong/tp.cpp
#include <bits/stdc++.h> using namespace std; int qu1[100000],indexl,indexr; // void printKMax(int arr[], int n, int k) // { // std::deque<int> Qi(k); // Qi.clear(); // int i; // for (i = 1; i <= k; ++i) // { // while ( (!Qi.empty()) && arr[i] <= arr[Qi.back()]) // Qi.po...
ALGO
0.999991
4.902069
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2015-09-03T11:55:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ee1468a31...
9ea55dac-541c-46e5-98ac-95246dbcebf1
FeiZhao0531/BasicAlgorithm
Sort/quickSort/main.cpp
/// quick Sort /// author: <NAME> /// creating time: May-5-2019 #include <iostream> using namespace std; class quickSort { public: void threeWaysQuickSort( int arr[], int low, int high) { if( low >= high) return; int l = low - 1, // arr[ low, l] < pivot r = high + 1, //...
ALGO
0.99998
5.229287
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2019-05-02T16:12:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "304986125...
96ff8ff8-57b3-4dff-bad4-0698dc5d4114
ssb22/old-web-access-gateway
debug.c++
/* Access Gateway - a mediator for the World Wide Web (C) 1998-2006 <NAME> http://ssb22.user.srcf.net 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...
WEB
0.947488
3.226697
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2017-11-17T15:38: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": "5dc1f9766...
aac203fd-6a19-4d24-b3dd-89c0440b4cfd
whywhyzhang/ACM-ICPC-Code
CF/367/D.cpp
// ━━━━━━神兽出没━━━━━━ // ┏┓ ┏┓ // ┏┛┻━━━━━━━┛┻┓ // ┃ ┃ // ┃ ━ ┃ // ████━████ ┃ // ┃ ┃ // ┃ ┻ ┃ // ┃ ┃ // ┗━┓ ┏━┛ // ┃ ┃ // ┃ ┃ // ┃ ┗━━━┓ // ┃ ┣┓ // ┃ ┏┛ // ...
ALGO
0.999645
3.930571
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2015-06-26T15:54: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": "419769d31...
c824ee50-00b6-4c39-bb5d-30eef4f96d41
code-cp/leetcode
solutions/739/main.cpp
/* ************************************************************************ > File Name: main.cpp > Author: Sean > Project: LeetCode > Created Time: Mon Nov 15 15:22:55 2021 > Description: ************************************************************************/ #include <vector> #include <stack> #...
ALGO
0.999927
5.929383
{ "github_metadata": { "branch": "main", "commit_count": 294, "repo_created_at": "2022-05-22T08:48: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": "1fde5596df...
64679bbb-5300-4287-91df-51fe9f5494eb
adrian-stanciu/adventofcode
2024/25/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { auto is = [](const auto& v, char first, char last) { const auto n = ssize(v); const auto m = ssize(v[0]); return count(begin(v[0]), end(v[0]), first) == m && count(begin(v[n - 1]), end(v[n - 1]), last) == m; }; ...
ALGO
0.99942
4.647034
{ "github_metadata": { "branch": "master", "commit_count": 184, "repo_created_at": "2019-12-29T08:05:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8945584...
5c2d9ffd-fc33-4244-b68f-7156337d5520
VladOliinyk/cs-b
a1-calculator/main.cpp
#include "prepare.h" #include "calculation.h" /* * The real main function. * Make all instead of us. * Gets equation string, prepare it, and solve. * * @param argc - the int number of parameters passed to the main function. * @param argv - the array of pointers to parameters strings. */ void makeAll(int argc, cha...
ALGO
0.992753
3.837126
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2016-04-10T09:30: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": "0ff3197ff...
3be032f6-e31f-4a9c-91c4-d97cf3b6c325
Komal-commits-ai/DSAjournal
Prefix.cpp
#include<iostream> #include"String.h" #include<algorithm> using namespace std; template <typename T> class Stack { T* stack; int top; int capacity; public: Stack() { stack = nullptr; top = -1; capacity = 0; } Stack(int c) { if (c < 0) { cout << "capa...
ALGO
0.999613
3.973045
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2024-12-14T12:03:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d1a1738e9de...
025237e9-b035-4517-9996-ca1e49bcdbcd
PumbaOmsk/M_A_D_E_A_L_G_O_2
12_5/main.cpp
/** * Введенский Вячеслав В. MADE-ML-22 * E. Суффиксный массив + lcp */ #include <iostream> #include <unordered_map> #include <list> #include <map> #include <queue> #include <stack> #include <cstring> #include <algorithm> static const int MAX_LENGTH = 400000; static const int BUF_SIZE = 100000; using namespace st...
ALGO
0.999881
4.097397
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-07-17T16:04:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1728874512...
b7aab7b0-4528-4672-b8e0-54eb6dadc174
rafa14-maker/Competitive-programming
bird2.cpp
//Create another class called Bird that that has following properties: //• Color [type string] //• Name [type string] //• Can_Fly_Or_Not [type boolean] //? Use Constructor Overloading and Function Overloading for the class. //? You also have to take the record of how many objects are created for both Bird class using s...
TOOL
0.924838
5.163795
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-10-04T08:29:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ff4fc39c689...
422b8138-f39e-4ef6-b1c3-761ac3865862
Princeofsyntax/leetcode
2103-find-all-groups-of-farmland/find-all-groups-of-farmland.cpp
class Solution { public: void dfs(vector<vector<int>>& land, int i, int j, int &x, int &y){ //x and y will provide coordinate for bottom right and i,j will provide coordinate for top left //base case if(i < 0 || j < 0 || i == land.size() || j == land[0].size() ){ return; }...
ALGO
0.99984
5.994931
{ "github_metadata": { "branch": "main", "commit_count": 1738, "repo_created_at": "2023-09-19T22:59: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": "b3a836d3b...
28538bd9-60c6-4b34-8ba7-b1c8c28c5d48
SelfishFish07/LABS_sem2
Lab №2/Deque/Deque.cpp
#include <iostream> #include <cstring> #include <cassert> struct Deque { size_t element_size; size_t capacity; size_t read_element_offset; size_t write_element_offset; void* buffer; }; void deque_new(Deque* deque, size_t capacity, size_t element_size) { if (deque != nullptr) { deque->e...
ALGO
0.946805
5.577143
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2025-02-20T12:03: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": "87624bf92b9...
f46e0d79-d236-461c-9bf5-911cb0589499
destroierdam/Intro-to-programming-2018-Materials
Lesson1/solutions/Task1.cpp
/* Task 1: Точка и окръжност По подадени координати (x, y) на точка, проверете дали тя лежи в окръжност с радиус 6 и начална точка (0,0). Нека x и y са цели числа. Вход: 2 1 Изход: Yes Вход: 10 12 Изход: No */ #include <iostream> #include <cmath> using namespace std; int main() { // Ще вземем две цели числа x и y...
ALGO
0.998466
4.750992
{ "github_metadata": { "branch": "master", "commit_count": 126, "repo_created_at": "2018-10-01T19:46:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98ddfb10...
adc5470e-0907-445f-af81-12c994e7b508
luckytina/Cpp-Primer
ch09/ex9_44.cpp
//! @Alan //! //! Exercise 9.43: //! Write a function that takes three strings, s, oldVal, and newVal. //! Using iterators, and the insert and erase functions replace all instances of //! oldVal that appear in s by newVal. //! Test your function by using it to replace common abbreviations, //! such as “tho” by “though”...
TOOL
0.908392
5.370252
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-08-30T08:31: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": "3df0ead0ef...
05e08852-dbed-438e-b16f-43274839f09c
caiosbrl7/cpp-SnakeGame
SnakeGame/src/main.cpp
#include <iostream> #include <conio.h> using namespace std; bool gameover; // indica se o jogo acabou ou não // tamanho do mapa const int largura = 40; const int altura = 20; // posicoes da cabeça da cobra e da fruta int x, y, frutaX, frutaY; int rabinhoX[100], rabinhoY[100]; int rabinhoTAM; int pontuacao; // en...
ALGO
0.985196
4.168746
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-10-07T22:36: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": "cbc27f8637...
2a95845f-4c76-43ce-b7f7-e6d5ff225beb
mkltaneja/Interview-Prep-Questions
Hashmap-and-Heaps/Smallest_Subarray_With_All_Occurrences_Of_The_Most_Frequent_Element.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> #include <climits> #define f first #define s second using namespace std; int final_mostfreq(vector<int> &arr, unordered_set<int> &mins) { for (int i : arr) if (mins.find(i) != mins.end()) return i; retur...
ALGO
0.99965
4.497741
{ "github_metadata": { "branch": "master", "commit_count": 189, "repo_created_at": "2020-08-19T19:08: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": "d07c6eab...
43a76181-5b86-44f3-b952-3765d68d5dd9
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/09/0906/personal_submission/cf838b_lengli.cpp
/* lengli_QAQ Hope there are no bugs!!! */ #include <bits/stdc++.h> #define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0) #define all(x) x.begin(),x.end() #define pb push_back #define int long long struct HLD{ int n,cnt; std::vector<int> sz,top,son,fa,in,out,seq,bk; std::vector<lo...
ALGO
0.999921
4.656062
{ "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": "a014...
3e7fc108-9950-4e90-a7cb-3c5c71dc0232
bgics/CP
src/1999C.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long bool solve(int *larr, int *rarr, int n, int s, int m) { for (int i = 0; i < n; i++) { if (i == 0 && larr[0] >= s) { return true; } if (i == n - 1 && m - rarr[n - 1] >= s) { return true; } if (i > 0 && larr[i] - rarr[...
ALGO
0.999919
4.36946
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-07-27T12:52:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9950c94d0f7...
2830cea2-1197-4819-a9d7-844d52a5f3d8
kanhaiyabaranwal/my-programs-old
CPP_source_programs-Fiserv/largestContiguousSubArray.cpp
#include <iostream> using namespace std; int findSubArray(char arr[],int size) { int starcount = 0; int hashcount = 0; int s=0,e=-1,max1 = -1; for(int i=0;i<size;i++) { if(arr[i] == '#') hashcount++; if(arr[i] == '*') starcount++; if(starcount == hashcount) ma...
ALGO
0.999708
3.777706
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-10-26T08:57: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": "c60c16e271...
a3872fb5-74b1-4a2a-8ad3-71e0e4efb054
IEEE-NITK/SummerProjects18
CP/Assignment1-STL/Vinay/map.cpp
#include <bits/stdc++.h> using namespace std; int main() { map<string, int> m; map<string, int>::iterator itr; int c, i, n, y; char x[50]; cin >> n; for (i = 0; i < n; i++) { cin >> c; if (c == 1) { cin >> x >> y; m[x] = y; } el...
ALGO
0.998003
3.516413
{ "github_metadata": { "branch": "master", "commit_count": 571, "repo_created_at": "2018-05-01T11:16:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 50, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "4e8c5254...
5f756490-2ec9-4458-bf5a-668c2cdf3868
tonystrawberry/university.utbm.ia41
ipseity_1-2-2_kernel_sc/dev/IpseityProject/1.2.2/_Common/Math/Permutation.cpp
/* * $Id$ * * Ipseity is an open-source platform dedicated to the development and * validation of Artificial Intelligence techniques in Multiagent Systems. * It is developed in C++ with the Qt framework (http://qt-project.org). * More details on <http://www.ipseity-project.com> * Copyright (C) 2015, 2014, 2013 I...
TOOL
0.973756
5.564044
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-05-21T18:39: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": "fd7160cc93...
0ad635b1-d89d-48e5-99c3-0e9a82fa9203
tstanvir/mySolutionRepo
codeforces/1185/D.cpp
#include<bits/stdc++.h> using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SETBOOL(x) memset(x,false,sizeof(x)) #define CLR(x) memset(x, -1, sizeof(x)) #define mp make_pair #define PII pair<int, int> #define pf printf #define sf scanf #define ALL(x) x.begin(),x.end...
ALGO
0.999948
3.244804
{ "github_metadata": { "branch": "master", "commit_count": 1669, "repo_created_at": "2021-03-31T23:56:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af95136...
2cc9ab96-4ed1-441a-be1c-578534dc1f17
skmonir/Algorithms
String-Processing/Double_Hashing_n_Mod.cpp
#include <bits/stdc++.h> using namespace std; #define ULL unsigned long long const int N = 1e6 + 5; char s[N]; struct HashString { LL Hash[2][N], Pow[2][N]; const int P[2] = {131, 151}; const LL Mod[2] = {1000000007LL, 1000000009LL}; void GeneratePower() { Pow[0][0] = Pow[1][0] = 1; f...
ALGO
0.999986
4.554339
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2016-10-03T19:26:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e86aae6e...
a593ac80-e2e3-4622-a16f-9d226616616a
rajput-vishal01/dsa-in-cpp
20_Graph-1/02_.cpp
/* Weighted Graphs: Adj List :: eg: 0 -> {(1,3),(2,4)} to -> {(form, weight),(form, weight)} V.V.V.V.V Imp -> BFS AND DFS : */ #include <iostream> #include<unordered_map> #include<list> #include<queue> #include<stack> using namespace std; class Graph { public: //first int -> u //second int -> v ...
ALGO
0.99996
6.085275
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2024-07-03T16: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": "d27386bcc5f...
0d5b1931-f13b-483c-abeb-97650a023c52
26sramirez6/cache-sim
cache.hpp
#include <memory> #include <vector> #include <iostream> #include <bitset> #include <list> #include <unordered_map> #define NDEBUG #include <assert.h> #include <time.h> #include <stdlib.h> #include <stdio.h> #include <stdint.h> //#define CACHE_DEBUG uint32_t constexpr ADDRLEN = 32; uint32_t constexpr MATS = 3; static ...
TOOL
0.950573
5.227816
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2019-01-28T08:28:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93c09b5ac...
cb37d2b7-73bb-4034-945b-23c5a780e664
skygupta07/DSA
9_array6/9_longestUnequalAdjacentGroupSubsequence.cpp
// longestUnequalAdjacentGroupSubsequence.cpp #include <bits/stdc++.h> using namespace std; /* You are given a string array words and a binary array groups both of length n. A subsequence of words is alternating if for any two consecutive strings in the sequence, their corresponding elements at the same indices in ...
ALGO
0.999987
5.745068
{ "github_metadata": { "branch": "main", "commit_count": 141, "repo_created_at": "2024-12-22T10:16:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1b1916975...
e4c92941-6500-47d4-bd07-9b2a89412c9a
raincross7/code-similarity
codes/train_code/problem189/problem189_31.cpp
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define Graph vector<vector<int>> typedef long long ll; const int INF = 1000000007; // #include <boost/multiprecision/cpp_dec_float.hpp> // #include <boost/multip...
ALGO
0.999967
4.247375
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d199396cd830...
290fc2bd-2d18-488c-8a81-2c92ce1511ac
kssilveira/mara
kaue/uva/swerc_2011/i.cc
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <iomanip> #include <limits> #include <list> #incl...
ALGO
0.999978
4.38167
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2011-09-12T22:23: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": "214b7d5a0...
ae5aae0f-8edf-4994-8d83-8b4e9b117e69
MahiAlJawad/Competitive-Programming
Codeforces/CF 486B.cpp
/****************************************************************************************************************************** *** "In the name of Allah(swt), the most gracious, most merciful. Allah(swt) blesses with knowledge to whom he wants." *** *** Author : <NAME> ...
ALGO
0.999803
3.165338
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2017-08-03T17:45: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": "fd46f591b...
5ccd952a-8381-4a84-a4de-980f95bda5f4
Merisho/comprog
codeforces/archive-1000-1200/1294c_3nums_product.cpp
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; for (int t = 0; t < T; ++t) { int n; cin >> n; int a = -1; for (int i = 2; i < sqrt(n); ++i) { if (n % i == 0) { n /= i; a = i; break; } } if (a == -1) { cout << "NO" << endl; continue; } int b = ...
ALGO
0.999681
4.004935
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2019-10-19T08:36: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": "7afd7db07...
3033c26c-b0bc-40fa-aff5-87b128203985
kpjgit/study
baek/bfs/tomato2.cpp
//7569 #include <bits/stdc++.h> int N, M, H; int box[101][101][101]; int dist[101][101][101]; int dx[] = {1, 0, 0, -1, 0, 0}; int dy[] = {0, 1, 0, 0, -1, 0}; int dz[] = {0, 0, 1, 0, 0, -1}; std::queue<std::tuple<int, int, int>> q; int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); ...
ALGO
0.999648
3.66867
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2024-07-09T04:38:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "048b9883535...
c7e1dbc4-670f-4b51-b131-22eb468d91b4
AndrewManukov/CS225
lab_dict/fib.cpp
/** * @file fib.cpp * Contains Fibonacci-number generating functions both utilizing and not * utilizing memoization. * * @author <NAME> * @date Winter 2013 */ #include "fib.h" #include <map> using std::map; /** * Calculates the nth Fibonacci number where the zeroth is defined to be * 0. * @param n Which n...
ALGO
0.999889
6.562426
{ "github_metadata": { "branch": "master", "commit_count": 152, "repo_created_at": "2020-08-20T17:22: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": "325d40cb...
e4622aa6-a0a8-451c-b582-656b44763b69
G-Gowtham/Programming
cpp/Extreme_nodes_in_alternate_order.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; return temp; } Node* buildTree(string st...
ALGO
0.999681
5.591777
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-07-05T05:47:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8276190456...
fa5bd80f-8e36-45f0-8ac3-cca03ddbfd8c
M-e11-s/labolatory--C-
lab №13-14/stupidwork5.cpp
#include <stdio.h> #include <stdlib.h> #include <stdlib.h> #include <ctime> #include <time.h> #define N 100 void massive(int arr[], int m) { printf("\n\n ["); for (int l = 0; l < m; l++) printf("%4d", arr[l]); printf(" ]"); } int main() { srand(time(NULL)); int f[N], n = 20, a, b, tmp, tmp2, kl = ...
ALGO
0.999809
3.865441
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2020-10-01T16:10: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": "aa8267d54...
158f7934-91b4-4efe-bdd4-8fb30ad0329c
HJSang/DailyTrack
vector.cpp
// Vector in C++ STL /* Vectors are same as dynamic arrays. resize itself automactically when an element is inserted or deleted. In vectors, data is inserted at the end. Inserting at the end takes differential time, as sometimes there may be a need of extending the array. removing the last elements takes only constant...
ALGO
0.963701
4.048172
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2019-08-17T22:13: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": "7ceca5571...
a6a02331-a9e1-459c-b125-fa454b77e7b5
aleksda/FYS4150
Project3/source code/test.cpp
#include "lib.h" #include "omp.h" #include <iostream> #include <iomanip> #include <fstream> #include <cmath> #include <string> #include <chrono> using namespace std; using namespace std::chrono; ofstream fileout; ifstream filein; double const PI = acos(-1); // Defining pi double const ANALYTICAL = 5.0 * PI * PI / (...
ALGO
0.998317
3.235677
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2019-09-10T10:34:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02003439e...
e28cb726-eec6-41f5-beee-aea638dd8a0c
nguyentatcuong251204/BTL_KTLT
function.cpp
#include "function.h" using namespace std; #define colWidth1 35 #define colWidth2 35 //Hàm tạo menu void main_menu() { cout << "\x1b[32m ____________________________________________________________________________________________\n"; cout << "| \x1b[34mChon chuc nang\x1b[32m ...
TOOL
0.998524
3.318724
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-06-05T10:57: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": "6383175dae...
b47c8dcc-9229-43ea-a02f-be7fcaa55cbf
nival/Prime-World
pw/branches/r1117/Vendor/boost/libs/spirit/example/qi/calc7/calc7.hpp
/*============================================================================= Copyright (c) 2001-2010 <NAME> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =================================================...
ALGO
0.921358
5.744773
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-09-20T17:05:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 154, "forks": 62, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8774225d9...
c361e0a2-3cea-45f8-b8e5-71454092dd11
alexfmsu/acm.timus.ru
1493. В одном шаге от счастья/1493.cpp
#include <iostream> #include <cstdio> #include <iomanip> #include <cstring> #include <cmath> using namespace std; int first_sum(string s){ return s[0]+s[1]+s[2]; } int second_sum(string s){ return s[3]+s[4]+s[5]; } string inc(string s){ for(int i = 5; i >= 0; i--){ if(s[i] < '9'){ s[...
ALGO
0.999917
3.304604
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2017-07-28T12:13: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": "4a76683e2...
b4be0633-2e22-4c55-8d21-f26516709961
Xarma123/cp-practice
C_Alternative_Thinking.cpp
#include <bits/stdc++.h> #define lol long long using namespace std; int main() { std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); lol n; cin >> n; string s; cin >> s; lol ans = 0; bool ad = false; bool again = false; bool ad2 = false; for (lol i = 0; i < s...
ALGO
0.999992
3.44282
{ "github_metadata": { "branch": "master", "commit_count": 176, "repo_created_at": "2022-09-18T23:21: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": "c02d74de...
f2b352e1-639f-4855-8bc1-6b582f5bb790
ishandutta2007/codeforces-a
aid/normal/958/C1.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; typedef long double ld; #ifdef DEBUG #define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #else #define eprintf(...) ; #endif #define sz(x) ((int) (x).size()) #define TASK "text" const int inf = (int) 1.01e9; con...
ALGO
0.999771
3.692692
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44647a7e3509...
b592f69e-1ea3-49cd-b505-529f63f32ac9
edzhuang/competitive-programming
USACO/dirtraverse.cpp
#include <bits/stdc++.h> using namespace std; const long long MAXN = 1e5+1; long long n; vector<long long> adj[MAXN]; long long len[MAXN] = {0}, num[MAXN] = {0}, ulen[MAXN]; bool file[MAXN] = {0}; long long name[MAXN]; void setIO(string s){ freopen((s+".in").c_str(), "r", stdin); freopen((s+".out").c_str(), "w", s...
ALGO
0.999699
3.457295
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-11-17T04:27: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": "063cabc1246d...
478c8965-6d79-42da-b575-2771f194c2e8
reductant01/c-programming-and-practice
test2/24년기말코딩시험_v1.0.cpp
#include <iostream> #include <string> #include <stdexcept> using namespace std; /* * 예외처리를 위한 클래스 계층: * TableEmpty <- EmptyException <- ExceptionError * TableOverflow <- OverflowException <- ExceptionError * 예외 발생시에 catch 문에서 해당 예외클래스명을 출력: virtual print() */ class ExceptionError { public: virtual void Print() const...
TOOL
0.930885
3.680099
{ "github_metadata": { "branch": "hwj", "commit_count": 9, "repo_created_at": "2024-07-01T03:39: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": "bb4bd9f803775...
506b8e52-f010-4a60-8c3d-36b328f69810
vhbb/cmssw
SimG4Core/CustomPhysics/src/FullModelReactionDynamics.cc
// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this ...
TOOL
0.987285
4.86117
{ "github_metadata": { "branch": "vhbbHeppy80X", "commit_count": 163384, "repo_created_at": "2013-07-23T13:22:20.000Z", "is_fork": true, "is_org_owned": true, "forked_from": "cms-sw/cmssw", "stars": 4, "forks": 5, "issues": 19, "pull_requests": 6 }, "file_meta": { "cont...
c2cd2913-cd0a-4983-be86-9e8c266b29d4
nevikw39/oj
AtCoder/Beginner_341/e.cpp
/** _ _ _____ ___ * _ __ _____ _(_) | ____ _|___ // _ \ * | '_ \ / _ \ \ / / | |/ /\ \ /\ / / |_ \ (_) | * | | | | __/\ V /| | < \ V V / ___) \__, | * |_| |_|\___| \_/ |_|_|\_\ \_/\_/ |____/ /_/ **/ #include <atcoder/all> #include <bits/extc++.h> #ifndef nevikw39 #def...
ALGO
0.999982
5.744725
{ "github_metadata": { "branch": "master", "commit_count": 2018, "repo_created_at": "2020-02-22T14:59:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03d2e8...
4183bc8b-fe8f-4d98-aaa7-250837c4fe74
mahendrarathore1742/dsa_notes
graph luv/Lowest_common_ancestor_in_graph.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; vector<int> graph[N]; int pars[N]; void lowest_common_ancestor_dfs(int node, int par) { pars[node] = par; for (int child : graph[node]) { if (child == par) continue; lowest_common_ancestor_dfs(child, node); } } vector<int> path(int node...
ALGO
0.999985
4.53224
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-01-23T09:53: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": "4e5db1bf3d7...
cd48b603-63fd-457d-baa6-f88b76461fd6
amitkparida/ProgrammingBasics
STL/Algorithms/11 transform.cpp
// 1. The transform() function in C++ sequentially applies an operation to the elements of an array(s) and // then stores the result in another output array. // 2. For an example if we want to perform square of each element of an array, and store it into other, // then we can use the transform() function. // 3...
ALGO
0.992489
6.263819
{ "github_metadata": { "branch": "master", "commit_count": 240, "repo_created_at": "2022-10-16T20:50:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d53ac75b...
ffeeb1b7-361a-4016-b858-3725fffc9b66
yhzhang0128/Wukong-S
utils/mymath.h
#pragma once #include <vector> class mymath{ //math will conflict with other lib; so it's named mymath public: uint64_t static gcd(uint64_t x, uint64_t y){ if (y == 0) return x; else return gcd(y, x % y); } uint64_t static get_distribution(int r,std::vector<int>& dis...
ALGO
0.994543
4.31794
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-10-14T17:50:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4214e3fbe0...
41ad5be9-3c7f-4221-acf8-3e36826eb201
kambehmw/algorithms_cpp
atcoder/ABC/037/D.cpp
#include <iostream> #include <cstring> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(n);i++) const int MOD = 1e9 + 7; const int INF = 1e9; int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; ll dp[1005][1005]; int a[1010][1010]; int H, W; ll dfs(int y, int x){ if(dp[y][x] != -1) ret...
ALGO
0.999912
4.294024
{ "github_metadata": { "branch": "master", "commit_count": 87, "repo_created_at": "2019-06-20T16:09: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": "8dad9180b...
c2f0a5c9-ad38-4cbc-864b-d87a966ae33a
metehkaya/Algo-Archive
Problems/LeetCode/Solutions/1274.Number_of_Ships_in_a_Rectangle.cpp
class Sea { public: bool hasShips(vector<int> topRight, vector<int> bottomLeft); }; class Solution { public: vector<int> getVec(int x, int y) { vector<int> v(2); v[0] = x; v[1] = y; return v; } int countShips(Sea& sea, vector<int> topRight, vector<int> bottomLeft) { ...
ALGO
0.999581
5.365037
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2023-04-04T19:44: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": "1d1c6357592...
40c4c0c4-aa15-4631-970d-a721eb64e490
spark0308/DS_ALGO_Codes
CodeForces/figbot.cpp
#include <bits/stdc++.h> using namespace std; string solution(int N, int X, int Y, string S) { vector<int> euDistances; int initX = 0; int initY = 0; euDistances.push_back(X + Y); for (auto x : S) { if (x == 'L') { initX -= 1; int temp = abs(X - initX) ...
ALGO
0.999986
4.934131
{ "github_metadata": { "branch": "main", "commit_count": 94, "repo_created_at": "2023-03-31T19:57:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4fbfd060098...
9978cb9e-87e2-454f-b4ce-0c7bb02c4e28
soso-light/PPS
A110_최소미_21900745.cpp
/* 잡화점에는 잔돈으로 500엔, 100엔, 50엔, 10엔, 5엔, 1엔이 충분히 있고, 언제나 거스름돈 개수가 가장 적게 잔돈을 준다. 타로가 잡화점에서 물건을 사고 카운터에서 1000엔 지폐를 한장 냈을 때, 받을 잔돈에 포함된 잔돈의 개수를 구하는 프로그램을 작성하시오. input output */ #include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main(){ int cost = 0; int n = 0...
ALGO
0.998612
4.186656
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-01-15T07:57: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": "21ece06572d7...
a3c33888-f98b-4856-a229-ff2daaf4d15d
Bach2324/DataStructure
assignment4/CUBuildingNetwork.cpp
/*******************************************************************/ /* CUBuildingNetwork Implementation */ /*******************************************************************/ /* TODO: Implement the member functions of class CUBuildingNetwork */ /* This class uses a linked-list o...
TOOL
0.991789
5.024616
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2021-01-02T21:53: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": "bf667547739...
c618150d-b941-4ceb-a7e9-c5f620b225ab
MarkVsudo/FMI-IP-Course
GROUP_1_WEEK_1_PRACT/task1.cpp
// Task 1 - Геомерия // Да се намерят лицето и обиколката на правоъгълник със страни дълги 10 см и 3 см // Примерен изход : Perimeter = 26, Area = 30 // Да се намерят лицето и обиколката на триъгълник със страни дълги 11 см и 17 см и 8см // Примерен изход : Perimeter = 36, Area = 35.5 #include <iostream> #include <cm...
ALGO
0.987131
4.358285
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2024-10-04T18:46:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41397a1a970...
0ebaa5e0-76dc-4354-bcce-93222bbaf4b8
intervalrain/Cpp
ggl/version.cpp
#include <bits/stdc++.h> using namespace std; struct apk_info{ int apk_version; int min_version = 1; int max_version = INT_MAX; apk_info(int ver, int mn, int mx){ this->apk_version = ver; this->min_version = mn; this->max_version = mx; } }; class Solution { public: uno...
ALGO
0.999551
4.860849
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2022-04-25T18:46:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c98e2c8afc...
8fca45bc-2ef5-469e-9c38-3497ce74a52b
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/07/0712/personal_submission/cf992b_tsreaper.cpp
#include <bits/stdc++.h> #define MAGIC ((int) 4e4) using namespace std; typedef pair<int, int> pii; bool flag[MAGIC + 10]; vector<int> prime; unordered_map<int, int> gao(int x) { unordered_map<int, int> mp; for (int p : prime) { if (p > x) break; if (x % p) continue; int t = 1; ...
ALGO
0.999805
4.553996
{ "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": "c67f...
bba44455-1701-4e06-a9bd-3a8ae4965756
ahay/src
user/chengjb/Mtti2delrsep2pTrueAmp.cc
/* 2-D two-components wavefield modeling based on original elastic anisotropic displacement wave equation and P-SV separation using low-rank symbol approximation in 2D TTI media. Authors: <NAME> (Tongji University) and <NAME> (The University of Texas at Austin) Copyright (C) 2012 Tongji University, Shan...
ALGO
0.994606
3.521646
{ "github_metadata": { "branch": "master", "commit_count": 15821, "repo_created_at": "2015-07-26T15:48:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 297, "forks": 177, "issues": 70, "pull_requests": 0 }, "file_meta": { "content_id": "01...
bd05addc-dd1b-45f6-8c71-36f098ab5ac0
arcana-lab/noelle
src/tools/loop_invariant_code_motion/include/arcana/noelle/tools/LoopInvariantCodeMotion.hpp
/* * Copyright 2019 - 2021 <NAME> * * 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 without limitation the rights to use, copy, modify, merge, publish, distr...
ALGO
0.920311
6.807937
{ "github_metadata": { "branch": "master", "commit_count": 6375, "repo_created_at": "2019-01-10T17:57:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 78, "forks": 35, "issues": 18, "pull_requests": 2 }, "file_meta": { "content_id": "d368d...
2ae069cc-bd7f-4daa-bd69-d0c14514d36a
nishagb/Computer-Graphics
WaveFront obj Modal Loader.cpp
/* Name: <NAME> ID: 109896013 Project name: CSCI 272 Program Assignment5: WaveFront obj Modal Loader */ #include <string.h> #ifdef __APPLE__ #include <GLUT/glut.h> #else #include <GL/glut.h> #endif #include <stdlib.h> #include <iostream> #include <math.h> #include<stdio.h> #include<String.h> #define PI 3.14159 ...
TOOL
0.923914
3.756572
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2018-01-14T07:56: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": "ec5373010...
93918c55-4625-433b-ac45-fa9f94bcc424
AR-Munna/DS
Final.cpp
#include<bits/stdc++.h> using namespace std; struct node { int val; node *next; }; struct linkedlist { node *head; linkedlist() { head = (node*)malloc(sizeof(node)); head = NULL; } void insert_1st(int n) { node*p = (node*)malloc(sizeof(node)); p->val =...
ALGO
0.998544
3.708686
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2017-04-04T19:11: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": "0ff38171d...
77735aae-c9c1-4c3f-b293-1964fa89114f
livinamuk/Hell2025
Hell2025/Hell2025/vendor/openmesh/include/OpenMesh/Core/Mesh/PolyMeshT_impl.hh
/* ========================================================================= * * * * OpenMesh * * Copyright (c) 2001-2025, RWTH-Aachen University * * ...
TOOL
0.990117
7.079014
{ "github_metadata": { "branch": "main", "commit_count": 234, "repo_created_at": "2023-09-03T12:40:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1970, "forks": 89, "issues": 3, "pull_requests": 5 }, "file_meta": { "content_id": "70c672...
a4030637-7096-4ceb-afda-ac3853e675f9
xalil8/Image_processor
c++_first_codes/6.4.3 grades calculator..cpp
#include<iostream> https://vidoza.net/sigomkvuwioa.html using namespace std; int grader(int x); int main() { int grades_number, sum = 0,grade,avg_grade; cout << "enter the number of grades" << endl; cin >> grades_number; for (int counter = 1; counter -1< grades_number; counter++) { cout << "enter the grades " <...
TOOL
0.918646
3.517751
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-09-09T19:08: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": "682eaf743d...
617b5b62-10d1-4b0b-920d-159d20bfcfdc
keshavredd/projects
keshav pro.cpp
#include<stdio.h> struct process { int pid,bt,wt,tat; }; int main() { int n=3,i,j; int total_wt=0,total_tat=0; printf("\nENTER Pid of 3 students and Burst Time : "); struct process a[n]; for( i=1;i<=n;i++) { struct process pd; printf("\n\t process ID : "); scanf("%d",&pd.pid); printf("\n\...
ALGO
0.999975
3.514189
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-04-20T13:44: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": "db5d033d2b...
087a937d-6687-4364-82e4-493684bc0f3c
ayanspeaks/leetcode
1261-find-elements-in-a-contaminated-binary-tree/1261-find-elements-in-a-contaminated-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.998914
5.896993
{ "github_metadata": { "branch": "main", "commit_count": 2063, "repo_created_at": "2024-02-16T07:18:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "266dc0b6a...
e32baeaa-ed13-4882-927a-9ef329a42b21
gale34/AlgospotPractice
Algospot/NUMB3RS/main.cpp
#include <iostream> #include <cstdio> #include <cstring> #define MAX_TOWN_NUMBER 51 #define MAX_DAYS 101 using namespace std; double traceCriminal(bool** town, double** memory, int* numAdjacentTown, int days, int townNumber, int startTown, int maxTownNumber); int main() { int c, n, d, p, t; //freopen("inpu...
ALGO
0.999712
4.107369
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2017-07-01T02:21: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": "5ed78c4bf...
484c3e1b-abd4-47e3-9979-3447caf81524
hsnyibrhm/prak-alpro
study kasus 6/outpro.cpp
// proses dan ouput #include <iostream> #include <string> using namespace std; class studikasus{ public: void outpro(){ cout << "\n\nDAFTAR NILAI MAHASISWA" << endl; for (int i = 0; i < n; i++) { //rata rata rata = ((nilai_tugas[i] + nilai_uts[i] + nilai_uas[i])/3); // nilai akhir akhir = ((nilai_tuga...
TOOL
0.93888
3.293496
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-03-17T05:05: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": "ea2a73d74df...
f4e62dc9-0b5a-4627-89d3-4d7d728adf47
Gopal-nd/DSA-striver
dsa-array/medium/longestcontugeioSubarryinaArray.cpp
#include <bits/stdc++.h> using namespace std; // bruet force is to find the next elment by doing thelenaear search bool linearSearch(vector<int>&a, int num) { int n = a.size(); //size of array for (int i = 0; i < n; i++) { if (a[i] == num) return true; } return false; } int longes...
ALGO
0.999947
5.040321
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2024-05-31T18:15: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": "e2becbc2a53...
0eb3d67c-d56e-4bb1-b318-10663fda5509
Mattoid15/Portfolio
AvlTrees/AvlTree.h
/******************************************************************* * Author: <NAME> * * Major: Computer Science * * Creation Date: February 8, 2023 * * Course: Data Structures ...
ALGO
0.997422
5.962255
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-01-31T23:28:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc07abaca320...
bf7fa175-45d4-4fcc-85e8-9f8c52fdd14b
rob-chambers/mt5-strategies
MetaTraderStrategies/MT5/pin.cpp
//+------------------------------------------------------------------+ //| pin.mqh | //| Copyright 2017, <NAME> | //+------------------------------------------------------------------+ #include "aCandlePatterns.mqh" // wizard desc...
ALGO
0.977037
7.111094
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2017-11-25T18:44:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0dc24678...
72e65236-c34a-4faf-9d74-4a78533f4af6
mdshadesh/Codeforcesall-problem-solution-
Codeforces Round #814 (Div. 1)/Fibonacci Strings.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int MXF = 50; ll fib[MXF]; void prep() { fib[0] = 1; fib[1] = 2; for(int i = 2; i < MXF; i++) fib[i] = fib[i-1] + fib[i-2]; } ll to_base(int x) { ll ans = 0; for(int i = MXF-1; i >= 0; i--) { if(x >=...
ALGO
0.999874
4.258026
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2022-06-15T17:40:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fb15f3377...
8ecf5b70-7edd-4a81-a044-3bf1f33c10b9
imo1-nu/atcoder
abc/abc357/e/main.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; --A[i]; } vector<vector<int>> in...
ALGO
0.999916
4.263041
{ "github_metadata": { "branch": "main", "commit_count": 168, "repo_created_at": "2024-07-19T15:53: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": "fd00b3f39d...
c7d32f4a-7e6b-4f8c-8d55-2a21dc719da9
AkshatRauthan/Decode-DSA-2.0-With-Cpp
47. Binary Search Trees 1/DFS_TraversalsInBST.cpp
#include "iostream" #include "vector" #include "binaryTree" using namespace std; int main(){ vector<int> v = {8,4,12,2,6,10,14,1,3,5,7,9,11,13,15}; binaryTree b(v); cout<<"The Binary Search Tree Is As Follows : \n"; b.displayTree(); cout<<"\n\nThe Pre-Order Traversal Of The Binary Search Tree Is : ...
ALGO
0.999825
4.946462
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2024-01-04T16:33:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3181135b646...
24de7292-24fb-4973-a850-0207235a43c2
freebsd/freebsd-ports
graphics/photivo/files/patch-Sources_ptImage.cpp
--- Sources/ptImage.cpp.orig 2016-03-22 03:34:55 UTC +++ Sources/ptImage.cpp @@ -40,8 +40,11 @@ #include <QString> #include <QTime> -#include <algorithm> +#ifdef __GLIBCXX__ #include <parallel/algorithm> +#else +#include <algorithm> +#endif #include <stack> // std stuff needs to be declared apparently for jpeg...
ALGO
0.998728
6.901605
{ "github_metadata": { "branch": "main", "commit_count": 713138, "repo_created_at": "2011-05-26T11:15:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1066, "forks": 794, "issues": 0, "pull_requests": 54 }, "file_meta": { "content_id": "cc...
91ab686b-ca1b-44a4-9991-209bf1f51ec5
kumar6rishabh/all_codes
cpp_prac/Educational_Codeforces_Round70(2)/You_Are_Given_Two_Binary_Strings.cpp
#include<bits/stdc++.h> #define forn(i,n) for(long long int i = 0 ; i < (long long int)n ; i++) #define for1(i,n) for(long long int i = 1 ; i < (long long int)n ; i++) #define get1(a) scanf("%lld", &a) #define get2(a , b) scanf("%lld%lld", &a , &b) #define get3(a , b , c) scanf("%lld%lld%lld", &a , &b , &c) #define mp...
ALGO
0.999841
4.43917
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-09-22T03:54: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": "69ab459bcc...
d6a46d98-4b2b-40bb-8c73-68a90c5107a7
ishandutta2007/codeforces-nonalphabetic
6aren/normal/1517/E.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; /* change null_type to int if we want to use map instead find_by_order(k) returns an iterator to the k-th element (0-indexed) order_of_key(k) returns numbers of item being strictly smaller th...
ALGO
0.999177
3.952009
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "704a768f802c...
dcf0d0ff-253b-4e0c-a751-af0021936aef
W-Dominic/LeetCode
medium/lowest_common_ancestor_of_a_binary_tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ #include <stack> class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { ...
ALGO
0.999975
6.441703
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2022-07-12T22:53: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": "da57eacff8d...
7bbf86a3-7ee7-45fa-b245-1534fa7a2c70
mohamedGamalAbuGalala/Practice
Train/El_Sageer/El_Sageer_Pupil/02 - 07 - [DS]/02 - 03 - [DS] Linear DS/03 - [DS] Linear DS/onTopic/5.UVa [10172].cpp
#include <bits/stdc++.h> using namespace std; // input handle #define iln() scanf("\n") #define in(n) scanf("%d",&n) #define ins(n) scanf("%s",n) #define inc(n) scanf("%c",&n) #define inf(n) scanf("%lf",&n) #define inl(n) scanf("%lld",&n) #define ot(x) printf("%d", x) #define sp() printf(" ") #define ots(x) printf("%s"...
ALGO
0.999256
3.274674
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2017-11-24T03:37:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3752c12c...
dea8591e-f716-4a30-9b7f-773c5cf88a9f
ishandutta2007/codeforces-k
klimoza/normal/1118/F1.cpp
#include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <cmath> #include <algorithm> #include <deque> #include <cassert> #include <math.h> #include <random> using namespace std; #define PI 3.14159265 typedef long long ll; const ll INF = 4 * 1e18; const int INFi = 2 * 1e9; ll mo...
ALGO
0.999845
4.165919
{ "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": "c277e079035a...
89f52248-c7cd-40be-9722-4d270afb1d97
pawan-nirpal-031/Algorithms-And-ProblemSolving
Active/Codechef/Bitwise_swaps.cpp
// Problem Link : #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; #define Mod 1000000007 #define Infinity (ll)1e18 #define Append(a) push_back(a) #define Pair(a,b) make_pair(a,b) #define Clear(a) for(ll &x : a){x=0;} #define Point(x) s...
ALGO
0.999885
4.753014
{ "github_metadata": { "branch": "master", "commit_count": 121, "repo_created_at": "2021-03-16T14:30:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "64f4f885...
d6a900cc-1f04-4405-82e7-1e291f3e0a27
hm95/algorithm_practice
UVA/A_Node_Too_Far/A_Node_Too_Far.cpp
#include <iostream> #include <map> #include <queue> #include <set> using namespace std; int main() { int num_connections, test_case_number = 1; while( cin >> num_connections && num_connections != 0 ) { int from, to; map < int, vector <int> > connections; set <int> unique_nodes, visited; for( int connection...
ALGO
0.998208
4.16815
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2013-10-31T02:28:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d8c6b8f5e...
2f753983-cb86-48e7-a0df-0f9d58e0e907
MBallot/qrap
Prediction/IntMatrixCalc.h
/* * QRAP Project * * Version : 0.1 * Date : 2008/04/01 * License : GNU GPLv3 * File : IntMatrixCalc.h * Copyright : (c) University of Pretoria * Author : <NAME> (<EMAIL>) * Description : Defines inline functions used in cPlotask to calculate * the eleme...
ALGO
0.982318
3.40802
{ "github_metadata": { "branch": "master", "commit_count": 294, "repo_created_at": "2018-02-12T13:35:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "708ff927...
9437439d-7090-4ba8-b9c9-d959ce2043e5
HuangJingGitHub/PracMakePert_C-Cpp
leetcode/two_sum/leetcode_460.cpp
struct Node { int cnt, time, key, value; Node(int _cnt, int _time, int _key, int _value):cnt(_cnt), time(_time), key(_key), value(_value){} bool operator < (const Node& rhs) const { return cnt == rhs.cnt ? time < rhs.time : cnt < rhs.cnt; } }; class LFUCache { int capacity, time; u...
ALGO
0.999767
5.809351
{ "github_metadata": { "branch": "master", "commit_count": 1601, "repo_created_at": "2018-06-18T09:26: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": "ecda50d...
91ffd1d6-1949-4993-b5ca-0913001b1694
sagittariusk2/Leetcode-solutions
Type it! - GFG/type-it.cpp
//{ Driver Code Starts // Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: int minOperation(string s) { // code here int ans = 0; int n=s.size(); bool used = false; for...
ALGO
0.999835
5.453224
{ "github_metadata": { "branch": "main", "commit_count": 698, "repo_created_at": "2021-12-25T17:16: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": "2862225696...
3ee1d908-3ffa-49fd-927a-67ce874b3b88
omkar-kashid/DSA
Sorting/non-recursive/bubble.cpp
#include <bits/stdc++.h> using namespace std; void bubbleSort(int *arr, int n) { int count = 0; for (int i = n - 1; i >= 1; i--) { for (int j = 1; j <= i; j++) if (arr[j] < arr[j - 1]) { swap(arr[j], arr[j - 1]); count++; } ...
ALGO
0.999789
4.888872
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2023-01-13T04:34: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": "3853514cf...
2ce3eb83-d5c8-423b-b3a7-0508eea46d48
KimmiGYH/LeetCode_Notes_Public
Solutions_0001-1000/0015_3Sum_三数之和/cpp_1_双指针.cpp
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int>> res; // nums = [3,0,-2,-1,1,2] //排序nums = [-2,-1,0,1,2,3] //Expected: [[-2,-1,3],[-2,0,2],[-1,0,1]] int n = nums.size(); sort(nums.begin(), nums.end()); for (int i...
ALGO
0.99999
5.7468
{ "github_metadata": { "branch": "master", "commit_count": 1342, "repo_created_at": "2020-09-02T06:15: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": "8015f3e...
65ccf453-8bc9-4dee-b56a-2a632f3edf3b
dlwhsk0/BaekJoon
BaekJoon/18353.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; // LIS 문제 : 최장 증가 부분 수열 int arr[2001]; vector<int> v; int main() { cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false); int n, num, i, maxnum = 0; cin >> n; for (i = 0; i < n; i++) { // 입력 받기 cin...
ALGO
0.999961
4.48278
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2023-05-23T12:28: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": "d4ef40baa...
919c79df-4fce-4e89-8ed5-60e697fb515a
KatoIT/devC
test/1703_01.cpp
#include <bits/stdc++.h> #include <iostream> #include <iomanip> #include <fstream> #include <conio.h> using namespace std; #define MAX 60 struct nuocDi { char n; //Số ô có thể đi tiếp char x, y; //Vị trí }; int danhDau[MAX + 1][MAX + 1]; int kichThuoc; char dx[] = {-2, -2, -1, -1, 1, 1, 2, 2}; char dy[] ...
ALGO
0.998488
3.551012
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-02-06T04:33: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": "7517f14b6c...