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
aba86dc3-02e8-4c7f-9809-42008ea199de
monero-project/monero
src/cryptonote_basic/hardfork.h
// Copyright (c) 2014-2024, The Monero Project // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list o...
ALGO
0.961986
7.620509
{ "github_metadata": { "branch": "master", "commit_count": 12102, "repo_created_at": "2014-04-30T14:38:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9640, "forks": 3235, "issues": 477, "pull_requests": 247 }, "file_meta": { "content_id"...
3fc49cc3-9f5a-40b4-823d-3bc404ec2871
Bonnie-entre/ncku
Algorithm/HW9_easy.cpp
#include <iostream> #include <queue> #include <cstring> #include <string> using namespace std; typedef pair<int,int> P; int main(){ int n, m, sx, sy, tx, ty; cin >> n >> m >> sx >> sy >> tx >> ty; sx-=1; sy-=1; tx-=1; ty-=1; int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; int d[n][m]; int maze[n][m]; ...
ALGO
0.99976
4.272253
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2021-09-20T07:31: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": "0fb8bf7effe...
0b710a25-b44a-4645-9365-851c178a5f37
kuluruvineeth/Placement_Preparation
Strings/longest_common_prefix.cpp
/* Given a set of strings, find the longest common prefix. Examples: Input : {"apple", "ape", "april"} Output : "ap" */ #include<bits/stdc++.h> using namespace std; int minLen(vector<string> v) { int len = INT_MAX; for(int i=0;i<v.size();i++) { int strsize = v[i].size(); len = min(len,str...
ALGO
0.999863
4.363926
{ "github_metadata": { "branch": "main", "commit_count": 343, "repo_created_at": "2021-08-10T01:07:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7364ba7fd...
8d15b776-ff22-4206-98b6-4e5504650813
sherry880929/class
[C_ST26-易] 信用卡卡號檢查.cpp
#include <iostream> #include <string.h> #include <cmath> using namespace std; int main() { // [C_ST26-易] 信用卡卡號檢查 string card_num; int len = 0; while(cin >> card_num) { int sum = 0; //最後16位的總和(除10的那個數) len = card_num.size(); //字串長度,判斷幾位數 char card[le...
ALGO
0.999273
3.50383
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2020-01-16T14:52: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": "856a43800...
455ef933-b0a1-49c1-b33f-cfec5b87443d
TarunSinghal960/Tech-Project
main.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> char values[9] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; void move(char name[7]) { char r = ' '; int p; if(name == "player1") { r = 'X'; name = "Player 1"; } else { r = 'O'; name = "Player 2"; } while(1) { printf("%s : \n", name); print...
ALGO
0.999556
3.563587
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-05-14T18:25: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": "7e5c3fc001...
807c28a6-8d4c-410f-98b3-14ef69acb682
ahmed-dinar/UVA
UVA Solved Problem/11991 - Easy Problem from Rujia Liu/11991 - Easy Problem from Rujia Liu.cpp
#include<cstdio> #include<sstream> #include<cstdlib> #include<cctype> #include<cmath> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include<vector> #include<cstring> #include<map> #include<iterator> using namesp...
ALGO
0.999945
3.280936
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2014-11-13T16:57: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": "4900fa33a...
7c60ae6a-75bc-4136-8901-f807b367c0ff
ishandutta2007/codeforces-s
swistakk/normal/420/E.cpp
#include <iostream> #include <vector> #include <set> #include <map> #include <algorithm> #include <cmath> #include <ctime> #include <cstdlib> #include <cstdio> #include <utility> #include <iomanip> #include <assert.h> #define MP make_pair #define PB push_back #define FOR(i, a, b) for(int i =(a); i <=(b); ++i) #define R...
ALGO
0.99455
3.483794
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a13eca0e559...
5adaa154-c9cb-4049-9f8e-e0cad34ea4cd
suman6517/LeetCode_Solutions
0662-maximum-width-of-binary-tree/0662-maximum-width-of-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.999636
5.455758
{ "github_metadata": { "branch": "main", "commit_count": 790, "repo_created_at": "2023-10-04T21:11: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": "c30387a06b...
a0aab9f9-f19d-4dfd-8e45-4750744030b1
imtiazrabby/Algorithm-Design-and-Analysis
Algorithm LAB REPORT/Lab Report 02 Implement Merge Sort using Iterative approach and Recursive approach and compare the time complexities/Merge_sort_Iterative.cpp
#include <iostream> #include <vector> using namespace std; void merge(vector<int>& arr, int left, int mid, int right) { int n1 = mid - left + 1; int n2 = right - mid; vector<int> L(n1), R(n2); for (int i = 0; i < n1; i++) L[i] = arr[left + i]; for (int j = 0; j < n2; j++) R[j] = a...
ALGO
0.999996
6.055442
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2025-07-05T11:35: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": "2d4638974c7...
630b07b0-db8f-4e21-92e2-758718bcd942
klb3713/aoapc-book
TrainingGuide/bookcodes/ch1/uva10635.cpp
// UVa10635 Prince and Princess // <NAME> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn = 250 * 250; const int INF = 1000000000; int S[maxn], g[maxn], d[maxn]; // LIS所需 int num[maxn]; // num[x]为整数x的新编号,num[x]=0表示x没有在A中出现过 int main() { int T; scanf("%d", &T); for(int ...
ALGO
0.999828
3.498663
{ "github_metadata": { "branch": "master", "commit_count": 198, "repo_created_at": "2013-09-22T01:26:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 181, "forks": 56, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "41649...
a8cfce44-c191-457c-8984-886244ddd9e0
kornelistvankis/book_embedding
hybrid.cpp
#include "hybrid.h" Hybrid::Hybrid() { } void Hybrid::setLocalSearchParameters(Neighbourhood *neighbourhood, StepFunction *stepFun){ this->neighbourhood = neighbourhood; this->stepFun = stepFun; } void Hybrid::setGAparameters(int size, double crossOverProb, double mutationProb, int iter){ this->populati...
ALGO
0.999978
4.924106
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2016-10-15T12:23: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": "3d39ff0dd...
83153dcd-0d8d-4367-ba5e-5e14f47d6f58
AshwaniGautam/SPOJ
GSS3.cpp
/* The darkest places in the hell are reserved for those who maintain thier neutrality in times of moreal crisis- <NAME> */ #include<stdio.h> #include<iostream> #include<string.h> #include<math.h> using namespace std; struct node{ int prefix_sum, suffix_sum, total_sum, solution ; } ; int prefix_sum[300009], su...
ALGO
0.999952
4.95505
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2016-08-01T18:20:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "5d17ececd...
012a4054-1fa3-41e9-becf-2b24a4acc360
Far4X/CascadiaLO21
scoring/hawkscoringcards/hawkscoringcardb.cpp
#include "hawkscoringcardb.hpp" #include "scoring/scoreutils.hpp" std::vector<double> HawkScoringCardB::computeScore(const PlayerBoard& board) const { auto hawks = ScoreUtils::getComponents(board, MAX_SIZE, ScoreUtils::makeWildlifePolicy(Hawk)); std::unordered_set<GameTile*> isolated; for (const std::ve...
ALGO
0.985882
4.803466
{ "github_metadata": { "branch": "main", "commit_count": 260, "repo_created_at": "2025-03-11T15:53: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": "974dee17d8...
4bffcf3f-4b0f-476a-a135-7b99338f7daf
Huska69/Data-Structures-Learning
Binary Search Tree 1.cpp
//Binary Search Tree 1. //Please finish the class "BinarySearchTree" #include<iostream> #include<cstdlib> #include<ctime> using namespace std; class Tree { public: Tree() { recursive_index =0; first_done = false; int j; for(j = 0;j < 2000;j ++) root[j] = -1; } int insert(int node) { int inde...
ALGO
0.999822
4.698353
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-01-30T07:07:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17952389e64...
cd2596e9-002a-4167-8baa-41f8fa67eb4e
mclumd/erewhon_systems
godel/src/search/goal_network.cc
#include <vector> #include <deque> #include <set> #include <algorithm> #include <ext/hash_map> #include "goal_network.h" #include "globals.h" #include "state.h" class State; using namespace std; bool gne_compare::operator() (const GoalNetworkEntry *gne1, const GoalNetworkEntry *gne2) { return (gne1->f < gne2->f...
ALGO
0.998976
3.416364
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2016-08-02T16:02:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e12607c1d3...
64d5a3e1-7306-4ba4-af40-73f6f743912c
lechkulina/RealmsOfSteel
engine/source/math/Vector2D.cpp
/* * Copyright (c) 2016 <NAME> * * This file is part of the Realms Of Steel. * For conditions of distribution and use, see copyright details in the LICENSE file. */ #include <math/Matrix2D.h> #include <math/Vector3D.h> #include <math/Vector4D.h> #include <math/Vector2D.h> const ros::Vector2D ros::Vector2D::ZERO(0...
TOOL
0.918494
6.127036
{ "github_metadata": { "branch": "master", "commit_count": 211, "repo_created_at": "2016-09-14T18:10: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": "ed69b5b6...
671c3570-8c1c-4843-b7ab-98aa0b25807b
SJMA11723/Problem-solving
codeforces/Codeforces Round 746 (Div. 2)/C.cpp
/** * Author: <NAME> * Github: https://github.com/SJMA11723 */ #include <bits/stdc++.h> using namespace std; int dfs(int node, vector<int> tree[], int arr[], const int x, int &cnt, int p = -1){ if(cnt == 2) return -1; int res = arr[node]; for(int v : tree[node]){ if(v == p || cnt == 2) continue;...
ALGO
0.999966
5.392754
{ "github_metadata": { "branch": "main", "commit_count": 558, "repo_created_at": "2022-10-19T22:29:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d32e0e3791...
f0dbff8b-e7dd-450e-9480-1fbc388e46d5
akashskypatel/StraightSkeleton
StraightSkeleton/PrimitiveUtils.h
#pragma once #include "Vector2d.h" #include "LineParametric2d.h" #include <vector> #include <algorithm> class PrimitiveUtils { public: struct IntersectPoints { public: Vector2d Intersect; Vector2d IntersectEnd; IntersectPoints(); IntersectPoints(Vector2d intersect, Vector2d...
ALGO
0.999189
6.137592
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2022-08-07T22:12:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6484cb997...
5b94f293-4690-4f3e-b403-963ba9b2e67c
SYloveCNY/BigInteger
BigInteger/src/Main.cpp
#include <iostream> #include "BigIntegerDll.h" static BigInteger fibonacci(int n) { if (n == 0) return BigInteger(0); if (n == 1) return BigInteger(1); BigInteger a(0); BigInteger b(1); BigInteger result; for (int i = 2; i <= n; ++i) { result = a + b; a = b; b = result; ...
ALGO
0.983677
5.137046
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2025-03-09T02:29: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": "77f5428778...
fc08bdc4-8fa9-4efb-894e-f0f03bb2187b
caillotantoine/Coop-Evidential-Semantic-Grid
Sources/src_c/metrics.cpp
#include <stdio.h> #include <stdlib.h> int TFPN_CPP(unsigned char *truth, unsigned char *test, unsigned char *zone, int coop_lvl, int gridsize, unsigned char TFPN_sel, unsigned char label); void toOccup_CPP(unsigned char *sem_map, unsigned char *out, int gridsize); int TP(unsigned char truth, unsigned char test, unsig...
ALGO
0.963725
4.397966
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2022-04-13T14:13:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6aa424809e...
760d5909-592f-4ec0-a6c5-e6fb1d615ba4
bszendro/mazegen
src/hexmaze.cpp
#include "hexmaze.h" #include "painter.h" using namespace std; using EStyle = IPainter::EStyle; static constexpr char NODE_OPEN = 0; static constexpr char NODE_VISITED = 1; static constexpr char NODE_ONPATH = 2; static constexpr char NODE_INVALID = 3; static constexpr char EDGE_OPEN = 0; // Edge that was not used d...
ALGO
0.994606
5.993409
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2025-01-29T15:44: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": "f59fc87cbf5...
1fcb0160-ea59-4cfe-88e3-39fd7d16a6b4
blender/blender
source/blender/blenlib/intern/polyfill_2d_beautify.cc
/* SPDX-FileCopyrightText: 2023 Blender Authors * * SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup bli * * This function is to improve the tessellation resulting from polyfill2d, * creating optimal topology. * * The functionality here matches #BM_mesh_beautify_fill, * but its far simpler to...
ALGO
0.999573
6.710209
{ "github_metadata": { "branch": "main", "commit_count": 152123, "repo_created_at": "2019-10-09T12:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15670, "forks": 2395, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0...
5765ce6f-0f6e-475f-a262-0bf6c4a93f6c
gabrielmesquita7/Algorithms-and-Data-Structures-II
Comparison-of-Tree-structures/src/time.cpp
#include "time.hpp" double binaryTime; double AvlTime; double RBTime; double VectorTime; double MapTime; double UnorderedMapTime; void resetTimes() { binaryTime = 0.000000000; AvlTime = 0.000000000; RBTime = 0.000000000; } void measure_timeInsert(int qtd) { auto start1 = chrono::high_resolution_clock...
ALGO
0.981816
3.557166
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-08-01T12:56: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": "503a9e80f20b...
9a90dfd2-8d36-4ff1-a076-8c7a57637bb8
kinstugi/algorithms_journey_folder
usaco/02_bronze/intro_to_set_maps/06_cities_and_states.cpp
#include <bits/stdc++.h> using namespace std; void setIO(string name = "") { ios_base::sync_with_stdio(0); cin.tie(0); if (name.size()) { freopen((name + ".in").c_str(), "r", stdin); freopen((name + ".out").c_str(), "w", stdout); } } int main(){ setIO("citystate"); int n; cin >> n; vector<pai...
ALGO
0.999752
3.96861
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2024-02-02T23:26: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": "581013ae7...
ed43d5e9-4387-4d27-a9c6-94144fb696eb
VvyLw/Solved
yukicoder/450/e/main.cpp
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #ifdef local #include <C++/core/io/debug_print.hpp> #else #define dump(...) void(0); #endif #include <iostream> #include <ranges> #include <valarray> #include <atcoder/modi...
ALGO
0.999983
4.512052
{ "github_metadata": { "branch": "master", "commit_count": 164, "repo_created_at": "2023-12-04T13:28: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": "70404141...
a4f6cac6-d74d-4d00-b35c-fc86ca1090e8
Hexcold/.fup
base/03 . Seleção - Manipulação/L2 - Fique de @final/C++/Solver.cpp
// autor: <NAME> (instagram: @henrq.p | github: Hexcold) // Repositório online: https://github.com/Hexcold // Repositório original das questões: https://github.com/qxcodefup/arcade/blob/master/base/resto/Readme.md #include <iostream> int main() { int nota1 = 0, nota2 = 0; float notaFinal = 0; std::cin >...
ALGO
0.997518
4.349538
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-03-07T02:52: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": "b0d05be20a5...
64335a67-b0cb-43c1-a694-97c150271406
Maximusthr/Programacao-Competitiva
codeforces/Questoes/Div 2/B/B_Perfecto.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); int t; cin >> t; while(t--){ ll n; cin >> n; ll sum = n * (n+1)/2; ll square = 1LL*sq...
ALGO
0.999884
4.448272
{ "github_metadata": { "branch": "main", "commit_count": 618, "repo_created_at": "2025-02-09T20:56: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": "f491a9bce8...
593aa654-cee8-461c-bbc1-b1e1507fe68e
DongJinNam/boj
12026.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main() { std::ios::sync_with_stdio(false); int n, i, j; string s; cin >> n; cin >> s; vector<int> dp(n + 1, inf); dp[0] = 0; for (i = 1; i < n; i++) { for (j = i - 1; j >= 0; j--) { if (s[i] != s[j]) {...
ALGO
0.999936
3.431131
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2017-07-03T19:01: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": "7f49b54da...
8579bcc2-0e1e-4d62-a3c9-cfdecb2fcf61
fuguiw/oj
jianzhi_offer/delete_duplication.cc
#include <iostream> using namespace std; struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; class Solution { public: ListNode* deleteDuplication(ListNode* pHead) { ListNode** curr = &pHead; bool del_flag = false; whi...
ALGO
0.999814
5.003076
{ "github_metadata": { "branch": "master", "commit_count": 777, "repo_created_at": "2013-01-25T13:16:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ede832e...
24976bee-3e8c-4211-b0f9-73eb09dd4819
Harshitkumar07/DSA-in-cpp
Arrays/Leetcode Solutions/152. Maximum Product Subarray.cpp
** Leetcode Problem 152 :- ** Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer. Example 1: Input: nums = [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Example 2: Input: ...
ALGO
0.999994
7.423739
{ "github_metadata": { "branch": "Main", "commit_count": 997, "repo_created_at": "2024-09-25T14:42:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66b6ecb52a...
8d10464e-6e46-4223-9064-b364d21ac3df
HeZephyr/Awesome-Algorithm-Resources
CCPC/2018CCPC吉林赛区/C.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; const int N = 1e5+7; int ans[N], a[N], b[N]; vector<int> v[N]; int main(){ int t, n, x; scanf("%d", &t); for(int c = 1;c <= t;c++){ map<int, int> mp; scanf("%d", &n); for(int i = 1;i <= n;i++){ ans[i] = ...
ALGO
0.999932
3.892722
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-02-10T04:59:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a91ec76153d4...
a0823c5b-3e59-48ef-80bf-b76f90485686
levendlee/data-structure-and-algorithms
c++/leetcode/0213-House_Robber_II-M.cpp
// 213 House Robber II // https://leetcode.com/problems/house-robber-ii // version: 1; create time: 2020-01-26 22:35:02; class Solution { public: int rob(vector<int>& nums) { const int n = nums.size(); if (n == 1) return nums[0]; int hpre2 = 0, hpre1 = 0; int pre2 = 0, pre1 = 0; ...
ALGO
0.99999
5.366805
{ "github_metadata": { "branch": "master", "commit_count": 629, "repo_created_at": "2019-10-19T19:03:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "38a45574...
940b62f8-02ae-40c6-bb47-2259fe9c865b
BalhegoJ/producaoaulas
algoritmos.I/Matrizes/exer4.cpp
/*4. Faça um algoritmo que leia uma matriz AnXm (1 ≤ n ≤ 15, 1 ≤ m ≤ 25) de números reais e: 1. gere uma matriz B que seja a matriz transposta de A; 2. verifique se a matriz A é simétrica (uma matriz é simétrica quando é quadrada e quando aji = aij). */ #include <iostream> using namespace std; int main() { int l...
ALGO
0.996865
5.015874
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2024-07-23T18:37: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": "bd228828ff8...
2d10a31c-1505-4ae7-a733-94d81f79775e
ict-oop-2022/NazarkinIvan-Homework01
labs_src/lab1/lab1_functions.h
#pragma once #include <cmath> #include <limits> //точка на плоскости class Point { private: double x, y; public: //конструкторы Point() { x = y = 0; } Point(double x, double y) { this->x = x; this->y = y; } //конструктор копирования Point(const Point& p) { *this = p; } //оператор присваивания P...
ALGO
0.902325
4.809528
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-10-02T18:07:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1bb6d18832fd3...
288ba7a0-b3b0-4e1a-b917-1078245ba20d
340StarObserver/gobang
Classes/Gobang.h
#ifndef Kirito_Gobang_h #define Kirito_Gobang_h namespace Obito { class Gobang { private: enum //类中常量 { m_vacant=8, //空位 所使用的ASCIi码 m_black=4, //黑棋 所使用的ASCIi码 m_white=79, //白棋 所使用的ASCIi码 m_M=15 //默认棋盘规格是15*15 }; private: char m_qipan[m_M][m_M]; //棋盘 double m_computer[m...
ALGO
0.997162
4.735913
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-05-30T08:54: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": "58ecedf9f6...
3cd0606f-ac9e-4785-92c8-3edd19d268c7
jerryxu20/kattis
svada.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<int> vi; typedef vector<ld> vld; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; typedef...
ALGO
0.999984
4.019118
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2023-01-10T02:04: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": "bc1497d9c1c...
7fec902b-96ad-4ffa-b3f6-0cc64b2b83fa
ValveSoftware/openvr
src/vrcore/vrpathregistry_public.cpp
//========= Copyright Valve Corporation ============// #include <vrcore/vrpathregistry_public.h> #include <json/json.h> #include <vrcore/pathtools_public.h> #include <vrcore/envvartools_public.h> #include <vrcore/strtools_public.h> #include <vrcore/dirtools_public.h> #if defined( WIN32 ) #include <windows.h> #include...
TOOL
0.986416
6.73623
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2015-04-20T22:08:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6336, "forks": 1294, "issues": 1004, "pull_requests": 45 }, "file_meta": { "content_id": "...
319376fd-5140-4fc5-b1a6-e540d74b02ee
znxuz/leetcode
cpp/mergeTwoSortedLists/solution.cpp
#include <iostream> #include <vector> #include "ListNode.h" using namespace std; class Solution { public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { if (!l1 && !l2) return nullptr; if (!l1) return l2; if (!l2) ...
ALGO
0.999977
5.631601
{ "github_metadata": { "branch": "main", "commit_count": 861, "repo_created_at": "2021-12-01T14:20: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": "a292a8e86a...
ae59f048-14ec-49a2-8eb8-f68c37ad2f45
Affordan/dataStructure
homework/course2_orderedList/radixSort.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int maxBit(const vector<int>& v) { auto maxv = *max_element(v.begin(), v.end()); int cnt = 0; while (maxv != 0) { maxv /= 10; cnt++; } return cnt; } void RadixSort(vector<int>& v) { int d = maxBit(v); int size = v.size(); i...
ALGO
0.999931
5.008375
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-09-05T00:13: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": "f830471bf49c...
2d44973e-d791-45a6-957b-8f4534c73f96
Ankit-Rautela/DSA
Array/06_Problem.cpp
#include <bits/stdc++.h> using namespace std; /* Approach 1: class Solution{ public: //Function to return the count of number of elements in union of two arrays. int doUnion(int a[], int n, int b[], int m) { set<int> result; int count = 0; for(int i = 0; i < n; i...
ALGO
0.999968
4.534507
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-05-12T05:20: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": "3ca195b3172...
fff0909c-6abb-4791-b43c-d5100a6408b2
shibisuriya/dsa
stl/sort/comparator_functions_4.cpp
#include <bits/stdc++.h> using namespace std; bool should_i_swap(pair<int, int> a, pair<int, int> b) { // if you want to swap the elements then return 'false', if you don't want // to swap then return true. // Instead of thinking about returning a boolean, think about returning a condition / express...
ALGO
0.999918
5.115604
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2023-03-03T04:28:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c63de3e7...
1708adfa-db03-498b-9e3b-96d50d2a860b
goodstudyqaq/ACM
codeforces/1600-1699/1671/C.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "copypaste/debug.h" #else #define debug(...) 42 #endif #define endl '\n' struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); }; } fast_ios_; void solve() ...
ALGO
0.999939
5.575214
{ "github_metadata": { "branch": "main", "commit_count": 844, "repo_created_at": "2021-05-25T15:11:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c96f5418b...
a7b9312b-89fb-42b5-a5a5-75f644ea1c95
snape-here/Data-Structures-and-Algorithms-Coursera-Solutions
Algorithmic Tollbox/Week 4/num_of_inversions.cpp
#include<bits/stdc++.h> using namespace std; #define ull unsigned long long #define int long long #define ld long double #define pb push_back #define pi pair< int,int > #define ff first #define ss second #define mod 1000000007 #define inf 300000000000000007 #define endl "\n" const int N = 1e5+5; int a[N]; int b[N...
ALGO
0.999977
4.520944
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-09-30T13:45:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd9877ac40...
60e3ec3b-0b54-4e50-ab71-2608b2151c8e
Prakash-Jha-Dev/Snippets
test/prime_factor.cpp
#pragma comment(linker,"/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,tune=native") #define FOR(i,s,n) for(auto i = s; i != n; i++) #define FORR(i,s,n) for(auto i = n; i != s; i--) #define MOD 1000000007 #include <bits/stdc++.h> std::mt19937 rng(std::chrono::...
ALGO
0.998769
4.563369
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-12-13T15:54:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "702d4cb62f1e...
27a30b73-3ab8-4abd-8db8-437112955eb8
fei0227/cpp
MatrixChainOrder/MatrixChainOrder/main.cpp
// // main.cpp // MatrixChainOrder // // 矩阵链最优括号化 // Created by 费雄君 on 2020/5/12. // Copyright © 2020 WUST. All rights reserved. // #include <iostream> #include <vector> using namespace std; /* 功能:矩阵链最优括号化 输入: matrix_chain:矩阵链 position:最优括号位置信息 */ void matrix_cahin_order(vector<int> ...
ALGO
0.999934
4.147711
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-05-18T09:54: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": "6cef93d926...
e8abac99-bfdd-480e-80d0-cfb4a75d963a
ehdnd/SCCC
BOJ/implementation/17144_fail.cpp
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; int R, C, T; int robot_r1, robot_r2; int curr_map[50][50], next_map[50][50]; inline bool CheckMapBoundary(int x, int y) { return 0 <= x && x < R && 0 <= y && y < C; } void Input() { for (int i = 0; i < R; i++) { for (int j = 0; j < C; ...
ALGO
0.999892
4.735485
{ "github_metadata": { "branch": "main", "commit_count": 553, "repo_created_at": "2024-09-15T14:43: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": "3b2a41322c...
5adbc03a-c340-441f-bee9-ce99427590d4
LoghinVladDev/GPC_21
freeglut/t5/main.cpp
#include <GL/glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <assert.h> #include <float.h> // dimensiunea ferestrei in pixeli #define dim 300 // numarul maxim de iteratii pentru testarea apartenentei la mult.Julia-Fatou #define NRITER_JF 5000 // modulul maxim pentru testarea apartenentei la ...
ALGO
0.998549
4.703192
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-02-18T21:46:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "22312ba168...
e2286865-5ce7-46b6-b15e-5859fff74b88
SeungbeenLee/baekjoonbabo
greedy/bj1049.cpp
#include <iostream> #include <utility> using namespace std; int N, M; int package[51]; int one[51]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for (int i=0;i<M;i++) cin >> package[i] >> one[i]; int pm = package[0], om = one[0]; for (int i=0;i<M;i++) { ...
ALGO
0.999907
3.523934
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2024-02-22T09:08: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": "862f68877...
8c61cd95-d2df-40f5-9556-1f5905cb8b6d
GabrielLowden/DataStructuresPractice
BinarySearchTree/BST_basic/BST_basic/main.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; struct Node { //define node properties int key; Node* left; Node* right; //constructor Node(int item) { key = item; left = right = NULL; } }; //A helper function to insert a new node Node* insert(Node* node, int key) { //endcas...
ALGO
0.999981
4.871161
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-06-01T20:00:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d914c5a0a505...
4366a448-ff79-4229-96b6-ecc7c524c39d
ishandutta2007/codeforces-m
mateusz/normal/1399/C.cpp
#include <bits/stdc++.h> using namespace std; template <class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";} template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while(*sdbg!=',') cerr<<*sdbg++; cerr<<"="<<h<<","; _dbg(sdbg+1, a...); } template<class T> ostream & ...
ALGO
0.999361
3.689388
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f2ea8d953e7...
f12bc5ac-6915-43b5-865a-e0801931ce55
Rajshah1103/DSALGO
BinaryTree(LoveBabbar)/st.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; class node{ public: int data; node*left; node*right; node(int d){ this->data = d; this->left = NULL; this->right = NULL; } }; node*insertIntoBST(node*root,int d){ if(root...
ALGO
0.999978
4.839731
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-12-26T09:35:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec0d80b42d...
20411bbe-c838-4bf1-813b-d6a83223af57
MayurBatave/DSA-IN-CPP
8. pattern_2/StarPyramid.cpp
// Enter the number : 4 // * // *** // ***** // ******* // METHOD - > 1 // #include<iostream> // using namespace std; // int main(){ // int n ; // cout<<" Enter the number : "; // cin>>n; // int a=1; // for ( int i=1 ; i<=n ; i++){ // for ( int j=1 ; j<=n-i ; j++){ // ...
ALGO
0.999952
4.235488
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-21T13:28: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": "412000d09c18...
1ddd662d-26d1-4045-aea0-11202aac2fd2
trueos/trueos-ports
archivers/par2cmdline/files/patch-reedsolomon.cpp
--- reedsolomon.cpp.orig 2003-05-26 18:01:31 UTC +++ reedsolomon.cpp @@ -51,7 +51,7 @@ u32 gcd(u32 a, u32 b) } } -bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present) +template<> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present) { inputcount = (u32)present.size(); @@ -80,7 +80,7 @...
ALGO
0.999655
6.793123
{ "github_metadata": { "branch": "trueos-master", "commit_count": 515761, "repo_created_at": "2018-04-08T00:26:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14, "forks": 13, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id"...
ee6c2a6a-56e3-48bd-8885-135990333653
alexdimitrov18/SDP-personal
Дървета/16haspathsum.cpp
#include <iostream> using namespace std; struct BSTNode { int data; BSTNode* left; BSTNode* right; }; void inOrder(BSTNode* root) { if (root==nullptr) return; inOrder(root->left); cout << root->data << " "; inOrder(root->right); } bool hasPathSum(BSTNode* root , int sum) { if (root== nullptr...
ALGO
0.999896
4.578648
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-07-02T20:14: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": "9f8fa2fa90...
28e1beab-75bf-4406-8a88-18b854366cd5
cadenroberts/collegeCEprojects
West Valley College & Mission College/CIST004B/CIST004B_HW1/CIST004B_HW1_CODING/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <numeric> // create functions void MinMaxMeanMedianMode(std::vector<int> list) { // sort list to calculate min and max std::sort(list.begin(), list.end()); std::cout << "\nThe list of numbers has the following characteristics:\nThe Minimum is : " <...
ALGO
0.995413
4.653608
{ "github_metadata": { "branch": "main", "commit_count": 142, "repo_created_at": "2024-09-15T01:21: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": "9d8a2736cb...
e09db2a7-37f4-419d-933b-6b051f7aa8bd
jose-dom/bitcoin_forecasting
env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/prim/mat/fun/acosh.hpp
#ifndef STAN_MATH_PRIM_MAT_FUN_ACOSH_HPP #define STAN_MATH_PRIM_MAT_FUN_ACOSH_HPP #include <stan/math/prim/mat/vectorize/apply_scalar_unary.hpp> #include <stan/math/prim/scal/fun/acosh.hpp> namespace stan { namespace math { /** * Structure to wrap acosh() so it can be vectorized. */ struct acosh_fun { /** * R...
ALGO
0.905133
6.324305
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-01-04T01:45:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 12, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "cfb006a8...
79deb420-66b1-48fa-8e00-f61f03b34074
guimafelipe/codeforces_codes
1291/C.cpp
#include <bits/stdc++.h> using namespace std; #define INF 1000000000 #define INFLL 0x3f3f3f3f3f3f3f3fLL #define EPS 10e-9 #define MOD 1000000007 #define mp make_pair #define mt make_tuple #define pb push_back #define st first #define nd second #define sz(v) int(v.size()) #define all(X) (X).begin(), (X).end() #define...
ALGO
0.999956
4.310232
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-11-14T02:40:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c710f67b0...
07054f3d-594f-4d6f-a22d-11f19cc1ea6f
jeffmeoi/Calculator
Calculator/Calculator.cpp
/* * Project:Integer Calculator * Date:2018/7/20 Time:14:55. * author:Jeffmeoi. * 这里记录一下坑, * 坑1:UI * 坑2:Unicode * 坑3:异常处理 * END */ #include"stdafx.h" #include<cstdio> #include<iostream> #include<stack> #include<cctype> #include<cstring> #define maxn 100001 using namespace std; char str[maxn], str2[maxn]; int cur, le...
ALGO
0.999281
3.407277
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-07-19T17:49: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": "b864dcd242...
04c218bd-06e1-44d7-a0a5-97d4aac42b00
Xilinx/Vitis-AI
src/vai_library/math/test/prototype_8bit_to_4bit.cpp
/* * Copyright 2022-2023 Advanced Micro Devices Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
ALGO
0.901091
5.604543
{ "github_metadata": { "branch": "master", "commit_count": 1253, "repo_created_at": "2019-10-16T21:41:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1631, "forks": 649, "issues": 340, "pull_requests": 75 }, "file_meta": { "content_id": "...
5dd0c5c9-c277-43c7-8544-c204c35d88d2
rusuraluca/dsa-highschool
variante-bac-rezolvate/2009/v5/4.cpp
/* Subprogramul f, cu un parametru: - primeşte prin intermediul parametrului a un număr natural cu cel mult 8 cifre (a>1); - returnează cel mai mic divizor prim al valorii parametrului a. Exemplu: pentru valoarea 45 a parametrului a, subprogramul va returna valoarea 3 deoarece a=32 *5, iar cel mai mic divizor prim al s...
ALGO
0.999416
4.288657
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2021-01-28T13:36: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": "e141976dee6...
ece0b975-11df-43de-b479-818c03f9c17e
lihuibit/coding-algorithms
introduction-of-algorithms/Chapter_6/PriorityQueue.h
#ifndef _PRIORITY_QUEUE_H_ #define _PRIORITY_QUEUE_H_ /************************************************************************/ /* priority queue /************************************************************************/ class PriorityQueue { public: ...
ALGO
0.999458
4.289246
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2020-05-13T06:46:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "39c7ae491...
4eb24180-b652-4ccd-a976-6ce1f0aae93f
GeeTansher/VisualStudioCodePrograms
CandC++Programs/StriverSdeSheetANDImportantQuestions/reverseNodesinKgroups.cpp
// Recursion int lengthLL(ListNode *head) { ListNode *temp = head; int len = 0; while (temp != NULL) { temp = temp->next; len++; } return len; } ListNode *revKgroups(ListNode *head, int k, int len) { if (len < k) return head; ListNode *prev = NULL; ListNode...
ALGO
0.999993
5.446616
{ "github_metadata": { "branch": "main", "commit_count": 110, "repo_created_at": "2021-12-17T18:43: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": "db1a7dc9d7...
b43ce1a5-c394-42e5-9fc3-919767e335e3
kisho1131/Interview-Preperation
Heaps/kthSmallest.cpp
#include <bits/stdc++.h> using namespace std; /*===========Your Code Here=============*/ int KthSmallest(int *arr, int n, int k) { priority_queue<int> maxHeap; for (int i = 0; i < n; i++) { maxHeap.push(arr[i]); if (maxHeap.size() > k) maxHeap.pop(); } return maxHeap.top(); } void kLargest(int *a...
ALGO
0.999922
5.309395
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2021-10-03T07:38: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": "a9c7b3dfb29...
b16f7441-0b61-4cab-9f63-07fbeaf77555
alexandraback/datacollection
solutions_5686275109552128_0/C++/treebeard/IHOP.cpp
/* * ============================================================================= * * Filename: IHOP.cpp * * Description: Infinite House of Pancakes * * Created: 04/10/2015 11:59:24 PM * Compiler: gcc/g++ * * Author: <NAME> (llwu), <EMAIL> * Organization: Massachusetts ...
ALGO
0.999607
4.015019
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7a4afe35...
3dad09cc-9fc6-4fb6-b396-d6833466c5a2
Tribushkov/some-data-structures
partition.cpp
// Возвращает индекс опорного элемента. begin и end включительно. begin <= end. // Опорный - последний. int Partition( vector<int>& arr, int begin, int end ) { assert( begin <= end ); assert( begin >= 0 && end + 1 <= static_cast<int>( arr.size() ) ); if( begin == end ) { return begin; } int pivot = arr[end]; in...
ALGO
0.996549
5.504376
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-11-25T20:58: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": "5746caf335...
a7a1a16e-8b5a-4cf5-95af-22cc0d8d8f1a
tblommel/NEdyson
src/molNEsim_decomp_spin_impl.h
// // Created by tblommel on 6/8/20 // #ifndef NE_SIMULATION_DECOMP_SPIN_IMPL_H #define NE_SIMULATION_DECOMP_SPIN_IMPL_H #include <fstream> #include <boost/math/special_functions/chebyshev.hpp> namespace NEdyson { template <typename Repr> DecompSpinSimulation<Repr>::DecompSpinSimulation(const gfmol::HartreeFock &hf...
ALGO
0.999175
4.714977
{ "github_metadata": { "branch": "master", "commit_count": 138, "repo_created_at": "2020-04-22T13:34:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95134a2a...
69624af0-74ff-4951-97ba-23843760f964
VinhTungg/PTIT_DSA
DSA01016 - PHAN TICH SO 1.cpp
#include <bits/stdc++.h> #define ll long long #define foru(i,a,b) for(int i = a; i <= b; ++i) #define ford(i,a,b) for(int i = a; i >= b; --i) #define boost ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define pb push_back #define mk make_pair #define fi first #define se second #define endl "\n" #define sz size #de...
ALGO
0.999478
4.900682
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-04-05T08:06:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9b6bcf78bfd...
57c5591c-556d-4476-af59-5c5b69cc4063
RentoYabuki06/atcoder
bunyabetsu-150/04_DP/050_RevengOfTravelingSalesmanProblem.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; ll N, M; ll dp[1 << 16][16]; ll cnt[1 << 16][16]; const ll INF = 1e18; struct Edge { ll to; ll dist; ll time; Edge (ll to, ll dist, ll time) : to(to), dist(dist), time(time) {} }; int main() { ci...
ALGO
0.999816
4.495796
{ "github_metadata": { "branch": "main", "commit_count": 192, "repo_created_at": "2024-03-31T03:08:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "003e031183...
61c18169-f1af-4350-8982-f1413d15a64c
wangzheng0822/algo
c-cpp/06_linkedlist/palindromeList/LinkedList.hpp
/** * Author: TripleZ<<EMAIL>> * Date: 2018-10-10 * Brief: Linked list class. */ #ifndef _LINKEDLIST_HPP_ #define _LINKEDLIST_HPP_ #include <cstdio> #include "ListNode.hpp" class LinkedList { public: int size; int length; ListNode *head; LinkedList(); LinkedList(int size); ~LinkedLi...
TOOL
0.973732
5.155976
{ "github_metadata": { "branch": "master", "commit_count": 1065, "repo_created_at": "2018-09-24T05:33:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23122, "forks": 7051, "issues": 104, "pull_requests": 54 }, "file_meta": { "content_id"...
f34a02cb-be64-423c-9e40-8bba416ff076
shibaozhang95/datastructure
datastructure/graph.h
// // graph.h // datastructure // // Created by 张世宝 on 5/5/15. // Copyright (c) 2015 张世宝. All rights reserved. // #ifndef datastructure_graph_h #define datastructure_graph_h #include "linklist.h" #define VISITED 1 #define UNVISITED 0 #define INFINITY 0xffffff // Graph abstract class. This ADT assumes that the n...
ALGO
0.957714
4.10607
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2014-05-19T08:53:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "055a370de...
c7102888-7459-462d-8288-fb31dbf1571e
allenhyp/LeetCodePractice
143_Reorder_List.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void reorderList(ListNode* head) { if (head == NULL || head->next == NULL || head->next->next == NULL) return; ListN...
ALGO
0.999993
6.356934
{ "github_metadata": { "branch": "master", "commit_count": 906, "repo_created_at": "2017-05-07T10:46: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": "8b06cb1d...
d661b47c-b5d8-4e1f-9b99-98e67c761cb8
0binn/Algorithm
백준/Gold/2573. 빙산/빙산.cc
#include <iostream> #include <vector> #include <queue> #include <algorithm> #include <cstring> #define MAX 300 using namespace std; int ice[MAX][MAX]; bool visited[MAX][MAX]; int N, M; int dx[4] = { -1,1,0,0 }; //상하좌우 int dy[4] = { 0,0,-1,1 }; int max_ice = 0; void BFS(int x, int y) { queue <pair<int, int>> q; visit...
ALGO
0.999994
3.626335
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2023-03-22T17:12:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9af14e3da5...
821e2ae4-a031-48b2-8fa9-512594b4b6a5
allenanswerzq/byteme
old/codeforces/round-543/a/a.cpp
//============================================================================ // Name : a // Date : Sat Mar 9 21:14:43 CST 2019 // Author : landcold7 // Description : Actions speak louder more than words //============================================================================ #include "bits/s...
ALGO
0.999922
3.773674
{ "github_metadata": { "branch": "master", "commit_count": 810, "repo_created_at": "2017-06-16T09:27:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad0b62ed...
57522e5c-ff5d-4eab-bff6-ff7e83e40030
Ewenwan/MVision
vSLAM/ch8/LKFlow/useLK.cpp
/* * LK光流法跟踪特征点 * ./useLK ../../data * * 1】灰度不变假设 * I(x+dx, y+dy, t+dt) = I(x, y, t) 同一个空间点的像素灰度值 在各个时间点的图像上是固定不变的 假设 * 泰勒展开 I(x+dx, y+dy, t+dt) = I(x, y, t) + I对x的偏导数 * dx + I对y的偏导数 * dy + I对t的偏导数 * dt = I(x, y, t) * 得到 I对x的偏导数 * dx + I对y的偏导数 * dy + I对t的偏导数 * dt = 0 * 两边同时除以 dt 得到 * I对x的偏导数 * dx/...
ALGO
0.998268
4.637211
{ "github_metadata": { "branch": "master", "commit_count": 3396, "repo_created_at": "2017-09-24T06:25:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8384, "forks": 2800, "issues": 17, "pull_requests": 2 }, "file_meta": { "content_id": "...
508eaf43-04d6-4ae1-be7b-eb04eb99986f
alexandraback/datacollection
solutions_5658571765186560_0/C++/Krystal0501/d.cpp
#include <iostream> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; ++i) { int x, r, c; int result; cin >> x >> r >> c; if (r * c % x != 0) { result = 0; // Richard win } else { if (x == 1 || x == 2) { result = 1; // Gabriel win } else if (x >= 7) ...
ALGO
0.999957
3.696044
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5aebee10...
005c512c-2166-4aa0-bbd6-843fcf5511dc
ishandutta2007/codeforces-h
hongzy/normal/1451/A.cpp
#include <bits/stdc++.h> #define rep(i, j, k) for(int i = j; i <= k; ++ i) #define per(i, j, k) for(int i = j; i >= k; -- i) using namespace std; #define fs first #define sc second #define pb push_back #define mp make_pair #define eb emplace_back typedef double db; typedef long long ll; typedef long double ldb; typed...
ALGO
0.999803
3.546354
{ "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": "bc371e51ed41...
9dfa7c74-cd05-4373-b2e6-15e87c42bc21
OwenOwl/IOI2020Homework
试题泛做/AGC029F.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 500015; const int INF = (int) 1e9; int e_num = 1, S, T; int hed[maxn], dep[maxn]; struct Edge { int from, to, nxt, c; } edge[maxn * 4]; void addedge(int from, int to, int c) { edge[++e_num] = (Edge){from, to, hed[from], c}; hed[from] = e_num; } void ...
ALGO
0.999583
3.683505
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2019-10-18T01:03:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2381a2b9...
bb46e074-79fc-484a-8f57-4fbbace23754
abdulkhaleq24/Basic-Data-Structures
module 24 Final Exam/Give_Current_Max.cpp
#include <bits/stdc++.h> using namespace std; class Student{ public: string name; int roll; int marks; Student(string name, int roll, int marks){ this->name = name; this->roll = roll; this->marks = marks; } }; class cmp{ public: bool operator()(Student a, S...
ALGO
0.999744
4.150501
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-09-14T08:11: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": "db5abca33a50...
b1d4453e-7681-4467-9a89-31459ed30496
tianxiejack/qr_pro_360pano_main
src/mov/src/BGFGTrack.cpp
#include <stdio.h> #include <stdlib.h> #include "BGFGTrack.hpp" #include "psJudge.h" CBGFGTracker::CBGFGTracker() { m_pKalmanProc = NULL; m_bInited =FALSE; m_pMeasure = NULL; m_pControl = NULL; memset(m_warnTarget, 0x00, sizeof(TRK_RECT_INFO)*SAMPLE_NUMBER); memset(m_warnTargetBK, 0x00, sizeof(TRK_RECT_INFO)*SAM...
ALGO
0.996563
4.630575
{ "github_metadata": { "branch": "master", "commit_count": 112, "repo_created_at": "2019-06-11T10:19:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f100650...
5ffa1b11-46ca-4b50-9f8f-7b201e562333
jjuiddong/OpenCV-Practice
Src/3DGraphic/3DGraphic/main.cpp
#include <iostream> #include <string> #include <opencv.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #ifdef _DEBUG #pragma comment(lib, "opencv_core310d.lib") #pragma comment(lib, "opencv_imgcodecs310d.lib") // #pragma comment(lib, "opencv_features2d310d.lib") #pragma comment(lib, "ope...
ALGO
0.929345
4.07549
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-08-29T07:28:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "419a3a6d2d...
d909211a-c09b-438a-82e0-fa9461466509
NairongZheng/learning
lc/cpp/array/array2_lc5_star.cpp
/* 最长回文子串 给你一个字符串 s,找到 s 中最长的回文子串。 思路: 要是两个for循环的方法,复杂度太高 找回文串的难点在于,回文串的的长度可能是奇数也可能是偶数,解决该问题的核心是从中心向两端扩散的双指针技巧。 如果回文串的长度为奇数,则它有一个中心字符;如果回文串的长度为偶数,则可以认为它有两个中心字符。 (判读回文串是从两边向中间搜索,找回文串是从中心向两边展开) */ #include <iostream> #include <string> using namespace std; string palindrome(string s, int l, ...
ALGO
0.999866
5.482227
{ "github_metadata": { "branch": "main", "commit_count": 185, "repo_created_at": "2022-06-12T09:31:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b602383bd...
fd614c8e-647d-41ee-b798-0c74e8eaa69a
DudekulaRaheem/Csa5149cryptography
40 MC.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ALPHABET_SIZE 26 #define MAX_TEXT_LENGTH 1000 const float english_freq[ALPHABET_SIZE] = { 0.082, 0.015, 0.028, 0.043, 0.127, 0.022, 0.020, 0.061, 0.070, 0.002, 0.008, 0.040, 0.024, 0.067, 0.075, 0.019, 0.001, 0.060, 0.063, 0.091, 0.028, 0....
ALGO
0.999959
4.99771
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-07-18T06:59: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": "cdb260964d31...
b743e52c-ec4c-4516-a7fd-2748ae7fca74
tempure/algorithm-advance
OJ/acwing/第44场周赛/b.cpp
#include <iostream> #include <cstring> #include <algorithm> using namespace std; /* 1.不能成环 也就是走过的不能再走 不然不是最短路 2.不能走到已经走过的相邻的格子旁边的位置 不然不是最短(注意特判反方向走来时候刚经过的格子) */ const int N = 210, B = N / 2; int dx[4] = { -1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; bool st[N][N]; int get(char c) { if (c == 'U') return 0; if (c ==...
ALGO
0.999982
4.165462
{ "github_metadata": { "branch": "master", "commit_count": 1297, "repo_created_at": "2020-11-16T08:58:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ceef958...
9f04d3c5-2f84-4ebb-bfef-2dd3ec303829
miozpolat/Delay-Comparision-of-HomePlug-GP-CAN-M-CAN-and-LIN
HomePlugGP-CAN style contention/Node.h
// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it wil...
TOOL
0.968816
3.656969
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-10-27T15:35:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f64c243a6...
09ed69ff-21f7-4f3c-8d91-9071b0b787a1
sevas/camera_geometry
cpp/src/cg_scalar.cpp
#include "cg_scalar.h" namespace cg { void project_points_cpu(const std::vector<float>& xs, const std::vector<float>& ys, const std::vector<float>& zs, std::vector<float>& us, std::vector<float>& vs, const camera_intrinsics& intrinsics) { const int n = static_cast<int>(xs.size()); for (int i = 0; i < n...
ALGO
0.918328
5.731364
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2022-07-31T15:28: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": "44e37c1a644...
4bcd6b64-435d-4aed-b746-fd2702ca968f
soniasingh98/Dynamic-Programming
23_LongestCommonSubsequence.cpp
#include <bits/stdc++.h> using namespace std; // Memoization class Solution { public: int longestCommonSubsequence(string text1, string text2) { int n = text1.size(), m = text2.size(); vector<vector<int>> dp(n, vector<int>(m, -1)); return lcs(text1, text2, n - 1, m - 1, dp); } ...
ALGO
0.999989
6.1414
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-07-18T21:19: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": "a197fdeb416f...
fd0ba55a-4c04-42c5-aac5-7ff6207ad6a7
Marcux777/Programacao_Competitiva
CSES/Tree Algorithms/Tree Distances II.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int int n; vector<vector<int>> graph; vector<ll> subTree, dist; void dfsa(int v, int parent) { subTree[v] = 1; for (auto u : graph[v]) { if (u != parent) { dfsa(u, v); subTree[v] += subTree[u]; // ...
ALGO
0.999969
4.564385
{ "github_metadata": { "branch": "main", "commit_count": 249, "repo_created_at": "2023-03-14T16:35: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": "68e4acf13b...
b8384c25-e412-4c2a-b899-f339906ddaa8
neri-2/TIL
algorithm/BAEKJOON/4963.cpp
#include <iostream> #include <vector> // #4963 섬의 개수 using namespace std; // 8방향 이동 배열 const int WAY[8][2] = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 }, { -1, 1 }, { -1, -1 }, { 1, -1 }, { 1, 1 } }; void dfs(int w, int h, int y, int x, vector<vector<bool>> m, vector<vector<bool>> &c) { // 인접한 땅 체크 c[y][x] = true; ...
ALGO
0.999922
4.625959
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2021-04-25T14:18: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": "042ecef234e...
6ac93a10-976d-4732-a871-9c945b80bb2e
Jack1eNgBaro/JustCp
CodeForces/C++17 (GCC 7-32)/1333C | Eugene and an array/196273767.cpp
/* "There is no light without dark There is no joy without pain You can't have a rainbow without a little rain" ~ <NAME> */ #include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define bit(x, i) ((x >> i) & 1) const int mod = 1e9 + 7; const int maxn = 1e6; ...
ALGO
0.999798
3.644116
{ "github_metadata": { "branch": "main", "commit_count": 896, "repo_created_at": "2024-06-16T11:06: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": "9e41f5b9b9...
45120293-36aa-4164-8995-09a6156e4d26
bilbo3000/coding
leetcode/interleaving_string_dp/InterleavingStringDP.cpp
class Solution { public: bool isInterleave(string s1, string s2, string s3) { int size1 = s1.size(); int size2 = s2.size(); int size3 = s3.size(); if (size1 + size2 != size3) return false; vector<vector<bool> > T; for (int i = 0; i <= s...
ALGO
0.999114
5.906988
{ "github_metadata": { "branch": "master", "commit_count": 981, "repo_created_at": "2014-03-08T03:04:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0673052a...
d44a2968-1afd-4e35-ac60-2a4b95b38593
luisademelo14/Lib-das-lindas
codeforces/dynamic-programming/product-sum.cpp
//#include <bits/stdc++.h> #include <iostream> #define int long long #define MAXN (int) (1e6 + 10) #define all(x) x.begin(), x.end() #define ii pair<int, int> #define esq(x) (x<<1) #define dir(x) ((x<<1)|1) #define MOD (int) (1e9 + 7) using namespace std; struct Func { int a, b; int val(int x) { return a*x + b; ...
ALGO
0.999555
3.467403
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2025-02-03T16:52: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": "25954efb387...
cfb2532a-a497-434b-96c2-4eda464f9a1a
ishandutta2007/codeforces-z
ztxz16/normal/392/D.cpp
#include <cstdio> #include <cstdlib> #include <algorithm> #include <map> using namespace std; const int N = 100005; const int INF = 1000000000; int left[N << 2], right[N << 2], tag[N << 2], minValue[N << 2], leftValue[N << 2]; int n, a[N], b[N], c[N], val[N]; map <int, int> setA, setB, setC; void make(int l, int r,...
ALGO
0.999899
3.90978
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:43: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": "f309ee78fb66...
5b6a3acf-480b-4b36-aa71-23e783bba631
nicoblon/Segway
Segway/functions.ino
#include "config.h" //basic sign function, it returns 1 if x is positive, and -1 if not. int sgn(int x){ if (x >= 0){ return 1; }else{ return -1; } } // Functions that transform the accelerometer output into degrees void quaternionToEuler(float qr, float qi, float qj, float qk, euler_t* ypr, b...
ALGO
0.969725
4.522098
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2025-04-11T12:19: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": "b7eac9f8eed...
c66dd9d2-0667-43e7-b3b1-b0682a60c21d
CTRLHyeon/BackJoonMySolved
백준/Gold/1976. 여행 가자/여행 가자.cc
#include <iostream> #include <vector> #include <stack> #include <queue> #include <algorithm> #include <math.h> #include <string.h> #include <string> #include <limits.h> using namespace std; vector<int> parent(201); vector<vector<int>> map(201, vector<int>(201, 0)); int find(int x) { if (parent[x] == x) return x; re...
ALGO
0.999998
4.650651
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2024-11-11T13:01:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4910c70dd...
bc29810c-8925-4c02-ba11-e91b0557f6f3
Zimse12345/Code
pyyz_Contest/20230317省选模拟赛/cut_bf.cpp
/******************** *FileName: *Author: Zimse *Data: 2023-03- *Description: ********************/ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #defi...
ALGO
0.999978
4.714789
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2022-10-08T03:09:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "844c6307234...
c3882e4e-57e7-4d6c-820e-fa9eaed441b5
Nuttadon/lab14
lab14_2.cpp
#include <iostream> #include <cmath> using namespace std; const int N = 30; const int M = 70; void updateImage(bool [][M],int,int,int); void showImage(const bool [][M]); int main() { bool image[N][M] = {}; int s,x,y; do{ showImage(image); cout << "Input your brush size and location: "; ...
ALGO
0.953447
3.562982
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2021-12-28T01:34:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0431483f6...
7df43227-0ea4-41b8-a3d2-edd00d04e8db
supereddek/SDIZO1
MyArray.cpp
// // Created by super on 10.05.2022. // #include "MyArray.h" #include <iostream> #include <cstdio> MyArray::MyArray() { data = nullptr; arrSize = 0; } MyArray::~MyArray() { free(data); data = nullptr; arrSize = 0; } void MyArray::reduce(bool isFirst) { if (arrSize == 0) return; size_t...
TOOL
0.988551
4.332554
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2022-05-25T21:09:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "22ce719a3e...
7981cd17-4cab-427d-8e1c-d0e4b5ceb20b
JReiss21/Cpp-Programming-Examples
Data Structures Project - Dynamic Programming Chomp Game/chompcount.cpp
// chompcount.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <fstream> #include <string> #include <vector> using namespace std; int main() { //opening input file ifstream inputFile; inputFile.open("input.txt", ios::in); //checkin...
ALGO
0.99955
4.28597
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2020-11-30T17:39: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": "c90b063218f...
3eeec80d-fa13-4708-b75e-dbab595e098f
mihirbajpai10/DSA
Reverseno.cpp
// reverse a number. #include<bits/stdc++.h> using namespace std; /*int reverse(int n) { while (n>0) { int rev = n % 10; n = n / 10; cout << rev; } } int main() { int n; cin >> n; reverse(n); }*/ // WAP to generate the reverse of a given no. N // Print the correspond...
ALGO
0.99987
4.506096
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-18T17:56:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7488870b3fe4...
d1123c6a-a7b3-4afa-a994-c966c8101931
Siyoung2da/Baekjoon
self_study/bj14502.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; int N, M; int map[9][9]; vector<pair<int, int> > zero_vec; queue<pair<int, int> > q; int ddx[4] = {-1, 1, 0, 0}; int ddy[4] = {0, 0, -1, 1}; int maxTotal = -1; bool visit[9][9]; void bfs() { int backup[9][9]; for ...
ALGO
0.999854
4.244893
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2022-03-18T06:44: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": "ada5cce36...