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
11d4ad06-8c16-48b1-ae6d-988ad0196787
NgNhatThanh/PTIT-CODE
DSA/DSA09030.cpp
#include <bits/stdc++.h> #define ll long long #define faster() ios_base::sync_with_stdio(0); cin.tie(0); using namespace std; int v, e, x, y, vst[1005]; vector<int> ke[1005]; set<int> p[3]; int bipart(int u){ queue<pair<int, int>> q; q.push({u, 1}); p[1].insert(u); while(!q.empty()){ int v = q...
ALGO
0.999874
5.106875
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2023-03-11T06:59:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0185307ce84...
d06ec28a-33a0-4377-83ee-d1595884c1ca
Baptiste56/SimMethod
main.cpp
#include <iostream> #include <iomanip> #include "basic.h" #include "analytic.h" #include "heston.h" #include "plot.h" int main() { double S_0 = 100.; double K = 100. ; double r = 0.05; double sigma = 0.2; double T = 1; //compute the greeks double delta_S = 0.01; double delta_sigma = 0...
ALGO
0.999826
5.111912
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-03-17T15:12: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": "ea1c1dbb93...
ac75bb06-a58e-4ef6-91a7-f7bbba8727a5
ManasaRavaliChenna/MissionRnD-C-Strings-Worksheet
src/StrWordsinRev.cpp
/* OVERVIEW: Given a string, reverse all the words not the string. E.g.: Input: "i like coding". Output: "coding like i" INPUTS: A string. OUTPUT: Modify the string according to the logic. NOTES: Don't create new string. */ #include <Stdio.h> #include <string.h> void str_words_in_rev(char *input, int len) { char ...
ALGO
0.999916
4.288228
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-12-02T17:33: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": "3ff5c1eee0...
01047124-a7bf-408a-8781-3ff8fa377662
linkumokunn/code_la
CSES/1111.cpp
/* ============================================================================= /\ \ / /\ |\ /| |=========== / \ \ / / \ | \ / | | / \ \ / / \ | \ / | | / \ | / \ | \...
ALGO
0.999998
3.350464
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2021-11-23T02:23:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6749e15a20...
dbfbdabc-1f7f-4ecb-beba-9cede84f53c0
ibudiselic/contest-problem-solutions
tc 160+/RSABreaker.cpp
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> #include <set> using namespace std; set<int> factorize(int n) { set<int> ret; for (int d=2; d<=n; ++d) if (n%d == 0) { ret.insert(d); while (n%d == 0) n...
ALGO
0.999979
4.767888
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2011-08-14T11:43:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18d77372d...
b3c63f7f-a7f7-4244-9e4c-c9377bce7b37
Ivanhan2018/MathTool
gaptool/ZD.cpp
#include <fstream> #include <string> #include "FiniteGroup.h" #include "quotientGroup.h" std::vector<string> split( const std::string& str, const std::string& delims, unsigned int maxSplits = 0) { std::vector<string> ret; unsigned int numSplits = 0; // Use STL methods size_t start, pos; start = 0; do { pos ...
ALGO
0.987496
3.567266
{ "github_metadata": { "branch": "master", "commit_count": 687, "repo_created_at": "2018-11-23T09:21:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a19e65fc...
3dbb55f0-4743-456d-b228-b8215304ba7a
liuyubobobo/Play-Leetcode
1001-1500/1476-Subrectangle-Queries/cpp-1476/main2.cpp
/// Source : https://leetcode.com/problems/subrectangle-queries/ /// Author : liuyubobobo /// Time : 2020-06-13 #include <iostream> #include <vector> using namespace std; /// Using History /// Time Complexity: init: O(n^2) /// update: (O(1)) /// get: O(k) /// Space Complexity: O(...
ALGO
0.997269
6.525585
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "63...
e633c1bc-4971-4a00-b86d-cc49d55e1c83
abhiagarwal18/Leetcode-Competitive
C++/52 HARD recursion.cpp
class Solution { public: void f(int k, vector<bool> &cols,vector<bool>&d1, vector<bool>&d2, int&res){ int n = cols.size(); //base case //k is the only var if(k<0) { res++; return ; } //recursive step //enumerating possibilities f...
ALGO
0.999907
5.291646
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2020-06-05T17:09: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": "dea3fd39c...
11779b64-99ba-4d61-a482-f0b53803f6fd
Hanner-c/S2_Meso
Julio 24-30/Lab2.c++
#include <iostream> using namespace std; void seleccion(int arreglo[5], int n) { for (int i = 0; i < n - 1; i++) { int min_idx = i; for (int a = i + 1; a < n; a++) { if (arreglo[a] < arreglo[min_idx]) { min_idx = a; } } int temporal = arreglo[min_idx]; arreglo[min...
ALGO
0.999964
4.298103
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-07-05T01:00: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": "80fb992c5aab...
989b97eb-6bdc-4e9e-bd7c-8ea2933cd366
ikjot-2605/Competitive-Programming
CodeForces/1676F.cpp
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */ #include <algorithm> #include <vector> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <cmath> #include <iostream> #include <stack> #include <queue> #include <climits> #include <iomanip> #include <iterator> #define a...
ALGO
0.999913
5.432138
{ "github_metadata": { "branch": "master", "commit_count": 93, "repo_created_at": "2020-04-11T11:53: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": "9596b55a9...
2468f6a7-f6d8-4433-8abb-169103fbbea2
VishalSingh-07/Data-Structures-and-Algorithms
Section 10 - Sparse Matrix and Polynomial Representation/Polynomial Representation/Class_Polynomial_Representation.cpp
#include <iostream> using namespace std; class Term { public: int coeff; int Expo; }; class Polynomial { private: int n; Term *terms; public: Polynomial(int n) { this->n = n; terms = new...
ALGO
0.999101
4.664944
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2022-08-29T10:11:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a15cfcd8...
7de7cf90-ce5d-45e6-b34e-e1ce86dd5d84
wuxinrantj/Coding
LeetCode/57.插入区间/57.插入区间.cpp
/* * @lc app=leetcode.cn id=57 lang=cpp * * [57] 插入区间 * * https://leetcode-cn.com/problems/insert-interval/description/ * * algorithms * Hard (37.09%) * Likes: 133 * Dislikes: 0 * Total Accepted: 21.5K * Total Submissions: 57.8K * Testcase Example: '[[1,3],[6,9]]\n[2,5]' * * 给出一个无重叠的 ,按照区间起始端点排序的区...
ALGO
0.999949
6.322743
{ "github_metadata": { "branch": "master", "commit_count": 186, "repo_created_at": "2020-01-03T08:40: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": "5ee3ecd2...
1b04a95f-32ca-4c3a-992b-101de177f870
PrveenYadav/DSA-Journey
20_Binary Search Tree/Lecture-69 Binary Search Tree/code1.cpp
#include <iostream> #include <queue> using namespace std; //Home work : Insertion in Binary Search Tree : Home work finished class Node { public: int data; Node* left; Node* right; Node(int val) { this->data = val; left = NULL; right = NULL; } }; //For Printing using leve...
ALGO
0.999982
4.964085
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-02-28T08:40:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05b3f1675296...
2609f9b1-d794-4a3c-af16-c233a57feef1
AngelOlanC/competitive-programming
OmegaUp/2024/Libre/1425. Camino Escondido/Sol.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define sz(x) x.size() #define all(x) x.begin(), x.end() #define nl "\n" #define mset(x,y) memset(x, y, sizeof(x)) #define read(s) getline(cin>>ws,s) #define redondear(x) fixed<<setprecision(x) using namespace std; void DBG(){ cerr<<")\n";...
ALGO
0.999967
3.411417
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-06-30T04:52: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": "f777ea57780...
87aa726e-cd5a-4f0c-aca6-d014d06f02a9
jjason1/Data-Structure-and-Algorithms
CS10C/Lab9/Program4/Jug.cpp
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <iterator> #include <queue> #include <stack> #include "Jug.h" using namespace std; Jug::Jug(int Ca, int Cb, int N, int cFA, int cFB, int cEA, int cEB, int cAB, int cBA) { capacityA = Ca; capacityB = Cb; ...
ALGO
0.999696
4.761543
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-07-25T03:48: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": "d3b5f2f45eab...
e2fc40ca-657b-4f67-a445-4f5207de8b1e
prwkhar/DSA_Hacker
LeetCode/GraphGeneral/NumberOfIslands/numisland.cpp
class Solution { public: int numIslands(vector<vector<char>>& grid) { int n = grid.size(); int m = grid[0].size(); vector<vector<int>> vis(n, vector<int>(m, 0)); int cn = 0; for(int row = 0; row < n; row++) { for(int col = 0; col < m; col++) ...
ALGO
0.999978
6.415299
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2024-05-20T12:54: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": "2b14c7d58e...
06422730-7098-4481-83b1-4b8ec607c60b
kaisar1232/Logic_Building
DoublyLL.cpp
#include<iostream> using namespace std; struct node { int data; struct node *next; struct node *prev; }; typedef struct node NODE; typedef struct node* PNODE; class DoublyLL { private: PNODE First; int iCount; public: DoublyLL(); void Display(); int Count...
ALGO
0.998914
4.826039
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-01-10T10:56: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": "a3c6b17df8e0...
99b16618-1723-4124-8c6f-a0650e4914ad
mach4101/wangdao_exercise
chapter_3/3.2.5/3.2.5_3_mach4101.cpp
// Created by mach4101 on 2022/6/24. /* * 使用两个栈来模拟队列,当队列元素入队时,可以将元素push到一号栈中,若需要出队,则将元素全部弹出来,push到二号栈中 * 此后,若需要入队,则push到一号栈,若需要出队,则从二号栈pop,若二号栈空了,那么就将一号栈中的元素全部弄到二号栈中 * 当栈一和栈二都空时,队列为空 * */ #include<iostream> using namespace std; # define MaxSize 100 // 栈相关代码定义 typedef struct Stack{ int data[MaxSize]; // 栈数组 ...
ALGO
0.997238
3.46159
{ "github_metadata": { "branch": "main", "commit_count": 149, "repo_created_at": "2022-03-14T07:07:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91f751bb3...
873e800e-d4c8-4577-bd86-e81e5967f296
shbm/competetive_coding
graph_dfs_bipartite.cpp
// GRAPH #include <stdio.h> #include <queue> #include <iostream> #include <iterator> #include <map> #include <vector> #include <string> #include <set> #include <climits> #include <unordered_map> #include <time.h> #include <climits> using namespace std; struct Edge { int src, dest; }; class Graph { public: ...
ALGO
0.999369
5.040335
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-05-13T11: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": "9800b33c8b...
c2fb6d64-6185-450e-8a6a-335c37ca04e1
dgxlsyd3/leetcode
C++/008.字符串转整数.cpp
#include <string> using namespace std; class Solution { public: int myAtoi(string str) { #define NUM 1 #define TXT 2 int sign = 1; int state = NUM; string snumber; for (size_t i = 0; i < str.length(); i++) { char c = str[i]; char cNext = -1; if (i<str.length()-1) { cNext = str[i + 1]...
ALGO
0.999553
3.981916
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2018-04-19T01:40: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": "29037cca1...
e69af4dc-5526-4f84-825c-3ab13dbcd994
dragonpilot-community/dragonpilot
rednose_repo/rednose/helpers/ekf_sym.h
#pragma once #include <iostream> #include <cassert> #include <string> #include <vector> #include <deque> #include <unordered_map> #include <map> #include <cmath> #include <optional> #include <eigen3/Eigen/Dense> #include "ekf.h" #include "ekf_load.h" #define REWIND_TO_KEEP 512 namespace EKFS { typedef Eigen::Matr...
ALGO
0.942563
5.094253
{ "github_metadata": { "branch": "pre-build", "commit_count": 122, "repo_created_at": "2019-06-26T22:18:25.000Z", "is_fork": true, "is_org_owned": true, "forked_from": "commaai/openpilot", "stars": 514, "forks": 296, "issues": 0, "pull_requests": 0 }, "file_meta": { "co...
ef2eff6a-aadc-4670-86d5-f2bc6a96d529
sddyates/mars-cpp
src/reconstruction.hpp
#pragma once #include <algorithm> #include <math.h> #include "grid.hpp" #include "data_column.hpp" inline void minmod(dataColumn &c, double dxi) { /* * Obtain the left and right hand states from linear extrapolation * and apply the minmod limiter. */ int var; int i; double a; double...
ALGO
0.999173
6.5656
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-02-12T11:05:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "bb9a2624e8...
f21c0a01-3488-49e1-a633-0ca4157ac57a
KonstantinTomashevich/CSDS
Lab2/Shared/RSA.cpp
#include "RSA.hpp" #include <boost/multiprecision/miller_rabin.hpp> #include <boost/integer/mod_inverse.hpp> #include <boost/random.hpp> namespace RSA { static boost::multiprecision::uint128_t random_prime () { boost::random::mt11213b base_gen (clock ()); boost::random::independent_bits_engine <boost::random:...
ALGO
0.997546
6.238864
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2020-09-06T10:00: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": "1b0e7cc48...
8a7a3c3f-fe85-4900-8f35-a385f204d5e5
KraitOPP/Codeforces
B_2_K_for_the_Price_of_One_Hard_Version.cpp
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; //using namespace __gnu_pbds; //typedef tree< // pair<int, int>, // null_type, // less<pair<int, int>>, // rb_tree_tag, // tree_order_statistics_node_update> // ordered_multiset; #define fasti...
ALGO
0.999976
3.784446
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-11T19:14: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": "b4035186c681...
230f0526-726a-48bc-bc1f-3132491ddcef
arvindchauhan1/a2z-dsa
temp/second-largest-number.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution { public: // Function returns the second // largest elements int print2largest(int arr[], int n) { int g = INT_MIN, res = INT_MIN; for (int i = 0;...
ALGO
0.999958
5.603867
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2023-03-27T15: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": "95373b6a2bb...
061ee04f-b1a5-411d-bf93-5275265486bf
darrenstarr/NetworkingForDevs
05 - Routing Table/readtable.cpp
#include <iostream> #include <string> #include <vector> #include <cstring> #include <unistd.h> #include <sys/socket.h> #include <net/if.h> #include <linux/rtnetlink.h> // Structure to hold route information struct RouteInfo { std::string destination; // Destination IP address std::string gateway; // Gatewa...
TOOL
0.919831
6.085819
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-01-14T14:18:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5f88229a653...
7139e444-89ea-4115-a303-69bc524d881f
ShelyH/LeetCode
src/2023512两数相加.cpp
#include <iostream> #include "../include/链表.h" #include "vector" using namespace std; class Solution { public: ListNode *createList(const vector<int> &v) { ListNode *head = nullptr; ListNode *tail = nullptr; for (int i = 0; i < v.size(); i++) { ListNode *node = new ListNod...
ALGO
0.999949
5.47104
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-20T02:48: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": "e811e9be37c5...
1e1d90a7-b8db-481f-a14f-489e507c4953
hades42/CompetitiveProgramming
BitMask(CF)/JohnnyAndHisHobbies.cpp
#include <bits/stdc++.h> #define ll long long const ll MOD = 1000000007; const ll INF = 1e18; using namespace std; template<typename T> void print(const T& t) { std::copy(t.cbegin(), t.cend(), std::ostream_iterator<typename T::value_type>(std::cout, " ")); cout << endl; } template<typename T> void print2d(con...
ALGO
0.999964
3.991723
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2021-05-10T14:49:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "073707f0a5d...
df28fbc1-7dd9-49ec-9928-dc55bc79adef
trungkien2003ntk/C-learning
Drafts/BTbasic/bangso/bangso/baiDat.cpp
#include <iostream> #include <string> #include <math.h> using namespace std; int ptich(long long k, int n) { int q = 0; while (n * pow(2, q) <= k) q++; return q - 1; } int baitapDat() { long long k; string s; cin >> k >> s; int n = s.size(); if (k <= n) cout << s[k - 1];...
ALGO
0.999931
3.326144
{ "github_metadata": { "branch": "main", "commit_count": 338, "repo_created_at": "2021-10-07T11:18:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1119dadc3a...
6f63b113-c8a6-4b2e-9db8-39392e565720
Sd-Invol/shoka
TheWaySoFar-Training/Previous/2011-NEERC/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 200005; int n , m , K , t; bool live[N]; bool sex[N]; int f[N + N]; int getf(int x) { return f[x] == x ? x : f[x] = getf(f[x]); } map<int , int> h; void work() { int i , j , x , y; char str[10]; scanf("%d",&n); for (i...
ALGO
0.999935
4.323349
{ "github_metadata": { "branch": "master", "commit_count": 348, "repo_created_at": "2013-10-04T08:20:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 11, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "8341b0...
5b3573e7-ba85-411c-8e5e-0e0bbc7b9507
jigjnasu/codility
exercises/chapter_2/example_2.cpp
/* https://app.codility.com/programmers Chapter 2 Exercise 1. Solution by <NAME>, cpp.rakesh(at)gmail.com Date: 15/03/2018 */ #include <bits/stdc++.h> #include <random> using namespace std; void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; } void reverse(vector<int>& v) { int i = 0; in...
ALGO
0.998896
4.684038
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2018-03-13T04:40: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": "0b4e520f8...
f0b017b5-adba-46d4-9b09-53301c11d9f8
BellisL/CodingInterviews
KLeastNums/main.cpp
#include "ArrayUtils.h" #include <iostream> #include <set> typedef std::multiset<int, std::greater<int>> Set; typedef std::multiset<int, std::greater<int>>::iterator SetIter; void leastKNums_1(int* vpData, int vLength, int vK); void leastKNums_2(int* vpData, int vLength, Set& vSet, int vK); void test(const char* vpTe...
TEST
0.998769
5.634363
{ "github_metadata": { "branch": "main", "commit_count": 96, "repo_created_at": "2021-01-23T07:28: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": "3ce1fd06904...
3c2539e0-83f9-4085-99b1-28c5a27c685d
YRTang/CS219_Gpufit_ACC
Gpufit/examples/c++/myProject/mp_solver_example.cpp
#include "../../../Gpufit/gpufit.h" #include "mp_solver.h" #include "csv_reader.h" #include <vector> #include <random> #include <iostream> #include <math.h> #define CSV_PATH "../Gpufit/examples/c++/myProject/sample_input.csv" void mp_solver_example(mp_profile_t *mp_profile, mp_config_t *mp_config) { // number of fit...
ALGO
0.901662
5.904774
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-06-04T21:28: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": "0ce4e7b96bf...
c020b4bf-bc06-4281-b93c-7312a9bc50a9
ssafy11-study/algorithm
src/week2/1238_1조_배선영.cc
#include <iostream> #include <vector> #include <queue> #define MAX 1002 using namespace std; vector<pair<int, int>> v[MAX]; int N, M, X; int maxPrice = -1; // 비용 갱신 int result = 0; int dis[MAX] = { 0 }; // 파티 참석 후 마을로 돌아오는 거리 저장 void init() { for (int i = 0; i < MAX; i++) { dis[i] = 987654321; } } vo...
ALGO
0.999853
5.032916
{ "github_metadata": { "branch": "main", "commit_count": 120, "repo_created_at": "2024-02-17T08:42:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4584cbec73f...
4711a4b9-3295-4102-8d84-3bd24943a9df
Exr0nProjects/learn_cpp
problems/xjoi.net/7998/dp_fail.cpp
/* * Problem #7998 * work division */ #include <bits/stdc++.h> // includes "everything" #include <iostream> #include <cstdio> #define ll long long #define dl double #define cn const int using namespace std; const int MAXSZ = 30; cn INF = 1000000000; int cost[MAXSZ][MAXSZ]; // cost of jobs int state[MAXSZ][MAXSZ]...
ALGO
0.999592
3.333865
{ "github_metadata": { "branch": "master", "commit_count": 2744, "repo_created_at": "2019-04-07T20:47:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b2bd950...
77942a70-da3c-479f-8677-1cb7962e2b3e
weidai11/cryptopp
zdeflate.cpp
// zdeflate.cpp - originally written and placed in the public domain by <NAME> // Many of the algorithms and tables used here came from the deflate implementation // by <NAME>, which was included in Crypto++ 4.0 and earlier. I completely // rewrote it in order to fix a bug that I could not figure out. This code // is ...
ALGO
0.998386
6.194211
{ "github_metadata": { "branch": "master", "commit_count": 6471, "repo_created_at": "2015-06-03T21:53:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5163, "forks": 1564, "issues": 58, "pull_requests": 17 }, "file_meta": { "content_id": ...
e6f0cda6-64c1-40a6-9f13-909405a5602d
akshanshgusain/data_structures_algorithms
BinaryTree/BT_036.cpp
// // Created by <NAME> on 05/03/24. // #include "BT_000.cpp" vector<vector<int>> paths; void hasPathSum(TreeNode *root, int targetSum, vector<int> currentPath) { if (root == nullptr){ return; } if (root->right == nullptr && root->left == nullptr) { if (targetSum == root->val) { ...
ALGO
0.999773
5.778409
{ "github_metadata": { "branch": "master", "commit_count": 153, "repo_created_at": "2022-07-21T10:11:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d7dd9240...
6bdfc178-fa79-4546-91c5-0df38b5cada0
0Aaraiz0/24K-0620-C-OOP
Lab 11/1.cpp
#include <iostream> #include <exception> #include <string> using namespace std; class DimensionMismatchException : public exception { string message; public: DimensionMismatchException(int r1, int c1, int r2, int c2) { message = "DimensionMismatchException - Matrices must have same ...
ALGO
0.935967
5.413418
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2025-01-29T10:56: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": "b3bf7e6274f...
e8dde598-8bac-4725-ad83-af837da1fba1
lostoy/globalOp
Matrix2Quat/Matrix2Quat/main.cpp
#include <Eigen/Core> #include <Eigen/Geometry> #include <iostream> #include <fstream> #include <vector> #include <map> #include <boost/algorithm/string.hpp> #include <boost/filesystem.hpp> typedef Eigen::Matrix< float, 7, 1,0,7,1 > Vector7f; typedef Eigen::Matrix<float, 6, 6,0,6,6> information; Vector7f matrix2qua...
DATA
0.991948
4.515796
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2014-03-30T14:33: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": "3f098734d6...
ca8dbaa5-dccf-414a-8e16-b05fd8252fbf
shynt-04/CodeAtHighSchool
BonusContest/2022-02-14/CYCLETOUR/CYCLETOUR.cpp
#include<bits/stdc++.h> #define Task "CYCLETOUR" #define pb push_back #define F first #define S second using namespace std; const int maxn = 200005; int n, m; vector<pair<int, int> > adj[maxn]; namespace Sub1 { struct EDGE { int u, v, t; } ed[25]; int used[25], in[25], vis[25], res; int Calc(int mask...
ALGO
0.999817
3.368617
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-02-14T11: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": "c163c946f73b...
a7a52a33-ebef-4b68-a17e-b54e2b45c85c
arne182/ArnePilot
phonelibs/qpoases/SRC/QProblem.ipp
/* * This file is part of qpOASES. * * qpOASES -- An Implementation of the Online Active Set Strategy. * Copyright (C) 2007-2008 by <NAME> et al. All rights reserved. * * qpOASES is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published ...
ALGO
0.993598
6.170725
{ "github_metadata": { "branch": "release5", "commit_count": 1263, "repo_created_at": "2018-02-09T13:22:17.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "commaai/openpilot", "stars": 183, "forks": 57, "issues": 2, "pull_requests": 0 }, "file_meta": { "co...
587925e6-0419-483d-a7c8-d11ee1670e3c
anchitd10/Leetcode
Binary Search/Problem-2594.cpp
// Problem-2594: Minimum Time to Repair Cars // You are given an integer array ranks representing the ranks of some mechanics. ranksi is the rank of the ith mechanic. A mechanic with a rank r can repair n cars in r * n2 minutes. // You are also given an integer cars representing the total number of cars waiting in the...
ALGO
0.999981
6.254241
{ "github_metadata": { "branch": "main", "commit_count": 414, "repo_created_at": "2024-07-04T17:14:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "611ffbdb37...
de8c16b0-037c-4d80-b363-f4631e5623b4
JMFrancia/Dijkstra-Graph-Search
BinaryHeap.h
/* Assignment 5: Dijkstra <NAME> Binary Heap class from Data Structures and Analysis in C++ by <NAME>, modified to use a hash table in order to have the operations increasekey(comparable, int), decreasekey(comparable, int), and remove(x) in O(logn) time. CONSTRUCTION: with an optional capacity (that defaults to 1...
ALGO
0.999898
5.671822
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-01-18T20:18:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0976b30a4a...
5a7a4e6b-b1ba-4823-ba76-0e0612aa8aac
AnthonyMarkD/Cmput-379-Assignment-1
luke.cpp
#include <cstdio> #include <cstdlib> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <signal.h> #define LINE_LENGTH 100 #define MAX_ARGS 7 #define MAX_LENGTH 20 #define MAX_PT_ENTRIES 32 char* getInput() { printf("ENTRY 3.1"); char* input; printf("ENTRY 3.2"); while(fgets(input, ...
TOOL
0.97077
3.523605
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-02-02T22:54:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57d90ecb1d...
620342f2-06d3-452a-bc15-ddf492b7df1a
JMAK13/McIntyreJosh_CSC_7_Spring2018
Projects/MasterMind/main.cpp
/* * File: main.cpp * Author: <NAME> * Created on April 15, 2018, 4:06 PM */ //Global Constants //System Libraries #include <iostream> #include <ctime> #include <cstdlib> using namespace std; //User Libraries //Function Prototypes bool used(int[],int,int); //Main Function int main(int argc, char** argv) { ...
ALGO
0.957269
3.439038
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2018-02-28T19:03: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": "e70b3f744...
39cf68cc-fff5-47e7-80f0-7e46d9e7bc72
ranjeetkumar0703/snake-game
snk.cpp
#include <conio.h> #include <stdio.h> //#include <stdlib.h> //#include <unistd.h> #include<graphics.h> int i, j, height = 25, width = 25; int gameover, score; int x, y, fruitx, fruity, flag; int tailx[100],taily[100]; int countTail=0; void setup() { gameover = 0; x = height / 4; y = width / 4; label1: fruitx = ...
ALGO
0.995491
3.537878
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-01-29T09:08:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7463926daa6b...
4d762d57-9205-491f-9357-1007211d2f61
anishakd4/ds
Stack/OperationsOnStack/6SortingArrayUsingStacks.cpp
#include<iostream> #include<stack> using namespace std; void printArray(int arr[], int n){ cout<<"Array: "<<endl; for(int i=0; i<n; i++){ cout<<arr[i]<<" "; } cout<<endl; } void printStack(stack<int> st){ cout<<"Stack: "<<endl; while(!st.empty()){ cout<<st.top()<<" "; ...
ALGO
0.999961
5.589675
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2019-09-28T08:46:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b2eea2e...
35f1f2a4-140a-402b-a934-e21b14d6415d
Haow235/Interview-Oriented-Algorithm-Practice
lc473.cpp
class Solution { public: bool makesquare(vector<int>& nums) { int n = nums.size(); if(n<4) return false; int total_length = 0; for(int num: nums) { total_length+=num; } if(total_length%4) return false; ...
ALGO
0.999455
5.523225
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2020-10-19T03:24: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": "6638652dd...
a59c4f58-f6e8-46be-8a1c-0e5f2e38e426
amna-asa/UOL-compitition-line-follower-robot
code.cpp
```C++ //right motor int r_enR = 30; int l_enR= 28; int r_forward = 4; int r_backword = 5; //left motor int r_enL= 32; int l_enL = 34; int l_forward= 3; int l_backword = 2; //sensors code int smrv=12; int srv=11; int scv=10; int slv=9; int smlv=8; //speeds control int speed=100; int turn=100; int slow=100; int st...
ALGO
0.938214
4.628957
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-05-31T20:08: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": "a357576d2cc6...
a0dbbd5e-431c-4f0c-9b47-79457bae5347
KekKekovich/PointVector
main.cpp
#include <iostream> #include <vector> #include <cstdlib> #include <cmath> #include <map> #include <algorithm> #include <string> #include "Point.h" using namespace std; const int N=5; Point printv(vector<Point> A) { cout << endl; for (int i=0; i<A.size(); i++){ A[i].print(); } } void closest(vec...
ALGO
0.999501
3.975336
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-12-14T17:42: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": "a90f106d92...
071c77cf-cb91-4e14-b0f4-a86696cbafcc
bhatsajid18/DsaInCpp
32. Hashing/soduku.cpp
// #include<iostream> // #include<map> // #include<vector> // #include<utility> // using namespace std; // #define vi vector<int> // #define pii pair<int,int> // #define vii vector<pii> // #define rep(i,a,b) for(int i=a;i<b;i++) // void helper(int r, int c, vector<vector<char> > &a,map<pair<int,int>, map<int,int> > &m...
ALGO
0.999196
5.164793
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2023-07-23T06:32:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7057ab0b82...
a0036103-323d-481a-93bb-65206fe2cf8b
perilouswithadollarsign/cstrike15_src
engine/debug_leafvis.cpp
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // // $NoKeywords: $ // //===========================================================================// #include "render_pch.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" #includ...
ALGO
0.950619
5.612299
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-04-22T23:35:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1543, "forks": 729, "issues": 3, "pull_requests": 1 }, "file_meta": { "content_id": "f9dd...
17a44091-6edf-4a42-b111-fceb68a7365f
shivangisahay14/450questions-array
longest consecutive sequence.cpp
class Solution { public: bool array_contains(vector<int>& nums, int num) { for (int i = 0; i < nums.size(); ++i) { if (nums[i] == num) return true; } return false; } int longestConsecutive(vector<int>& nums) { int res = 0; for (in...
ALGO
0.999983
6.036438
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2020-10-19T17:56: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": "b4c6a90958b...
357c5c6a-9874-4fdb-9a99-0369ce5c18ca
axelu/leetcode
cpp/02000-02499/numberofbeautifulpartitions.cpp
// 2478. Number of Beautiful Partitions // https://leetcode.com/problems/number-of-beautiful-partitions/ class Solution { private: long mod = 1000000007; long mem[1000][1001]; bool isPrime(char c) { return c == '2' || c == '3' || c == '5' || c == '7'; } long rec(const string& s, const...
ALGO
0.999953
5.40234
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2021-04-08T21:22: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": "a56c2ec5d6d...
c0027c28-cf80-4087-879c-6f9ae9cb3592
ifradK/Competitive-Programming-Solutions
C++ Programs/052 Rendezvous.cpp
#include<iostream> #include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl '\n' using namespace std; int matrix[50][50]; void floydWarshall(int node) { int i,j,k; for(k=1; k<=node; k++) { for(i=1; i<=node; i++) { for(j=...
ALGO
0.999943
3.914359
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-04-21T13:25: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": "a13a899cb533...
302a1e58-c6ef-468e-a5af-00ce47362e52
AparnaJuhi/Coding
MaximumValueofDiffOfAPairOfElementsAndTheirIndex.cpp
//Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: int maxValue(int a[], int N) { // add their index in value of each number if(N<2) return 0; int arr[N]; int brr[N]; ...
ALGO
0.999893
5.105322
{ "github_metadata": { "branch": "master", "commit_count": 230, "repo_created_at": "2020-07-28T14:32: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": "f3d685ee...
44a07e7a-cf27-49f5-aca4-e855d0479120
seirion/code
codeforces/intell_code_2016/elimination/2/main.cpp
#include <iostream> #include <cstdio> #include <string> #include <cstring> using namespace std; int n; int in[100]; bool ok(char *buffer, int x) { int size = strlen(buffer); int r = 0; for (int i = 0; i < size; i++) { char &c = buffer[i]; switch (c) { case 'a': ca...
ALGO
0.999874
3.6748
{ "github_metadata": { "branch": "master", "commit_count": 677, "repo_created_at": "2014-03-11T05:33:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3d05259...
e1b4995b-a52f-4f84-8d3f-46d4b3724515
MitMaro/MUN-School-Work
en1200/spring2013/assignments/a7/assign7.cpp
/************************************************************************* * Memorial University of Newfoundland * Engineering 1020 Structured Programming * Assignment 7 * * Author: <NAME> * Student #: ######### * E-mail (@mun.ca): <EMAIL> * Lab section: 02 * Due date: 2013.07.15 * * assign7.cpp -- makes the...
ALGO
0.991202
4.417521
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2010-11-28T17:34:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd6aa6c1c...
23997126-b72b-448e-92a5-f37faf8477b9
aaronabraham311/C-Practice
grade9/functions/collision.cpp
#include <iostream> #include <fstream> using namespace std; // Setting up prototypes float position (float, float); bool inBetween (float, float, float); int main() { // Declaring variables float userVelocity, userTime, userLowerBound, userUpperBound, userDistance; float currentTime = 0; float change...
ALGO
0.907243
5.573535
{ "github_metadata": { "branch": "master", "commit_count": 131, "repo_created_at": "2017-06-23T03:23: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": "29b41a89...
b2370178-d32b-425a-b95d-9d1415690683
baimao123456/LeetCode
224-简单计算器.cpp
/* 简单计算器 */ #include <stdio.h> #include <stack> #include <string> using namespace std; void compute(stack<int> &number_stack, stack<char> &operation_stack) { if(number_stack.size() < 2) // 数字至少为2,否则无法计算 return; int num2 = number_stack.top(); //取出两个数,进行计算 number_stack.pop(); int num1 = number_st...
ALGO
0.999993
4.041842
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2018-06-09T13:54: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": "bf8cc08a88...
986f6cea-93f0-4532-a77a-4c863fe51de8
DevinLeamy/Competitive-Programming
Problems/CodeForces/1600_CelexUpdate.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <set> #include <map> #include <string> #include <iomanip> #define INF 2147483647 #define LINF 9223372036854775807ll #define scan(x) do{while((x=getchar_unlocked())<'0'); for(x-='0'; '0'<=(_=getchar_unlocked()); x=(x<<3...
ALGO
0.99958
4.080207
{ "github_metadata": { "branch": "master", "commit_count": 668, "repo_created_at": "2019-07-30T02:33: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": "dd73625c...
9ddc8f28-d1ec-4b8a-9c2e-44d68e0869d1
bound1ess/codeforces-problemset
454/b.cpp
#include <cstdio> const int N = 123456; int a[N]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; ++i) { scanf("%d", a + i); } bool ok = true; int pos; for (int i = 0; i < n - 1; ++i) { if (a[i + 1] < a[i]) { pos = i + 1; ok = false; break; } } if (ok) { ...
ALGO
0.999969
3.487995
{ "github_metadata": { "branch": "master", "commit_count": 364, "repo_created_at": "2015-05-14T09:32:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1b2eb1f...
13503ff0-9329-4b5f-a713-e6c4c3320662
ihyunbeom/Algorithm
Baekjoon/2908.cpp
/* 문제 상근이의 동생 상수는 수학을 정말 못한다. 상수는 숫자를 읽는데 문제가 있다. 이렇게 수학을 못하는 상수를 위해서 상근이는 수의 크기를 비교하는 문제를 내주었다. 상근이는 세 자리 숫자 두 개를 칠판에 써주었다. 그 다음에 크기가 큰 수를 말해보라고 했다. 상수는 수를 다른사람과 다르게 거꾸로 읽는다. 예를 들어, 734과 893을 칠판에 적었다면, 상수는 이 수를 437과 398로 읽는다. 따라서, 상수는 두 수중 큰 수인 437을 큰 수라고 말할 것이다. 두 수가 주어졌을 때, 상수의 대답을 출력하는 프로그램을 작성하시오. 입력 첫째 줄에...
ALGO
0.999937
3.753204
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-09-25T11:51: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": "dbb22d5e45...
ba84054b-a59a-4488-8240-4f007284a0b1
OpenFOAM/OpenFOAM-dev
applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.h
/* * Progressive Mesh type Polygon Reduction Algorithm * by <NAME> (c) 1998 * * The function ProgressiveMesh() takes a model in an "indexed face * set" sort of way. i.e. list of vertices and list of triangles. * The function then does the polygon reduction algorithm * internally and reduces the model all ...
ALGO
0.98081
5.829193
{ "github_metadata": { "branch": "master", "commit_count": 8589, "repo_created_at": "2014-12-10T15:47:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1770, "forks": 642, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "39...
5d585417-9dbf-45a9-bbab-d67bcf08dcd7
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/04/0411/personal_submission/cf1592c_hopeworse.cpp
//link https://codeforces.com/contest/1592/submission/256061412 void solve() { int n, k; cin >> n >> k; vector<int> arr(n + 1); int xorr = 0; for (int i = 1; i <= n; i++) { cin >> arr[i]; xorr ^= arr[i]; } VII mp(n + 1); for (int i = 1; i < n; i++) { int u, v; ...
ALGO
0.999991
5.065041
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "266a...
19158b82-ee17-410f-a6f8-92d0e1516965
aribambang/clinkz
003 - Linked Lists/001-LinkedList.cpp
#include <iostream> using namespace std; class Node { public: int value; Node *next; Node(int value) { this->value = value; next = nullptr; } }; class LinkedList { private: Node *head; Node *tail; int length; public: LinkedList(int value) { Node *newN...
ALGO
0.999504
4.980968
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2024-08-29T16:23: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": "5048065d6...
68f34cf9-3e54-42ad-b5a6-33625c15ef6a
ramalloc/A2Z-DSA
Step-4/BS14.cpp
// Smallest Divisor - Find the Smallest Divisor Given a Threshold /* -> We given an array which is consisting some integers and a threshold value. -> We have to return a number which become divisor and divide each element of array (gives ceil value) and sum of the ceil values should not greater then the given thr...
ALGO
0.999972
6.115669
{ "github_metadata": { "branch": "main", "commit_count": 96, "repo_created_at": "2023-06-07T10:02: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": "b18692c782a...
948ac3e3-b98e-47e1-8fb3-e9098538ba4e
cherrytomato1/C-Algorithm
visual_studio_0001~0054/알고리즘/0042_200527_1699_제곱수의 합.cpp
/* 제곱수의 하ㅣㅂ 1. 제곱수의 합으로 나타내었을 때 가장 큰 제곱수가 더해진다고 가장 적은 횟수만큼 더하는게 아닐 수 있다 ex) 12 = 3^2 +1^2+1^2+^2 = 4^2 + 4^2 + 4^2 2. 따라서 해당 값을 이룰 수 있는 제곱수들을 구하고 그 제곱수를 연산하게될 때 가장 적은 계산 수를 갖는 수를 찾는다 2.1 d[n] = min( d[n-1^2], d[n-2^2] ,d[n-3^2] .... d[n-i^2](단 n>= i^2)) 2.2 ex) 12 = min(12-1, 12-4, 12-9) +1 3. 해당 수보다 작은 제곱수부터...
ALGO
0.999904
3.937366
{ "github_metadata": { "branch": "master", "commit_count": 143, "repo_created_at": "2019-10-06T18:07: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": "e7860cec...
f9447599-7d70-4dbb-8823-3f1a64273a77
DhatriBY/Networks-Socket
client.cpp
#include <bits/stdc++.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/types.h> #include <unistd.h> #include <dirent.h> #include <fstream> #include<thread> #include <vector> #include <string> #include <filesystem> using namespace std; #define LOOPBACK_IP "127.0.0.1" int sendall(i...
TOOL
0.985853
3.730192
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-08-16T13:04: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": "3c0ff24530...
5c835938-4a35-46e9-9e65-903b76067848
byungmeo/WantedAlgorithm
김병대/73일차/boj-11637.cpp
// g++ .\main.cpp -o a -O2 -Wall -lm -static -std=gnu++11 -DONLINE_JUDGE -DBOJ "-Wl,--stack,4294967296" #include <iostream> #include <algorithm> #include <bitset> #include <climits> #include <queue> #include <stack> #include <string> #include <string.h> #include <set> #include <map> #include <math.h> #include <unordere...
ALGO
0.999993
4.172903
{ "github_metadata": { "branch": "main", "commit_count": 377, "repo_created_at": "2024-12-04T23:18: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": "3ab39257d6...
9f54df8b-631e-45d1-90c0-7be3b8751ec8
Anna-Sobchuk/coursework4
Client/ClientProgram.cpp
#include <iostream> #include <asio.hpp> #include <regex> #include <string> #include <vector> #include <algorithm> #include <unordered_map> #include <unordered_set> namespace ClientMessager { void Send(asio::ip::tcp::socket &socket, const std::vector<std::string> &words) { try { // Send the size...
WEB
0.989353
5.261339
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-10-26T09:34: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": "7eb293a2d79...
4f766571-8cfc-475b-8306-c355a99fe107
abhishekkujur1307/Project-Euler-Solutions
src/001.cpp
#include <iostream> using namespace std; int main() { unsigned long long t, n, sum = 0; cin >> t; for (int i = 1; i <= t; i++) { cin >> n; unsigned long long a, b, c; a = (n % 3 == 0 ? (n / 3) - 1 : n / 3); b = (n % 5 == 0 ? (n / 5) - 1 : n / 5); c = (n % 15 == ...
ALGO
0.999795
3.959527
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-09-01T17:48: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": "843f1f6d3...
57497ef9-651c-49cb-bd20-9c594eaf3f55
namangarg2002/Cpp-Foundation-Course-Supreme-2.0
codehelp/W14_Binary_Search_Tree/3_class3.cpp
#include <iostream> #include <queue> using namespace std; class Node { public: int data; Node *left; Node *right; Node(int val) { this->data = val; this->left = NULL; this->right = NULL; } }; // Node *insertIntoBST(Node *root, int data) // { // if (root == NULL) // { // return new Nod...
ALGO
0.999951
4.848982
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-02-16T11:46: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": "d2b12c53728b...
37750075-5331-495f-9760-b316cb3719be
chriswengqi/kattis
cats/cats.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<char> vc; typedef unsigned long long ull; typedef pair<int, int> pii; typedef vector<pair<int, int>> vpii; typedef tuple<int, int, int> ii...
ALGO
0.999922
5.447022
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-08-13T15:12: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": "fd03f1a7b64d...
e6044d23-a13b-462f-915d-77dbeb8e1ecc
raincross7/code-similarity
codes/train_code/problem295/problem295_192.cpp
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); typedef long long ll; typedef vector<int> vi;; typedef vector<ll> vll; #define l() length() #define sz() size() #define b() begin() #define e() end() #define all(x) x.begin(...
ALGO
0.999923
3.832351
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b085bfe7255d...
d8ca7575-c934-48d6-9fa9-f658e760edc3
GonzaloVega26/Proogramacion_1
Decisiones/comparaciones_numeros.cpp
#include <program1.h> /** * Enunciado: */ principal // Unidad de programa principal limpiar; // Limpia la pantalla. real a,b,c; leerM(a,"Valor A:"); leerM(b,"Valor B:"); leerM(c,"Valor C:"); mostra...
ALGO
0.999709
3.411413
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-10-06T15:38: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": "1ac131af24a...
af9b1774-1706-435a-8e46-06c1f1e540cd
ishandutta2007/codeforces-k
khuepr123/normal/1519/C.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define fi first #define se second #define endl "\n" #define ii pair<int, int> #define PI 3.141592653589793238462643383279502884 #define ll long long #define for1(i, ff, gg) for(int i = ff; i <= gg; ++i) #define for2(i, ff, gg) for...
ALGO
0.99988
3.428332
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1776c2db120...
8e6a84eb-e3f3-4433-903e-9f0235952478
dmlc/dgl
src/array/cpu/segment_reduce.h
/** * Copyright (c) 2020 by Contributors * @file array/cpu/spmm.h * @brief Segment reduce kernel function header. */ #ifndef DGL_ARRAY_CPU_SEGMENT_REDUCE_H_ #define DGL_ARRAY_CPU_SEGMENT_REDUCE_H_ #include <dgl/array.h> #include <dgl/base_heterograph.h> #include <dgl/runtime/parallel_for.h> #include <string> #in...
ALGO
0.998532
6.389055
{ "github_metadata": { "branch": "master", "commit_count": 4416, "repo_created_at": "2018-04-20T14:49:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13984, "forks": 3049, "issues": 444, "pull_requests": 134 }, "file_meta": { "content_id"...
1d9d3a0a-49f8-4a1b-abef-d2ca458449c7
adumbidiot/CS477
HW6/schedule.cpp
#include <climits> #include <iostream> #include <stdint.h> void print_c(int *c, int n) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int x = c[(i * n) + j]; std::cout << x << " "; if (x < 10) std::cout << " "; } std::cout << "\n"; } } int main() { int x[] = ...
ALGO
0.999971
3.87191
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-05-10T18:00: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": "625f865e9e11...
68d63368-4951-4d86-9f56-d17bc97fee26
techtobit/CSE-Fundamentals-Professional-Course
Algorithms/Module16_MidExam/5_KnightMoves.cpp
#include <bits/stdc++.h> using namespace std; #define pi pair<int, int> const int N = 1005; int grid[N][N]; bool vist[N][N]; int dist[N][N]; int n, m, si, sj, qi, qj; vector<pi> path = {{-1, 2}, {1, 2}, {2, 1}, {2, -1}, {-1, -2}, {1, -2}, {-2, 1}, {-2, -1}}; bool isValid(int cI, int cJ) { return (cI >=0 && cI < n...
ALGO
0.999928
4.236873
{ "github_metadata": { "branch": "main", "commit_count": 447, "repo_created_at": "2023-04-01T18:13:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b6a2b74c3...
d9aab811-117d-4249-8241-3f02d0c9a0b8
umar-qureshi2/UG-Courses
sem5/Operating System Dr Hammad/Operating System Bs 15/Labs/Lab 5/Capt Raza Lab 5 Complete/p Complete.cpp
#include<iostream.h> #include<stdio.h> #include<conio.h> struct pro { int id; int ts; bool block; pro *next; }; class execute { public: pro *front; execute() { front=NULL; } void add(int i,int t,bool b) { pro *p=new pro; p->id=i; p->ts=t; p->block=b; p->next=NULL; if(front==NULL) ...
ALGO
0.998737
3.947042
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-07-18T08:09:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfba1ad235...
bafe42b7-0741-4b1d-8e40-08c29311263c
ishandutta2007/codeforces-p
pavel.savchenkov/normal/522/D.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <set> #include <map> #include <utility> #include <cstdlib> #include <memory> #include <queue> #include <cassert> #include <cmath> #include <ctime> using namespace std; #define pb push_back #defin...
ALGO
0.999976
4.265862
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49: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": "17f34dc76b2f...
c5bf9cc6-31e5-4a57-a433-6ebe36239c4a
KanaevaEkaterina/Projects.2012-1
First term/Joseph Problem/ringList.cpp
#include <stdio.h> #include <iostream> using namespace std; typedef int ElementType; struct CircleListElement { bool life; ElementType value; CircleListElement * next; }; struct CircleList { CircleListElement * head; CircleListElement * tail; int count; }; CircleList * createCircleList() { CircleList * star...
ALGO
0.99948
3.908661
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2012-03-02T19:14: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": "eb85b51f0...
f67638c5-506d-499b-9dff-eacfa36983c4
BGboy-bit/vscode
c++/codeforces/contest/1996/C.cpp
#include<bits/stdc++.h> using namespace std; typedef __int128 i128; typedef long long ll; typedef double db; const db PI = acos(-1); typedef array<ll, 2> PII; // vector<PII> a(n + 1); const ll inf = 2e18 + 10; const int mod = 998244353; const int maxn = 2e5 + 10; bool multi = 1; void Solve() { ll n, q; cin >> n >...
ALGO
0.999916
4.835196
{ "github_metadata": { "branch": "main", "commit_count": 132, "repo_created_at": "2024-03-12T15:07: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": "78810d3326...
f2cba3ee-f386-4869-a524-cfc3022f6ebd
weiyuan2020/downbrust
src/GeneralFuncs.cpp
/* * @Author: L.F.Wang * @Date: 2021-04-26 09:46:25 * @Last Modified by: weiyuan * @Last Modified time: 2021-08-01 21:04:25 */ #include "GeneralFuncs.h" namespace MATH { int toBinaryNum(int num, const int& len, char* bi) { if (pow(2.0, len) < num) return 1; int i = 0; whi...
ALGO
0.999927
4.275885
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-09-24T16:58: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": "8685e33f78...
a382208a-a17b-4f2b-809f-8e465875c936
kedar-24/dsa_Stuff
DynamicProgramming/knapsack.cpp
#include <iostream> using namespace std; int knapsack_1(int *weights, int * values, int n, int maxweight, int** output){ if(n < 0 ){ return 0; } if(output[maxweight][n] != -1){ return output[maxweight][n]; } if(weights[n] > maxweight){ output[maxweight][n] = knapsack_1(weig...
ALGO
0.999998
4.734056
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-07-25T06:15: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": "14b1d8d3b0...
778c710b-9977-4f7b-925d-0d2db99a5972
feddieminas/Programmr
Cpp/most_frequent_element.cpp
// // http://www.programmr.com/zone/cpp // // most_frequent_element.cpp // ProgrammrCpp // #include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { int N; //int most_frequent_element=='\0'; null int most_frequent_element=0; cout <<"Enter N (number of elemen...
ALGO
0.999836
4.321267
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-03-30T16:06:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a7f16bbdba...
57bc4276-e7aa-427a-933d-1c7bbe04f38a
mailtoharutyunyan/LeetCode-Solutions
solutions/2741. Special Permutations/2741.cpp
class Solution { public: int specialPerm(vector<int>& nums) { const int n = nums.size(); const int maxMask = 1 << n; int ans = 0; // dp[i][j] := # of special permutations where the previous number is // nums[i] and j is the used nums in mask dp.resize(n, vector<int>(maxMask)); for (int i...
ALGO
0.999968
5.846602
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-21T01:19: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": "9af682c021f8...
857f3426-422a-4770-ae09-35c3a6a2615e
harshit0703/DSA-Questions
Medium/DP/Unbounded Knapsack/recursive.cpp
#include<bits/stdc++.h> using namespace std; int unboundedKnapsack(int val[], int wt[], int W, int n){ if(W==0 || n==0){ return 0; } if(wt[n-1] > W){ return unboundedKnapsack(val, wt, W, n-1); } int included = unboundedKnapsack(val, wt, W-wt[n-1], n) + val[n-1]; int not_inclu...
ALGO
0.999966
4.432518
{ "github_metadata": { "branch": "main", "commit_count": 215, "repo_created_at": "2021-09-18T12:29: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": "b681f3d363...
001b9d8c-2a84-4ae0-813b-9ef60a2d4cc4
Ampelbein/aghermann
upstream/src/common/alg.hh
/* * File name: common/alg.hh * Project: Aghermann * Author: <NAME> <<EMAIL>> * Initial version: 2012-08-25 * * Purpose: misc supporting algorithms * * License: GPL */ #ifndef _AGH_COMMON_ALG_H #define _AGH_COMMON_ALG_H #include <valarray> #include <list> #if HAV...
TOOL
0.987747
5.973552
{ "github_metadata": { "branch": "master", "commit_count": 1481, "repo_created_at": "2013-08-25T19:23: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": "06cee78...
8cc76312-793a-48f2-a194-fc0f5d8aa211
anlzou/data-structure
chapters/chapter02_linear_list/code/exp2-1.cpp
/*** * @Date : 2020-11-10 19:17:50 * @LastEditors : anlzou * @Github : https://github.com/anlzou * @LastEditTime: 2020-11-10 19:18:59 * @FilePath : \data-structure\chapters\chapter02_linear_list\code\exp2-1.cpp * @Describe : */ #include "./struct/struct.h" /** * 整体简历顺序表 */ void CreateList(Sq...
ALGO
0.999165
3.690128
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2020-05-21T08: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": "757611538...
0fd42bc9-df30-440e-9230-ae9e9680971a
jsinwell/CS104-Work
hw6/avlbst.h
#ifndef AVLBST_H #define AVLBST_H #include "bst.h" #include <algorithm> #include <cstdlib> #include <exception> #include <iostream> struct KeyError {}; /** * A special kind of node for an AVL tree, which adds the height as a data member, plus * other additional helper functions. You do NOT need to implement any fu...
ALGO
0.981341
6.899989
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2022-01-29T20:45: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": "7d67eb99d...
bb1ddba3-7ca6-4a46-bd1d-f27a97938400
Yangsx-1/leetcode-c
0-500/0347.cpp
// finished in 2024.1.21 class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { unordered_map<int, int> umap; for (int i : nums) { umap[i] += 1; } vector<pair<int,int>> min_heap(k); for (const auto &it : umap) { if (it.second > m...
ALGO
0.999996
6.746178
{ "github_metadata": { "branch": "main", "commit_count": 155, "repo_created_at": "2022-01-04T11:40: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": "073b84343a...
a1fa7ecf-32eb-42bd-8534-a1df682d0dcb
anmolsmann/Data_Structures
queuefirst.cpp
#include <iostream> #define MAXLEN 100 using namespace std; typedef struct{ int element[MAXLEN]; int front, rear; }queue; queue init(){ queue Q; Q.front = Q.rear = -1; return Q; } int size(queue Q){ return(Q.rear - Q.front +1); } int isEmpty(queue Q){ return((Q.front==1) || (Q.front>Q.re...
ALGO
0.999152
3.792423
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-08-08T07: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": "0269a28b5dcc...
55c4e2ea-2345-47bf-b297-6d3c7d89bc78
jethroFloyd/graphics-362
polygon-filling/scan-conversion.cpp
#include <vector> #include <cstdio> #include <algorithm> #include <iostream> #include <GL/glut.h> void edgedetect(GLfloat x1,GLfloat y1,GLfloat x2,GLfloat y2,std::vector<std::vector<int>>& ael) { float mx,x,temp; int i; if((y2-y1)<0) { temp=x1; x1=x2; x2=temp; temp=y1; y1=y2; y2=temp; } ...
ALGO
0.969903
3.925435
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-04-19T01:52: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": "f0178aeb37...
17753231-da19-4e19-a566-eb2f51482b6b
nothepeople/drcr
src/ap_path.h
#ifndef AP_PATH_H_ #define AP_PATH_H_ #include <assert.h> #include <functional> #include <unordered_set> #include <vector> #include "bp_path.h" #include "graph.h" #include "shortest_path.h" class ApPath { public: virtual ~ApPath() {} // If bp_path_solver == nullptr, then ApPath only finds one path. virtual...
ALGO
0.997316
3.936933
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-05-07T03:43:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e753a40f9e...
56813e0d-c5a6-4f66-acbf-ffa1b7ee4a61
Strawberry9583/LeetCode
Contest/Contest_184/Contest_184/contest_184.cpp
#include<iostream> #include<string> #include<cmath> #include<algorithm> #include<vector> #include<list> #include<deque> #include<unordered_map> #include<unordered_set> using namespace std; class Solution1 { public: vector<string> stringMatching(vector<string>& words) { std::vector<string> result; for (int idx = 0...
ALGO
0.999856
4.548594
{ "github_metadata": { "branch": "master", "commit_count": 233, "repo_created_at": "2018-09-18T04:23: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": "78511039...
57f8c121-169d-409d-9c1e-0f69469f9530
sachajoy/Coding_Solutions
Coding Ninjas/variation.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, k; cin >> n >> k; vector<ll> v; ll x; for(ll i=0; i<n; i++){ cin >> x; v.push_back(x); } sort(v.begin(), v.end()); ll count = 0; for(ll i=0; i<n; i++){ ll temp = v[i]; ...
ALGO
0.999824
4.021865
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2020-05-01T05:34: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": "a0c186a5f...
77d91127-b1cf-4a8b-8d61-0c0de46177a7
nikitaramtri/Data-Structures-and-Algorithms
ds_bstinsertion&searching.cpp
// // ds_bstinsertion&searching.cpp // ds_5 // // Created by Radhika on 29/10/17. // Copyright © 2017 Nikita. All rights reserved. // #include<iostream> using namespace std; //creating node structure struct node{ int info; node * left; node * right; }*root = NULL; //function to create a new node no...
ALGO
0.999932
3.808332
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-07-13T12:08: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": "477c322aa1...
d7ee8711-738a-4c75-b9e9-55bbb6b58975
skempken/interverdikom
src/libivk/computation/MeanDivisionModeler.cpp
#include "MeanDivisionModeler.h" namespace ivk { MeanDivisionModeler::MeanDivisionModeler(const Trace* ptrData,const ComputationParameters &parameters) : AbstractDiscreteSSMPModeler(ptrData, parameters) { } MeanDivisionModeler::~MeanDivisionModeler() { } SSMProcess* MeanDivisionModeler::compute() { rvector trace...
ALGO
0.985007
5.030781
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2013-12-26T15:56: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": "c522a04891...