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
ac5a9874-68af-4682-a6e6-f45843dc90e6
ayushshaz/Competitive_Programming
template_codechef.cpp
#include<iostream> #include<iomanip> #include<algorithm> #include<math.h> #include<vector> #include<cstring> #include<chrono> #include<string> #include<bitset> #include<random> #include<utility> #include<set> #include<unordered_set> #include<list> #include<iterator> #include<deque> #include<queue> #include<stack> #incl...
ALGO
0.99974
4.000938
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-06-16T13:10: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": "77f31e7d1f2...
9492254f-6db8-4221-844d-63c89e0e5744
hPixal/aed
docs/Examenes/EXAM-2021/tpl3-2021-chk_hijos_mayores/eval.hpp
// GITVERSION: aed-2021-137-g25d89fc3 #ifndef EVAL_HPP #define EVAL_HPP #include "aedtools/evalbase.hpp" #include "aedtools/str_convs.hpp" #include <forward_list> #include <sstream> using namespace std; namespace aed { //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // FUNCTIONS FOR THIS EXAM //---:---<*...
ALGO
0.98595
4.56759
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2021-08-27T19:30:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e958fbe52...
40af2dab-5054-428e-a282-e77749e83a4c
shawntan/opencog
opencog/atomspace/FollowLink.h
/** * FollowLink.h * * Follow a link. Given an atom and a link type, follow the link and * and return another atom in the link. It is assumed that there is only * one link of the given type that is attached to the given atom; the * methods here return the first match found. If multiple-link support * is needed, ...
TOOL
0.994601
6.206613
{ "github_metadata": { "branch": "master", "commit_count": 8086, "repo_created_at": "2012-10-10T00:10:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f5894d...
c4002756-222b-46c3-876e-0e7396ef64cf
djakobovic/ECF
examples/NQueens/NQueensEvalOp.cpp
#include <ECF/ECF.h> #include "NQueensEvalOp.h" bool NQueensEvalOp::initialize(StateP state) { state_ = state; voidP sptr = state->getRegistry()->getEntry("Permutation.size"); int problemSize = *((int*) sptr.get()); // generate reusable objects from the original code problemInstance = ::newProblem(problemSize);...
ALGO
0.999626
5.132351
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2022-08-12T14:21:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "813288550...
4a10a889-c4a7-4fd4-8c84-92c5eda15ff4
hyunynim/Algorithm2019
Algorithm_2019/17836/tempCodeRunnerFile.cpp
#include<bits/stdc++.h> using namespace std; struct POS{ int x, y, g; }; int main(){ int n, m, t; scanf("%d %d %d", &n, &m, &t); int board[101][101]; for(int i = 0; i<n; ++i) for(int j = 0; j<m; ++j) scanf("%d", &board[i][j]); int chk[2][101][101]; memset(chk, 0x3f, sizeof(chk)); chk[0][0][0] = 0...
ALGO
0.999767
3.981823
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2019-01-15T13:55: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": "77bf2748c...
266f8560-fd0c-45c4-8913-5bdf53d36900
josedelinux/luogu
p/1k/1149/main.cpp
/* condition: cost[a]+cost[b]+cost[c]=n a+b=c todo 优化算法 */ #include <iostream> #define maxn 768 #define DEBUGn using namespace std; int cost[maxn] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; // construct cost after 9 inline void genCost(int n) { for (int i = 10; i < n; i++) cost[i] = cost[i % 10] + cost[i / 10]; } ...
ALGO
0.999535
3.824692
{ "github_metadata": { "branch": "main", "commit_count": 341, "repo_created_at": "2021-11-12T08:26: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": "2f41f8c1d3...
3fae51c6-fa51-442c-98aa-bb9335435695
alexandraback/datacollection
solutions_1595491_0/C++/daidailanlan/B.cpp
#include <cstdio> #include <algorithm> using namespace std; const int MAXN = 32; const int MAXM = 20; int n, s, p; bool valid[MAXN][MAXM], surprise[MAXN][MAXM], nonsurprise[MAXN][MAXM]; bool isValid(int a, int b, int c) { return c - a <= 2; } bool isSurprise(int a, int b, int c) { return c - a == 2; } void init(...
ALGO
0.999762
3.522628
{ "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": "911616d8a...
59b96213-aef6-4892-a553-fac0cd5979b9
hmwang2002/Algorithm-Learning
leetcode/leetcode-19.cpp
#include <bits/stdc++.h> using namespace std; /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ s...
ALGO
0.999989
5.777197
{ "github_metadata": { "branch": "master", "commit_count": 179, "repo_created_at": "2024-01-26T11:41:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e70d6d13...
7b49e189-ac15-4267-93af-f009ccb1f06c
ArhamUsman/OOP-Semester-2
Lab1/q5.cpp
/* Q5: Design Event Management System in C++ to facilitate the organization of events. The program should empower the user to seamlessly manage event details, including the event name, date, venue, and organizer. Incorporate key features such as the ability to add events, display comprehensive details of all events, an...
TOOL
0.911794
6.386626
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2025-03-08T18:55: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": "2112f4638f2...
669e52ae-0952-4ed3-8f62-f4c910a3871e
SnoopyCodes/code
contest/USACO/2025jan/fjfo.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #define rat order_of_key #define at find_by_order using namespace __gnu_pbds; template <class T> using iset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define long int64_t void solve() { ...
ALGO
0.999992
5.536543
{ "github_metadata": { "branch": "main", "commit_count": 264, "repo_created_at": "2024-04-06T21:09: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": "06d3c28f31...
d37a05fd-fb18-47f3-a6ad-841dd8ff8c2e
HitenDewangan/Competitive-Programming
C++/Arrays/longestSubarrayEqual0s1s.cpp
// have an array only 0's and 1's as elements, find max subarray length with equal 0 and 1 #include<iostream> #include<vector> #include<unordered_map> using namespace std; int maxLength_0(vector<int>& arr, int n) { // unordered_map<int, int> mp; // Map to store sum and its first occurrence index int maxLen = ...
ALGO
0.999991
4.537864
{ "github_metadata": { "branch": "main", "commit_count": 100, "repo_created_at": "2024-02-17T17:41: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": "0e45b110fb...
0feb6250-f4c4-435a-93ab-5c16cb875291
ishandutta2007/codeforces-s
sergeifedorov/normal/156/C.cpp
#include <cstdio> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <set> #include <map> #include <ctime> #include <cstring> #include <cassert> #include <sstream> using namespace std; #define forn(i, n) for(int i = 0; i < (int)(n); i++) #define ford(i, n) for(int i...
ALGO
0.999558
3.939831
{ "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": "6c3b63de3fbb...
b169268d-b4b9-4cb0-9329-549f20206cf4
BoGyuPark/VS_BOJ
2019_07/2019_07/BOJ_3085.cpp
/*BOJ 3085 사탕 게임*/ #include<iostream> #include<algorithm> using namespace std; int n, ans; char map[51][51]; void row_check(int row, int col, int flag) { int cnt = 1; for (int i = col; i < n - 1; i++) { if (map[row + flag][i] == map[row + flag][i + 1]) cnt++; else { ans = max(ans, cnt); cnt = 1; } ans =...
ALGO
0.999974
3.361033
{ "github_metadata": { "branch": "master", "commit_count": 129, "repo_created_at": "2019-01-02T14:17: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": "f5969403...
ec71cd1e-c1b9-4232-8bdb-7eb7e34e1e85
heavywatal/likeligrid
src/gridsearch.cpp
/*! @file gridsearch.cpp @brief Implementation of GridSearch class */ #include "gridsearch.hpp" #include "util.hpp" #include <wtl/exception.hpp> #include <wtl/debug.hpp> #include <wtl/iostr.hpp> #include <wtl/zlib.hpp> #include <wtl/numeric.hpp> #include <wtl/math.hpp> #include <wtl/concurrent.hpp> #include <wtl/i...
ALGO
0.998979
6.342878
{ "github_metadata": { "branch": "master", "commit_count": 363, "repo_created_at": "2016-09-12T12:18:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "11d5be59...
402e1468-8cd1-4c5a-b5c1-cf861bd40578
farroshsy/CodeConnoisseurs
E-Olymp/2586 - Dividing The Gold.cpp
#include <iostream> using namespace std; typedef long long ll; const ll mod = 1e6; ll n, sum, a[300], f[500005], dp[500005]; int main() { cin >> n; for(ll i = 1; i <= n; i++) cin >> a[i], sum += a[i]; for(ll i = 1; i <= n; i++) { for(ll j = sum/2; j >= a[i]; j--) f[j] = max(f[j],...
ALGO
0.999941
3.504811
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2022-07-04T13:12: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": "14c6bc17529...
45ec412f-816a-4261-800e-26062a988a06
vurusovs/openvino
src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp
// Copyright (C) 2022 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // /////////////////////////////////////////////////////////////////////////////////////////////////// #pragma once #include <vector> #include "ngraph/op/matrix_nms.hpp" #include "primitive.hpp" namespace cldnn { /// @addtogroup cpp_api C...
ALGO
0.996239
7.283753
{ "github_metadata": { "branch": "master", "commit_count": 8696, "repo_created_at": "2020-05-26T09:10:32.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "openvinotoolkit/openvino", "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "...
4b8a59a0-d18b-417b-a6db-5d55dfebfb4b
liangwg/codes
杭电oj题/water/杭电1082-矩阵连乘.cpp
//这题的收获就是1.学会运用了C++自带的stack库函数 //2.在写代码时,可以先把思路,接下来要写部分写出来,先把此处的算法弄清楚,接下来的就是翻译的事情了 //3.对于式子的运算顺序的处理,栈是一个很好的思想 /*1.声明一个stack stack<int> s1; stack<string> s2; 2.stack中的操作 stack<int> s; s.push(x) 无返回值,将元素x压栈 s.pop(); 退栈,无返回值 s.top(); 取栈顶元素,返回栈顶元素 ,只取不弹 s.empty(); 判断栈是否为空,如果是空,返回1,否则返回0 s.size()...
ALGO
0.999924
3.552714
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2017-05-18T10:07: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": "ab37d6980...
79fda7eb-1df9-4696-867e-42d21828db06
10946009/yuihuang_zj_ans
cpe-level-2/cpp/zj-d443.cpp
#include <iostream> #include <cstring> using namespace std; const int maxn = 2000; struct BigNum{ int len; int num[maxn]; BigNum(){ len = 0; memset(num, 0, sizeof(num)); } void delZero(){ while (len && num[len-1] == 0){ len--; } if (len...
ALGO
0.999895
3.90982
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-03-29T10:30: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": "b1fa41e840e...
25355141-75a1-44b6-acd2-fbb0a19a3c44
Mahanth-Maha/My_CPP
Competitive Programming/mod3_Array/Hard_3_3sum.cpp
#include "../display.h" #include <iostream> #include <algorithm> #include <vector> #include <set> #include <unordered_map> using namespace std; /* Given an array of N integers, your task is to find unique triplets that add up to give a sum of zero. In short, you need to return an array of all the unique triplets [a...
ALGO
0.999646
5.536791
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-04-29T03:37: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": "5ad04e2fc6f...
20b85bbf-4b12-456b-8e67-ecf076100543
VegetoNehra/BeginnerPrograms
C++/Basic Hash Function 1.cpp
#include <iostream> using namespace std; int main() { int n; // Number of elements in the array cin >> n; int array[n]; // Reading the array elements for (int i = 0; i < n; i++) { cin >> array[i]; } // Precompute elements frequency before call to record its frequency in array ...
ALGO
0.999715
5.338593
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2024-07-02T08:58: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": "1f29cfaa749...
57221c73-8570-4341-8f36-448e151f0e82
mdarikrayhan/Competitive-Programming
codeforces/985/E.cpp
#include <bits/stdc++.h> using namespace std; int n, k, d, a[500005], pf[500005]; bool can; main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> k >> d; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a + 1, a + 1 + n); pf[0] = 1; for (int i = 1, l = 1; i <= n; i++) { while (a[i] - a[l] > d) l++; if ...
ALGO
0.999981
4.061576
{ "github_metadata": { "branch": "master", "commit_count": 8052, "repo_created_at": "2022-05-15T11:22:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c7a69...
ebd230d5-c9b8-4df0-bafd-9cf42169311a
shubhi6/DSA_Problems_CPP
move_allzeroes_toend.cpp
// C++ implementation to move all zeroes at the end of array #include <iostream> using namespace std; // function to move all zeroes at the end of array void moveZerosToEnd(int arr[], int n) { // Count of non-zero elements int count = 0; // Traverse the array. If arr[i] is non-zero, then // update the value of ar...
ALGO
0.999881
5.508873
{ "github_metadata": { "branch": "main", "commit_count": 690, "repo_created_at": "2023-12-30T15:40:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c4019866d...
010fdaaf-5c1b-4d55-9687-501ac16fd869
RocYan98/PAT
A1056.cpp
#include <iostream> #include <queue> #include <algorithm> using namespace std; struct Player { int id, weight, turn, rank; } p[100010]; bool cmp(Player a, Player b) { return a.turn > b.turn; } bool cmp2(Player a, Player b) { return a.id < b.id; } int main() { int np, ng; queue<Player> que; ...
ALGO
0.999998
3.61375
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2020-03-21T15:30:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e161f42b4...
25902ede-557b-4780-9d5a-15d7d18eff23
google/gemma.cpp
backprop/common_scalar.h
// Copyright 2024 Google LLC // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless requ...
ALGO
0.963809
7.431176
{ "github_metadata": { "branch": "main", "commit_count": 585, "repo_created_at": "2024-02-13T04:36:03.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6506, "forks": 556, "issues": 11, "pull_requests": 12 }, "file_meta": { "content_id": "3260...
45efa065-32b5-4dc2-82fa-31f528c4338c
GambitBSM/gambit_1.0
contrib/Delphes-3.1.2/external/fastjet/plugins/ATLASCone/JetDistances.hh
//---------------------------------------------------------------------- // This file distributed with FastJet has been obtained from SpartyJet // v2.20.0 by <NAME>, <NAME>, Joey // Huston, <NAME> and <NAME> // For details, see http://www.pa.msu.edu/~huston/SpartyJet/ // http://projects.hepforge.org/sp...
ALGO
0.915839
6.407205
{ "github_metadata": { "branch": "release_1.0", "commit_count": 8272, "repo_created_at": "2017-05-23T22:47:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b...
5d9e2068-927c-483b-8bd9-f4f597cce82a
opueyociutad/PB-Procedural-Clouds
Nori2/src/direct_mis.cpp
#include <nori/warp.h> #include <nori/integrator.h> #include <nori/scene.h> #include <nori/emitter.h> #include <nori/bsdf.h> #include <sstream> #include <utility> NORI_NAMESPACE_BEGIN class DirectMIS : public Integrator { private: struct SamplingResults { Color3f L; float p_em; float p_mat; SamplingResults(...
ALGO
0.977042
6.246509
{ "github_metadata": { "branch": "main", "commit_count": 166, "repo_created_at": "2022-09-22T15:01:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f0592140d...
7af99823-cd18-4485-8f45-d6103553f9a9
Tencent/GameAISDK
Modules/boost/Windows/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST...
ALGO
0.916997
7.197151
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2020-08-13T06:50:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2384, "forks": 480, "issues": 38, "pull_requests": 0 }, "file_meta": { "content_id": "ed04...
bc53dd0a-2669-47ec-9d34-f37e28322855
marc-hanheide/cogx
planning/trunk/ayPlan/CostPlanner.hh
// Copyright (c) 2008 National ICT Australia Limited (NICTA) // // Author: <NAME> (<EMAIL>) // // Redistribution and use in source and binary forms, with or without // modification and only for non-commercial research and educational // purposes are permitted provided that the conditions in the // accompanying file "li...
ALGO
0.997699
6.205
{ "github_metadata": { "branch": "master", "commit_count": 21234, "repo_created_at": "2019-11-04T09:11:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef0836...
49177e35-2aee-4673-842a-2bbbe57b61d3
quocbao0603/My-Code
Codeforces/Round # 617/e.cpp
#include <bits/stdc++.h> #define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define debug(a) cout << #a << ": " << a << endl #define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl #define ALL(a) a.begin(),a.end() typedef long long ll; const double PI = acos(-1.0); const int N...
ALGO
0.999911
3.559525
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2019-11-20T10:07:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "107c44b7f...
d816d3db-851f-45a7-8fc3-4eb744b9c823
NavKumarT/Problem-solving
1091-ShortestPathinBinaryMatrix/1091-ShortestPathinBinaryMatrix.cpp
class Solution { public: int shortestPathBinaryMatrix(vector<vector<int>>& grid) { int ans = INT_MAX; vector<vector<int>> visited(grid.size(), vector<int>(grid.size(), 0)); visited[0][0] = 1; if(grid[0][0] == 0) bfs(grid, visited, 0, 0, ans, 1); if(ans == INT_MAX)...
ALGO
0.999991
5.454662
{ "github_metadata": { "branch": "main", "commit_count": 334, "repo_created_at": "2025-01-26T14:27:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "78dc0c9771...
8a3a5cff-cb52-4330-933b-90cf32b7086b
Tech-Intellegent/CodeForces-Solution
CodeForces-Solution/1383D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef double db; typedef string str; typedef pair<int,int> pi; typedef pair<ll,ll> pl; typedef pair<db,db> pd; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<db> vd; typedef vector<str> vs; typedef v...
ALGO
0.999982
3.451178
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-01-23T07:10:19.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "721755baa1d3...
5f3c0c31-3758-48fe-b2c5-a822d2c92eec
Tudor67/Competitive-Programming
LeetCode/Problems/Algorithms/#2866_BeautifulTowersII_sol2_monotonic_stack_O(N)_time_O(N)_extra_space_135ms_108MB.cpp
class Solution { private: vector<long long> computePrefSol(const vector<int>& H){ const int N = H.size(); stack<int> st; vector<int> prevSmaller(N, -1); for(int i = N - 1; i >= 0; --i){ while(!st.empty() && H[i] < H[st.top()]){ prevSmaller[st.top()] = i; ...
ALGO
0.999978
5.262495
{ "github_metadata": { "branch": "master", "commit_count": 615, "repo_created_at": "2020-02-27T19:56:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "509a1e47...
3a5b18ac-096d-40e8-9856-047861924960
4lhc/ROS-Learn
swarm_ws/src/random_walkers_alg/src/Graph.h
/* * Graph.h * * author : <NAME> * email : echo $(base64 -d <<< NDQ0bGhjCg==)@<EMAIL> * date : Sun 17 May 2020 17:59:56 IST * ver : * * A graph implementation based on https://www.youtube.com/watch?v=BcaZIxaS-F4 * */ #ifndef GRAPH_H #define GRAPH_H #include <assert.h> #include <string> #include <...
ALGO
0.977604
4.880298
{ "github_metadata": { "branch": "master", "commit_count": 128, "repo_created_at": "2019-08-01T14:34:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "24277c8b...
1ff065c2-6bb4-406d-8acf-030c6722b51d
AngusRitossa/Heaps
Stoer-Wagner/binomial.cpp
// Stoer-Wagner's algorithm implemented with a binomial heap: O(ve log v) #include <cstdio> #include <vector> #include <utility> #include <chrono> using namespace std::chrono; using namespace std; typedef long long ll; #define MAXN 5000000 typedef struct BinomialNode* pnode; struct BinomialNode { ll val; int node; i...
ALGO
0.999977
4.603072
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2018-04-09T10:49:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "584de03b5...
f9a4c39f-88ab-4b15-87cb-c65ebdba0298
Tanishq251/GeeksForGeeks
Difficulty: Medium/Number of occurrence/number-of-occurrence.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: /* if x is present in arr[] then returns the count of occurrences of x, otherwise returns 0. */ int count(int arr[], int n, int x) { int left = 0,...
ALGO
0.999819
5.939281
{ "github_metadata": { "branch": "main", "commit_count": 108, "repo_created_at": "2024-07-03T19:15: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": "3e425f7c78...
cfb0ec73-5f9b-42ec-8396-97c68c9c805c
deepakmehta/DSAlgoProblems
TopKFrequentWords.cxx
/* Given a string array, words, and an integer k, return the k most frequent strings. Sort the frequencies from highest to lowest and then return the top k frequent words. Words with the same frequency should be sorted by their lexicographical order. Constraints: 1 <=words.length<=500 1<=words[i].length<=10 words[i...
ALGO
0.999982
6.467955
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-04-22T08:56: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": "e00c96052de...
f03f74ba-d935-4ee9-8c2a-20b6a0659bb9
guilhermefelipe-97/Algoritmos
Lista 3/Questão 6.cpp
/*Em um jogo de adivinhação, o jogador deve descobrir um número entre 1 e 10 usando até três tentativas. A cada tentativa o jogador é informado se o número foi descoberto, se ele é maior ou menor do que a tentativa. Se após três tentativas o jogador não descobrir o número, então ele perde o jogo. Faça um algoritmo q...
ALGO
0.976892
3.243616
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-02T01:42: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": "269000345592...
ed7a5106-eb1a-45be-8420-9f53b0ddd6aa
siragoni/UPCforData
fitRootConverted/fitHelicityMinuit2D.cpp
#include "TCanvas.h" #include "TFile.h" #include "TTree.h" #include "TLeaf.h" #include "TH1D.h" #include "TH2F.h" #include "TCanvas.h" #include "TAxis.h" #include "TMath.h" #include "TF1.h" #include "TLatex.h" #include "TStyle.h" using namespace std; #include <math.h> #include "TH2D.h" #include "TF2.h" #include "TStyle...
ALGO
0.962273
3.583627
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2019-07-29T06:54: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": "955b2eb76...
b365d62b-d588-448e-83e0-2c7be734646e
ros-industrial-attic/industrial_moveit
constrained_ik/src/constraints/goal_position.cpp
/** * @file goal_position.cpp * @brief Constraint to specify cartesian goal position (XYZ) * * @author dsolomon * @date Sep 23, 2013 * @version TODO * @bug No known bugs * * @copyright Copyright (c) 2013, Southwest Research Institute * * @par License * Software License Agreement (Apache License) * @par * ...
ALGO
0.9787
7.045309
{ "github_metadata": { "branch": "melodic-devel", "commit_count": 629, "repo_created_at": "2013-08-27T16:24:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 95, "forks": 65, "issues": 21, "pull_requests": 4 }, "file_meta": { "content_id": ...
8718c6cc-9bde-42f3-831f-6a8f3c46750a
cofenberg/pixellight
Base/PLCore/include/PLCore/Container/BinominalHeap.h
/*********************************************************\ * File: BinominalHeap.h * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * Permission is hereby granted, free of charge, to any person obtaining a co...
ALGO
0.979786
4.236357
{ "github_metadata": { "branch": "master", "commit_count": 2905, "repo_created_at": "2024-05-03T10:05:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "daa9c95...
410fd395-1e4d-4a43-b59a-a611d397e912
Adivatsa/Coding
Greedy/candyDistribution.cpp
int candy(vector<int>& ratings) { //we have to give minimum candy to a single person //if rating is greater than neighbour then we have to give more candy to them //At first give one candy to each and iterate from left to right and store the candy distribution check if a[i+1]> a[i]...
ALGO
0.999997
5.427717
{ "github_metadata": { "branch": "main", "commit_count": 395, "repo_created_at": "2022-02-21T08:20: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": "7988a0ebe0...
e42c3157-64d8-40f7-bb42-aee661a37e23
cuhk-eda/cu-gr
src/multi_net/Scheduler.cpp
#include "Scheduler.h" vector<vector<int>> &Scheduler::schedule() { // vector<int> estimatedNumOfVertices(routers.size(), 0); for (int id = 0; id < routers.size(); ++id) for (auto &guide : routers[id].guides) estimatedNumOfVertices[id] += (guide[X].range() + 1) * (guide[Y].range() + 1);...
ALGO
0.997281
4.946741
{ "github_metadata": { "branch": "dac2020", "commit_count": 11, "repo_created_at": "2019-11-28T08:52:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 137, "forks": 41, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a3f025...
8d1756d0-5ca1-411a-8a59-cbff0083936e
jmorton06/Lumos
Lumos/External/msdf-atlas-gen/msdfgen/core/equation-solver.cpp
#include "equation-solver.h" #define _USE_MATH_DEFINES #include <cmath> #define TOO_LARGE_RATIO 1e12 namespace msdfgen { int solveQuadratic(double x[2], double a, double b, double c) { // a = 0 -> linear equation if (a == 0 || fabs(b)+fabs(c) > TOO_LARGE_RATIO*fabs(a)) { // a, b = 0 -> no solution ...
ALGO
0.999868
4.809122
{ "github_metadata": { "branch": "main", "commit_count": 1255, "repo_created_at": "2019-01-09T20:32:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1404, "forks": 148, "issues": 21, "pull_requests": 0 }, "file_meta": { "content_id": "2a9...
35c1d912-9f63-4dbf-9d9b-3b71984c4b95
jkvishu/DSA-Practice-GFG
Medium/Triangle Path Sum/triangle-path-sum.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: /* void find(int i,int n,vector<vector<int>>& triangle,int &ans,int cal){ if(i>=n){ ans=min(ans,cal); return; } for(int j=0;j<i;j++){ f...
ALGO
0.999971
6.333743
{ "github_metadata": { "branch": "main", "commit_count": 2654, "repo_created_at": "2022-12-31T18:42: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": "8d58ac47f...
701ee558-746c-4533-9730-0a179afe0943
gs0622/leetcode
computeArea.cc
/* https://leetcode.com/problems/rectangle-area/description/ */ #include <bits/stdc++.h> using namespace std; class Solution { public: // // trick: if there is no overlap, the left/right/top/bottom are flipped. // int computeArea1(int A, int B, int C, int D, int E, int F, int G, int H) { int area1=(C-A)*(D-B), ar...
ALGO
0.998293
5.810609
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2014-06-13T09:02: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": "0baa1afaf...
bb80bf40-7d38-4830-ba14-82b524baed71
krl4k/Data-Structures-and-Algorithms
LabaratoryWork/Part1/Topic4/ex01(laba7)/main.cpp
// CLion // Created by <NAME> on 3/21/21 11:05. // #include "bi_list.h" int is_valid_input(const char *s) { int i; i = 0; while (s[i] == '-' || s[i] == '+') i++; while (s[i]) { if(!isdigit(s[i])) return (0); i++; } return (1); } char *get_s_number() { std::string s; std::cin >> s; const char *num...
TOOL
0.986076
4.336176
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2021-02-05T10:37: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": "8e1460eefd8...
66d43db7-861b-4ddc-9b83-bbe27314a7e2
Lumzdas/JuodaBalta
Source/JuodaBalta/Private/Rules/Pawn.cpp
#include "Public/Rules.h" #include "Public/Board.h" #include "Public/Enums.h" #include "Public/Coordinate.h" namespace JuodaBalta { void Rules::LegalPawnMoves( FBoards & Boards, FBoard const & Board, FCoordinate const & Coordinate, EPlayer const Owner ) { bool const PawnAtOrigin = Owner == EPlayer::...
ALGO
0.915231
6.418488
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-08-19T02:53:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "004b01676c...
b253937f-dba8-4631-bcfc-d28a9516dc4e
bSemir/cpp-coding-challenges
problem-35/main.cpp
#include <iostream> #include <algorithm> #include <stdexcept> template<typename T> class Stek { private: int broj_elemenata; int kapacitet; T *elementi; void Realociraj(int novi_kapacitet); void Test() { if (DaLiJePrazan()) throw std::logic_error("Stek je prazan"); } public: Stek() : broj_el...
TOOL
0.935207
4.969968
{ "github_metadata": { "branch": "main", "commit_count": 304, "repo_created_at": "2024-04-20T14:55: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": "64df6f8e8b...
a580315a-1c79-4a9c-b992-f34d7f68f10c
chibi03/thedreamyteamproject
blockchain/commitment.cpp
#include "commitment.h" #include "ecclib-glue.h" #include "../ecclib/eccp/eccp.h" #include "../ecclib/gfp/gfp.h" #include "../ecclib/utils/rand.h" namespace blockchain { ac_co ac_generate(const rs_public_key& pk, uint32_t amount) { const auto param = &secp256_params; const auto order_n = &secp256_params...
ALGO
0.994487
6.477611
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2018-10-14T15:24:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af62fbff...
751a8432-3325-45b4-8102-984393c178a5
Dup4/competitive-programming
nowcoder/4010/f/f1.cpp
#include <bits/stdc++.h> using namespace std; using pII = pair<int, int>; using ll = long long; #define dbg(x...) \ do { \ cout << "\033[32;1m" << #x << " -> "; \ err(x); \ } while (0) void err() { ...
ALGO
0.999847
4.269251
{ "github_metadata": { "branch": "main", "commit_count": 838, "repo_created_at": "2019-04-07T01:16:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f7c028a14...
a1b6a07e-b817-4279-995d-af56617bd8ab
Austerlitz1203/Linux
RingQueue/Main.cc
#include"RingQueue.hpp" #include"Task.hpp" #include<time.h> #include<unistd.h> #include<sys/types.h> const char* ops="+-*/%"; using namespace std; void* ConsumerRoutine(void* args) { RingQueue<Task>* c=static_cast<RingQueue<Task>*>(args); while(true) { Task x; c->pop(&x); x(); ...
TOOL
0.915669
4.365926
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2023-02-18T04:40: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": "8d7ab5f3a...
66c12114-7256-41e4-aeaa-3aab8d571ce0
rjenez/W266-final-project
data/programming-homework-dataset-plagiarism-detection/src/B2016/Z1/Z3/student7985.cpp
/*B 2016/2017, Zadaća 1, Zadatak 3*/ #include <iostream> #include <vector> typedef std::vector<double> Vektor; typedef std::vector<Vektor> Matrica; Matrica RastuciPodnizovi(Vektor v){ Matrica m; if (v.size() == 0 || v.size() == 1) return m; int brElem{1}; int j; int i{1}; while(1){ fo...
ALGO
0.999877
4.999013
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-02-09T00:45:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2eb5d73538...
3f2f05bb-1ff9-4d70-bee4-28f91c197315
fex-team/webuploader
_draft/flash_cpp/hashlib/hl_md5.h
/* * hashlib++ - a simple hash library for C++ * * Copyright (c) 2007-2010 <NAME> * * 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 *...
ALGO
0.98284
6.95565
{ "github_metadata": { "branch": "master", "commit_count": 2270, "repo_created_at": "2013-08-05T07:59:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7689, "forks": 2318, "issues": 2412, "pull_requests": 11 }, "file_meta": { "content_id":...
4f62ee88-4ab7-45da-a552-e6597d0201dd
funnynickname2010/88-Merge-Sorted-Arrays
Source.cpp
#include <utility> #include <vector> using namespace std; /*Merging to arrays in a non-descending order*/ class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { vector<int> vresult; vresult.resize(m + n); for (size_t i = 0; i < (m + n); i++) { vresult[...
ALGO
0.999992
5.447495
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-12-01T11:47:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d70480c4e...
5eafba6b-4e21-4a86-8b93-99e6a19a58a8
NoPainsNoGains33/LeetCode
Problems/Longest Palindromic Substring/doublePointer(lintcode).cpp
class Solution { public: /** * @param s: input string * @return: a string as the longest palindromic substring */ string longestPalindrome(string &s) { // write your code here if (s == "") return ""; string longest = ""; for (int middle = 0; middle < s...
ALGO
0.999973
5.900621
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2020-10-14T00:44: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": "915bfa9110...
88209792-c6fe-4412-bac2-4d5f094622e8
mahfahim/XPSC_Fahim
Week11/Day7/M8.cpp
//********* <NAME> ********* #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define endl "\n" #define ll long long #define ldb long double template <typename T> using pbds = tree<T, null_type, less<T>, rb_tree_tag, tre...
ALGO
0.999869
4.449284
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-03-30T17:17: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": "940713ccb7a...
88075f70-0a99-4b40-9620-8008f47a96c5
suhanigupta23/OS
OPERATING SYSTEMS/page/optimal_page_replacement_algo.cpp
#include <iostream> using namespace std; int predict(int pages[], int frames[], int n, int currentIndex, int capacity) { int farthest = currentIndex; int index = -1; for (int i = 0; i < capacity; i++) { int j; for (j = currentIndex; j < n; j++) { if (frames[i] == pages[j]) { ...
ALGO
0.999909
5.942826
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-25T04:26: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": "50b693e7b203...
161022e3-af3e-400f-a818-f89ff2162a55
agga1/MOWNiT
lab1/ex1and2.cpp
#include <iostream> #include <vector> #include <chrono> #include <fstream> #include "JSONparser.h" using namespace std; const int N = 10000000; float v = 0.53125; //float v = 0.207489; vector<float> vct(N, v); // NOLINT(cert-err58-cpp) float easy_sum() { float sum = 0; for (auto val:vct) ...
ALGO
0.998748
5.540232
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2020-03-02T18:33:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 4 }, "file_meta": { "content_id": "10b93663...
4b7d3b8d-4a1b-4a2c-a895-4fa4c101af21
BitSeq/BitSeq
lowess.cpp
/* * c++ implementation of Lowess weighted regression by * <NAME> http://www.cs.man.ac.uk/~glausp/ * * * Based on fortran code by Cleveland downloaded from: * http://netlib.org/go/lowess.f * original author: * <EMAIL> Mon Dec 30 16:55 EST 1985 * <NAME> * Bell Laboratories * <NAME> NJ 07974 * * See ori...
ALGO
0.999861
5.975089
{ "github_metadata": { "branch": "master", "commit_count": 243, "repo_created_at": "2014-01-13T12:30:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 16, "forks": 8, "issues": 9, "pull_requests": 0 }, "file_meta": { "content_id": "d8caf19d...
6d875731-7601-4285-95e5-f29422b921b4
vkonov2/Geometry-Projects
Curve-Fitting/Src/PlaneGeometry/PlaneGeometryFunctions.cpp
#define _CRT_SECURE_NO_WARNINGS #include "PlaneGeometryFunctions.h" #include <iostream> #include "../Mathem/Jacobi.h" #define accuracy 2048 void MoveSideCenter(vector <VECTOR2>& CurrSidePts, vector <VECTOR2>& SidePts) { int n = (int)(CurrSidePts.size()); VECTOR2 Center(0, 0); for (int i = 0; i < n; i++) { Cen...
ALGO
0.986
3.955522
{ "github_metadata": { "branch": "main", "commit_count": 176, "repo_created_at": "2023-04-18T14:22: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": "5d9bd1931c...
401c40c1-3e70-4de8-a507-a58a719afd21
pvarna/UP
Seminars/Week06-Arrays/zad7.cpp
#include <iostream> const int MAX_ARRAY_SIZE = 1000; size_t getSizeOfArray (); void insertArrayElements (int numbers[], size_t size); int main () { int numbers[MAX_ARRAY_SIZE] = {}; size_t size = getSizeOfArray(); insertArrayElements(numbers, size); bool flagUp = true; bool flagDown = true; ...
ALGO
0.999917
4.726536
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2020-12-06T15:47:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f94a1f74f3e...
f152b446-f4a4-4951-b615-53661feead19
Kenshin-Y/competitive-programming
String/longest_common_subsequence.cpp
/* @ created: 2023-3 @ verified: EDPC-F @ description: * 文字列 s, t の最長共通部分列を求める. * dp[i][j] := s[i], t[j] までのLCSの長さ. * 長さのみ返す実装,復元文字列を返す実装 */ // 長さのみ返す int LCS(string s, string t){ int n = s.size(); int m = t.size(); vector<vector<int>> dp(n, vector<int>(m, 0)); for(...
ALGO
0.999773
5.903496
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-01-07T08:57:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "a126bdc7bd0...
8e168412-66d5-4305-b73f-9268abfd32ae
matinabbasi788/contest
codeforces/contests/Codeforces-Round-1022-Div-2/C.cpp
// Author: <NAME> // Date: 2025-05-01 // Description: [Description] // Includes #include <bits/stdc++.h> using namespace std; // Solve function void solve(){ int n; cin >> n; vector<long long> a(n); for (int i = 0; i < n; i++){ cin >> a[i]; } int ans = 0; for (int i = 0; i < n; ){ int j = i; ...
ALGO
0.999547
5.280274
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-11-15T16:22: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": "0bd1e7bafab5...
8d4ce41f-22ae-4c6a-9070-db8d29db30a9
djplatt/code
L1/L1_print2.0.cpp
/* File: L1_print2.0.cpp Created: 4th October 2011 Version: <v> = 2.0 : Analysis of L(1) as per Ramare email 5/11/11 : Input from L1.1.cpp Dialect: C++ Requires: -lrt Implementation notes: Build instructions: g++ -O1 -msse -march=nocona -fomit-frame-pointer -frounding-math -finline-functions By: <N...
ALGO
0.997771
3.033985
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2020-07-17T11:02:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c3f3f19...
2c8d8afc-de24-489e-816d-15f36441c178
Nek5000/nekRS
3rd_party/lapack/LAPACKE/include/lapack.h
#ifndef LAPACK_H #define LAPACK_H /* * Turn on HAVE_LAPACK_CONFIG_H to redefine C-LAPACK datatypes */ #ifdef HAVE_LAPACK_CONFIG_H #include "lapacke_config.h" #endif #include "lapacke_mangling.h" #include <stdlib.h> #include <stdarg.h> #include <inttypes.h> /* It seems all current Fortran compilers put strlen at en...
CONFIG
0.907454
3.888792
{ "github_metadata": { "branch": "master", "commit_count": 405, "repo_created_at": "2019-08-04T08:45:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 339, "forks": 91, "issues": 14, "pull_requests": 2 }, "file_meta": { "content_id": "f35d8...
7c82340e-38be-4d6c-819f-1755d2452c67
2044-space-elevator/OnlineJudgeCode
Luogu/P1833.cpp
// Problem: P1833 樱花 // Contest: Luogu // URL: https://www.luogu.com.cn/problem/P1833 // Memory Limit: 128 MB // Time Limit: 1000 ms // // Coding by 2044_space_elevator #include <bits/stdc++.h> using namespace std; int T, flowers; struct flower { int t, c, p; }arr[(int)1e4 + 5]; int dp[(int)1e4 + 5]; void input(...
ALGO
0.999282
4.506808
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2023-09-03T04:39: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": "060660a71e8...
5bb3f0e9-fb62-44ae-86d9-2d400b3f5276
Sandeep1904/xe_code
sorting.cpp
// // Created by xesandeep on 2020-01-28. // #include <iostream> using namespace std; // this is for selection sort algorithm. void selection(int arr[], int size){ int min, temp; cout<<"this is done by selection sort"<<endl; for (int i=0;i<size-1;i++){ min = i; for (int j =i+1;j<size;j++){ ...
ALGO
0.999675
4.767355
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2020-01-09T13:39: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": "0714c530f...
c4e9f322-5ee9-41d1-a6c4-8e9fefa4481c
arangodb/arangodb
3rdParty/boost/1.78.0/libs/bimap/example/mi_to_b_path/bidirectional_map.cpp
// Boost.Bimap // // Copyright (c) 2006-2007 <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) // Boost.Bimap Example //----------------------------------------------------------------------------- // T...
ALGO
0.918149
5.095205
{ "github_metadata": { "branch": "devel", "commit_count": 51986, "repo_created_at": "2011-10-26T06:42:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13878, "forks": 857, "issues": 743, "pull_requests": 38 }, "file_meta": { "content_id": ...
7d7b30ec-7a67-416a-af7e-594d40fa71d6
alps-jbnu/23ALPStudy
2023-1/Intermediate/Zoe305/Greedy/2457.cpp
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<pair<int, int>> flower; for (int i = 0; i < n; i++) { int sm, sd, em, ed; cin >> sm >> sd >> em >> ed; flower.push_back({sm * 100 + sd, ...
ALGO
0.999543
3.869798
{ "github_metadata": { "branch": "main", "commit_count": 2930, "repo_created_at": "2023-02-03T06:11:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12, "forks": 59, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "783c98e3...
432f7c96-62fe-418e-8333-197faf4ab5dd
fis-teria/Guraduation_Resarch
src/canny.cpp
#include <opencv2/opencv.hpp> #include <cstdio> #include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <vector> #include <numeric> #include <algorithm> std::string make_path(std::string dir, int dir_num, int var) { std::string back; if (var < 10) { back = dir + std::...
ALGO
0.987793
3.901927
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2022-10-01T07:40: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": "627ec67fd...
b1ecc0e3-d154-4d3f-be2b-f6a38aa74c29
surajdarade/competitive-programming
MATHS/4_1296_A_array_with_odd_sum.cpp
#include <bits/stdc++.h> #include <string.h> #define ll long long int #define br << "\n"; #define no "NO" #define yes "YES" #define vecint vector<int> #define vecll vector<long long int> #define vecstring vector<string> #define push push_back #define decimal(n) cout << fixed << setprecision(n); #define For(i, n) for (l...
ALGO
0.999744
5.539309
{ "github_metadata": { "branch": "main", "commit_count": 108, "repo_created_at": "2024-10-22T04:28:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "511e3e8745...
be134231-40ca-49d7-96dc-e56293ea7902
bhardwajprateek291200/Pep-IP
41 09-06-20/Floyd_Warshall_Algo.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 10000000 void floyd_warshall(vector<vector<int>>& arr, int v) { for (int i = 0; i < v; i++) { for (int j = 0; j < v; j++) { for (int k = 0; k < v; k++) { if (arr[j][i] == MAX || arr[i][k] == MAX) continue; arr[j][k] = min(arr[j][k], arr[j][i]...
ALGO
0.999934
4.15924
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2020-03-28T02:19: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": "78906294d...
cb8cebb5-a3b0-4389-9e47-1f76f09ef3bf
VaishnavShelke/DS-Algo
String/Generate all possible IP adress.cpp
#include <iostream> #include <bits\stdc++.h> #define N 9 using namespace std; // Generate all possible IP adress int convertToNum(string str){ int factor = 10; int number = 0; for(int i = 0; i<str.size() ; i++){ number = number*factor + (int)(str[i]-'0'); } return number; } bool isValid(strin...
ALGO
0.997716
3.89516
{ "github_metadata": { "branch": "main", "commit_count": 453, "repo_created_at": "2020-12-06T05:14: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": "b3aa05fe49...
e4c5dbd4-1f8a-4276-b53b-e12bcd718ae2
leshless/my
cf/913/D.cpp
#pragma GCC optimize("O3") #include <ext/pb_ds/assoc_container.hpp> #include <bits/stdc++.h> using namespace std::chrono; using namespace __gnu_pbds; using namespace std; #define ll long long #define dbl double #define ldbl long double #define uint unsigned int #define peque priority_queue #define map unordered_map ...
ALGO
0.999786
4.941727
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2023-08-12T07:29: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": "17e89dd40dd...
4f578ad9-3611-48fc-a4d8-3dd5b2d793dd
youtube/h5vcc
external/chromium/content/browser/accessibility/dump_accessibility_tree_helper.cc
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/accessibility/dump_accessibility_tree_helper.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "bas...
TOOL
0.917471
7.364188
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2013-06-26T18:18:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 59, "forks": 36, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "372366f9c...
c936d095-0c85-4810-8b50-f85bcfb0cc1d
Edith-3000/Algorithmic-Implementations
Graph/Splitwise App Underlying Algo/Min #Transactions In Money Splitwise Algorithm.cpp
// Given a number of friends who have to give or take some amount of money from one another. // Design an algorithm by which the total cash flow among all the friends is minimized (i.e. just output // the minimum number of transactions required). // The algorithm is GREEDY based. // Below is an implicit graph algori...
ALGO
0.99997
4.581335
{ "github_metadata": { "branch": "master", "commit_count": 490, "repo_created_at": "2020-07-24T04:49:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58d287b0...
d780237e-254f-44bd-97f1-b561701010d3
danscu/onlinejudge
sols/s-topcoder/max_submatrix.cpp
#include <iostream> #include <cstdio> #include <stack> using namespace std; #define MAXN 1001 int Answer; int N, M; int m[MAXN][MAXN]; int s[MAXN][MAXN]; #define DBG 0 // end is exclusive, areaEnd is inclusive int maxArea(int m[], int n, int &areaStart, int &areaEnd, int &height) { int area[n]; int areaFrom[n]; ...
ALGO
0.999725
3.268961
{ "github_metadata": { "branch": "master", "commit_count": 146, "repo_created_at": "2014-03-16T00:58: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": "f91de11e...
147db462-82bf-4ab8-9fa1-78064cbc3895
coderajdeep/Code
striverSDE/linkedList/15--lengthOfCycle.cpp
// Length of cycle in linkedlist -- coding ninjas // Time complexity O(n) // Space complexity O(n) int lengthOfLoop(Node *head) { if(!head || !head->next) return 0; unordered_map<Node*, int> umap; int time = 0; while(head) { auto itr = umap.find(head); if(itr != umap.end()) { ...
ALGO
0.99992
5.181525
{ "github_metadata": { "branch": "rajdeep", "commit_count": 667, "repo_created_at": "2022-05-15T17:35: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": "08e7344...
ae771850-1cf6-4934-8578-273423a445c2
2youngjae/study
2115 벌꿀채취2.cpp
#include <stdio.h> #include <memory.h> int map[10][10]; bool visited[10][10]; int n, m, c, res; int max(int a, int b) { return (a > b) ? a : b; } //비용 구하기 void getPrice(int x, int y, int a, int sum, int price) { if (sum > c) return ; res = max(res, price); if (a == m) return; getPrice(x, y +...
ALGO
0.999967
3.745193
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2018-01-10T11:38: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": "27a9957a0...
29c3e870-218a-47ab-afff-0e3f991b3b3d
Ivan2001otp/DSA
Graphs_striver/topsort_dag_short_path.cxx
#include <bits/stdc++.h> using namespace std; typedef long long ll; void topSort(int node, vector<pair<int,int>>adj[], int vis[], stack<int>&st) { vis[node] =1; for(auto it: adj[node]) { int v = it.first; if (! vis[v]) { topSort(v, adj, vis, st); } } st.push(node)...
ALGO
0.999917
4.769135
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2025-05-23T16:30:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "295ec4931af...
efdddd33-ec73-4916-af84-f9bc52f64a7a
combo667/SDE
Linked List/Reverse A LL/reverse.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define rep1(i, n) for (int i = 0; i < n; i++) #define rep2(i, n) for (int i = 1; i <= n; i++) #define rep(i, a, b) for (int i = a; i < b; i++) #define REPD(i, n) for (int i = n - 1; i >= 0; i--) #define FORD(i...
ALGO
0.99982
3.451787
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-10-03T17:23: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": "2553b1cf9a...
7ba0e144-422d-4c85-883c-ec00a492c879
HenrikSchumacher/Knoodle
src/Intersection.hpp
#pragma once namespace Knoodle { template<typename Real_ = double, typename Int_ = Int64> struct Intersection { using Real = Real_; using Int = Int_; using Sign_T = FastInt8; // used to store handedness. Int edges [2] = {-2}; // First edge goes over, second ...
ALGO
0.934801
5.865211
{ "github_metadata": { "branch": "main", "commit_count": 527, "repo_created_at": "2023-03-27T10:59:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 4, "pull_requests": 1 }, "file_meta": { "content_id": "44d65e3400...
7469be9b-25ad-4513-ad5f-fcddda689538
teetangh/competitive-programming-and-dsa
GeeksForGeeks/Algorithms/DP/MinimumNumberOfCoins.cpp
#include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int minCoins(int coins[], int numCoins, int sum) { // Your code goes here vector<vector<int>> dp; dp.resize(numCoins + 1, vector<int>(sum + 1, -1)); for (int i = 0; i < numCoins + 1; ...
ALGO
0.999939
5.095349
{ "github_metadata": { "branch": "main", "commit_count": 597, "repo_created_at": "2020-01-11T16:55:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b205346c22...
048de2d1-7ab0-4bdb-af52-65d932cf6af0
sampritipanda/IOI_Repository
Topcoder/SRM 648/500.cpp
// Fragile #include <vector> #include <string> #include <iostream> using namespace std; bool visited[21]; void dfs(int curr, vector<string>& graph) { visited[curr] = true; for(int i = 0; i < graph.size(); i++){ if(graph[curr][i] == 'Y' && !visited[i]) dfs(i, graph); } } int countConnectedComponents(vecto...
ALGO
0.999881
4.538241
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2014-12-27T14:42:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 31, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8157155...
cf8285c5-85e9-4e8a-ac7c-21bd414e823e
najuspy/AssignmentI
stack.cpp
//A program to implement stack with pop n push function #include<iostream> using namespace std; #define MAX 100 int Stack[MAX]; int top =-1; //Checking if the stack is empty or not. bool isEmpty(){ return (top < -1)?true:false; } //Checking if the stack has space or not. bool isFull(){ return (top>=MAX)?true:fals...
ALGO
0.992904
4.357457
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-06-05T02:58:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3341948d1...
8d33525a-823f-431f-ace9-d3e9f800198d
vancegroup-mirrors/sofa-framework
Sofa/modules/sofa/component/misc/DevAngleCollisionMonitor.inl
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, version 1.0 RC 1 * * (c) 2006-2011 MGH, INRIA, USTL, UJF, CNRS * * * ...
TOOL
0.932703
5.910339
{ "github_metadata": { "branch": "master", "commit_count": 2616, "repo_created_at": "2013-03-26T20:22:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "511d695d...
03226a93-7ec3-4ed2-a826-ffe84df48cfa
CGAL/cgal
AABB_tree/demo/AABB_tree/Refiner.h
#ifndef _REFINER_H_ #define _REFINER_H_ #include <CGAL/basic.h> #include <CGAL/Polyhedron_3.h> #include <queue> template <class Kernel, class Polyhedron> class CEdge { public: typedef typename Kernel::FT FT; typedef typename Polyhedron::Halfedge_handle Halfedge_handle; private: FT m_sqlen; Halfedge_handle...
ALGO
0.999473
5.82599
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
cdea1984-8eb4-4ece-8ccf-cd5d614991b9
e5pe0n/algorithm-training
AtCoder/ACP/BootCamp4b/Medium100/cpp/C_Streamline.cpp
#include <algorithm> #include <iostream> #include <stdio.h> #define MAX_M 100'001 typedef long long ll; using namespace std; int X[MAX_M]; int _X[MAX_M]; int main() { int N, M; cin >> N >> M; for (int i = 0; i < M; ++i) { cin >> X[i]; } if (M == 1) { printf("0\n"); return 0; } sort(X, X +...
ALGO
0.999992
3.922792
{ "github_metadata": { "branch": "master", "commit_count": 571, "repo_created_at": "2019-12-09T13:22:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "8373b674...
3764e97a-5777-4475-bc21-b5ad08f82e50
Abhi6722/DAA-Lab
Lab Quiz/q2.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cout << "Enter the size of square matrix: "; cin >> n; int A[n][n], i, j, B[n][n]; cout << "Enter the elements of the matrix\n"; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << ...
ALGO
0.999884
4.016631
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-03-09T05:09: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": "709d29a09c38...
6987db34-7954-4e02-8029-937293464bfb
vansh-codes/Complete-Interview-Preparation-GFG
2_Data-Structures-(Basics)/3_Arrays/Problems/1_arrayInsertAtEnd.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; void insertAtEnd(int arr[],int sizeOfArray,int element); // } Driver Code Ends //User function Template for C++ // You only need to insert the given element at // the end, i.e., at index sizeOfArray - 1. You may // ...
ALGO
0.999256
5.909719
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2024-06-06T20:42:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b63fff0348...
2b4ce6eb-9750-47ed-99ea-fd52972c5c24
ishandutta2007/codeforces-m
mango_lassi/normal/1205/B.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; const int INF = 1e9 + 7; const int N = 1e5; const int M = 64; vector<int> apps[M]; vector<int> conns[N]; vector<pair<int, int>> ed; int vis[N]; int dist[N]; void handle(int j, int bi, vector<int>& bfs) { int i = bfs...
ALGO
0.999674
3.911998
{ "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": "1a7158d168ca...
251a2dea-0988-41b1-8384-62eedc800500
TechSoc-MSIT/DS-ALGO-REPO-HACKTOBER
c++/doublyLinkedList.cpp
#include<iostream> #include<cstdlib> using namespace std; // Node Declaration struct node { int info; struct node *next; struct node *prev; }*start; class double_llist { public: static void create_list(int value); void add_begin(int value); static void add_after(int value, int position); v...
ALGO
0.999386
5.459263
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2020-10-06T10:51:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10, "forks": 29, "issues": 24, "pull_requests": 2 }, "file_meta": { "content_id": "362e85...
2964c8ba-dcf3-485c-ba82-8eabcae1ed93
Fluorospek/OS_codes
practice/Memory_Management.cpp
#include <bits/stdc++.h> using namespace std; void swap(int &a, int &b) { int temp = a; a = b; b = temp; } // First Fit void firstFit(int *prSize, int *holes, int n, int m) { int ffit[n]; for (int i = 0; i < n; i++) { bool flag = true; for (int j = 0; j < m; j++) { ...
ALGO
0.999982
4.014572
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-11-21T14:51: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": "36efb051b2fb...
605806de-24f9-4049-8f9b-1c2bb5cf0ae6
jayprakash6547/STRIVER-SDE-Sheet-Challenge-2023
Vertical Order Traversal.cpp
#include <bits/stdc++.h> /************************************************************ Following is the Binary Tree node class template <typename T = int> class TreeNode { public: T data; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T val) { this->data = val; left = NULL; ...
ALGO
0.999994
5.407649
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2023-06-04T09:36: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": "4ae081c4a6a...
158a5478-2f81-4e01-a0a7-28ed3124d5d9
hpano/CompetitiveProgramming
atcoder/ABC/007/c.cpp
#pragma region Macros #include <bits/stdc++.h> using namespace std; using ll = long long; #define REP2(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; ++i) #define REP3(i, l, r) for (int i = (l), i##_len = (int)(r); i < i##_len; ++i) #define GET_MACRO_REP(_1, _2, _3, NAME, ...) NAME #define REP(...) GET_MACRO_...
ALGO
0.999808
4.359399
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2020-07-28T11:42: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": "90c9d65e9...
e47588b5-6f46-4982-9e21-91c40cac3ad3
cjgribel/eduRend
src/vec/mat.cpp
// // 2x2, 3x3 & 4x4 Matrix lib // // <NAME> 2016-2021, <EMAIL> // #include "mat.h" #include "vec.h" namespace linalg { template <class T> vec2<T> mat2<T>::operator*(const vec2<T>& rhs) const { return vec2<T>(m11*rhs.x + m12*rhs.y, m21*rhs.x + m22*rhs.y); } // explicit template speciali...
TOOL
0.978306
6.348115
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2021-08-05T20:13:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 40, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81090e9680...
31d3e05f-2097-4600-816b-256e74749f8c
kyad/atcoder
arc151/a/a.cc
#include <iostream> #include <vector> using namespace std; char change(char c) { if (c == '0') { return '1'; } else { return '0'; } } int main() { int N; cin >> N; string S, T; cin >> S; cin >> T; int d = 0; for (int n = 0; n < N; n++) { if (S.at(n) != T.at(n)) { d++; } } ...
ALGO
0.999996
3.773309
{ "github_metadata": { "branch": "master", "commit_count": 889, "repo_created_at": "2021-08-26T14:42: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": "30303342...
cda481ed-ffa2-41a2-a7b1-1c0dcdefedf1
shahjalal-mahmud/CodeForces
Group/Assiut University Training - Newcomers/Data-Type-Condition/Contest-01/G_Katryoshka.cpp
// Unsolved #include <iostream> #include <algorithm> using namespace std; long long maxKatryoshkas(long long n, long long m, long long k) { // First, let's handle the combination with 2 eyes and 1 body. long long katryoshkas = 0; // First, make as many as possible from the "2 eyes + 1 body" combination ...
ALGO
0.99991
3.938218
{ "github_metadata": { "branch": "main", "commit_count": 141, "repo_created_at": "2025-01-06T15:50: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": "40fe656d40...
dc53b524-ec8b-4857-8d0f-cf6ffbd1da56
mahirlabibdihan/Competitive-Programming
Codeforces/D_Cross_Coloring.cpp
// Each row and column must be of the same color // So, the last coloring in a row or column will determine it's color // For each operation we will have k options // For each unique row and column we will have k options // Corner: n=1 or m=1 // Maximum q different colors in the matrix // Any operation will be ingored ...
ALGO
0.999953
4.689589
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-12-28T13:55: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": "f54f58280fb...
faad8ac2-1642-4a18-a42c-d2e76c9c3782
alya1b/Pac_Man
search.h
#include <vector> #include <queue> #include <cmath> #include <algorithm> struct Node { int x, y; int cost; //(heuristic) }; bool operator<(const Node& a, const Node& b) { return a.cost > b.cost; } //Greedy algorithm //each move greedy, returs first found path std::vector<std::pair<int, int>> findPathGree...
ALGO
0.999952
5.720752
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-11-01T06:54: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": "c5b4bc7a991a...