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
9fb47e43-c5fe-41b8-8ce3-f0577021cb1e
kodercrish/Urban-Crap
UC-Backend/src/main/java/com/example/UC_Backend/Extra/Graph.h
#include <vector> using namespace std; typedef pair<int, int> Edge; void initializeGraph(vector<vector<Edge> > &adjList) { vector<Edge> edges; edges.push_back(Edge(1, 8)); edges.push_back(Edge(6, 7)); edges.push_back(Edge(11, 4)); edges.push_back(Edge(24, 10)); adjList.push_back(edges); e...
ALGO
0.999533
3.744574
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-11-02T13:07:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "368b433a5cd...
7e89581a-efe4-4a25-8c55-a6adacfeaa14
J-B-Mugundh/LeetCode-Solutions
1657-determine-if-two-strings-are-close/1657-determine-if-two-strings-are-close.cpp
class Solution { public: bool closeStrings(string word1, string word2) { if(word1.size() != word2.size()) return false; vector<int> map1(26, 0), map2(26, 0); for (char c : word1) { map1[c - 'a']++; } for (char c : word2) { map2[c - 'a']++; } ...
ALGO
0.99999
5.927454
{ "github_metadata": { "branch": "main", "commit_count": 1277, "repo_created_at": "2023-08-08T16:22:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed1df4a55...
65411a9c-b6de-486d-b081-f8228954b085
Giantpizzahead/comp-programming
USACO/Archived Contests/January 2022 (Platinum)/minimizingweird.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define sz(x) ((int) x.size()) #define all(x) x.begin(), x.end() #define debug if (true) cerr using ll = long long; const int MAXN = 1e5+5; const int MAXBIT = 500; int N, K; int origA[MAXN], A[MAXN]; struct BIT { b...
ALGO
0.999993
3.907359
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-04-04T04:04:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2ab13274...
72f2b6e5-87a3-42dc-b6ff-521dc6e89ba3
Prathmesh311/DSA
Graph/SurroundedRegions.cpp
class Solution { public: int map[201][201] = {0}; int flipMap[201][201] = {0}; //Method to find the region is surrounded or not bool traverseIsland(vector<vector<char>>& grid, int i, int j){ if(i < 0 || j < 0 || i >= grid.size() || j >= grid[0].size()){ //return true if region cannot be surrou...
ALGO
0.99997
6.05617
{ "github_metadata": { "branch": "master", "commit_count": 674, "repo_created_at": "2022-09-26T01:47: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": "b5989645...
ca6f4e28-276e-4bff-b448-4aabec8c1b0f
viCodexm/competitive-programming
contests/ICPC CRRC 2022/1-4/I $Сорт. массива перестановками/Source_debug.cpp
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <functional> // std::less using namespace std; int main() { setlocale(LC_ALL, "Russian"); int n; cout << "Кол-во элементов в массиве: "; cin >> n; //Вводим кол-во элементов во входном массиве vector<int> input(n); cout << "Входн...
ALGO
0.999936
4.218805
{ "github_metadata": { "branch": "main", "commit_count": 321, "repo_created_at": "2022-10-26T15:49:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6566a969f4...
67671803-6659-4cd4-9d5e-2f94149afc65
mushkul/Vanderbilt-CP
solutions/claude-3-5-sonnet-20241022/1741.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; struct Event { ll x, y1, y2, type; bool operator<(const Event& e) const { return x < e.x; } }; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<Event> events; for(int i = ...
ALGO
0.999083
4.521642
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-09-18T17:07: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": "7e904e26dd4...
9a1505ba-6728-4df9-a2d1-601f4e5fa57b
nitronium102/Algorithm
최소 신장 트리/10423_전기가 부족해.cpp
// // Created by KangMinji on 2023-06-14. // #include <iostream> #include <vector> #include <tuple> #include <algorithm> using namespace std; typedef tuple<int, int, int> tp; vector<tp> edge; vector<int> parent; int findParent(int x){ if (parent[x] < 0){ return x; } return parent[x] = findParent(parent[x]); } ...
ALGO
0.999983
5.122817
{ "github_metadata": { "branch": "main", "commit_count": 502, "repo_created_at": "2021-07-04T13:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1134b01149...
a23d4192-52ac-46cc-9edc-a9101e86d2e0
ishandutta2007/codeforces-h
heno239/normal/1704/E.cpp
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack>...
ALGO
0.999886
3.946615
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a35fe11d8c4...
4fdebab1-b792-48da-ae99-d73327c2827f
limchanghoon/CodingTest
baekjoon/1301.cpp
#include <iostream> #include <cstring> using namespace std; int N; int table[5]; long long dp[11][11][11][11][11][6][6]; long long solve(int cnt1, int cnt2, int cnt3, int cnt4, int cnt5, int ppre, int pre) { if (cnt1 + cnt2 + cnt3 + cnt4 + cnt5 == 0) return 1; if (dp[cnt1][cnt2][cnt3][cnt4][cnt5][ppre][pre] != -1)...
ALGO
0.999962
3.995873
{ "github_metadata": { "branch": "main", "commit_count": 156, "repo_created_at": "2022-03-22T05:03:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd1f1bb499...
3b3b070d-2038-4578-adc1-b3b56e8c562b
zqianl/algorithm
jianzhioffer/26.h
#ifndef SOLUTION_H #define SOLUTION_H #include<iostream> #include<vector> #include<numeric> #include<limits> using namespace std; struct TreeNode{ int val; TreeNode *lc; TreeNode *rc; TreeNode(int x) :val(x), lc(NULL), rc(NULL){} }; class Solution{ public: TreeNode *root = NULL; bool RebuildTree(vector<int>pr...
ALGO
0.999983
4.781898
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2017-07-13T10:17: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": "0c8fa6a6e...
feddbf46-a6d6-46a8-b23d-d37303e51042
Rookie12910/CSE-204-DSA-1--Assignments
MinHeap/minHeap.cpp
#include <iostream> #include <fstream> #include<cstring> #include <cmath> using namespace std; ifstream ifile; ofstream ofile; class minHeap { int *heap; int curr_size; int capacity; public: minHeap (int capacity) { this->capacity = capacity; heap = new int [capacity]; curr...
ALGO
0.999131
4.445436
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-01-05T19:21: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": "cb8246c484c...
d225e708-e85f-42aa-92f7-f93b11263347
raincross7/code-similarity
codes/train_code/problem239/problem239_201.cpp
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define per(i, n) for (int i = (n)-1; i > -1; i--) #define reps(i, s, n) for (int i = (s); i <= (int)(n); i++) #define sper(i, s, n) for (int i = (s); i >= (int)(n); i--) using namespace std; using ll = long long; using...
ALGO
0.999897
3.212999
{ "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": "d17cd942d8ec...
ae7cfdb8-bd6c-4476-a3b9-c923a33e088d
nihal866/Codeforces_Questions
D_Make_a_Power_of_Two.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define fri(i, a, b) for(int i = a; i < b; i++) #define frd(i, a, b) for(int i = a; i >= b; i--) #define g(a,b) __gcd(a,b) #define lcm(a,b) (a*b)/g(a,b) #define lb(v,key) lower_bound(v.begin(), v.end(), key) #define ub(v,key) upper_bound(v.begin(), v...
ALGO
0.998962
4.399748
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-03-05T13:04: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": "43a10a82f1...
d253067c-c4c7-4cb8-ae00-d7f937d828dc
ellenliuyx/Coding-Interview
52_TheFirstCommonNode/52_TheFirstCommonNode/52_TheFirstCommonNode.cpp
//================================================================== // 《剑指Offer》代码 //================================================================== // 面试题52:两个链表的第一个公共结点 // 题目:输入两个链表,找出它们的第一个公共结点。 #include <iostream> using namespace std; //******************************************************************// //-...
ALGO
0.999904
4.754645
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-02-28T08:08: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": "3351fead19...
d41e8125-3217-4cda-b883-d8dddf76ba37
tpoisonooo/render-cow
main.cpp
#include <iostream> #include <opencv2/opencv.hpp> #include "global.hpp" #include "rasterizer.hpp" #include "Triangle.hpp" #include "Shader.hpp" #include "Texture.hpp" #include "OBJ_Loader.h" Eigen::Matrix4f get_view_matrix(Eigen::Vector3f eye_pos) { Eigen::Matrix4f view = Eigen::Matrix4f::Identity(); Eigen::...
ALGO
0.961374
5.004807
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-10-29T10:12: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": "816249670f...
025e108e-4ae0-49eb-8d35-baca4ed71b55
collatz-prefixes/collatz-prefixes-cplusplus
include/prefix.hpp
/** * @file prefix.hpp * @author <NAME> (<EMAIL>) * @brief Header file for prefix.cpp * @version 0.1 * @date 2021-08-02 * * @copyright <NAME> (c) 2021 * */ #pragma once #include <assert.h> #include <cinttypes> #include <cmath> #include <iostream> #include <vector> #include "collatz.hpp" /** * @brief Iter...
ALGO
0.980049
6.117111
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-06-27T16:54:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b16039c84d8a...
27ccca93-f175-43ab-89e4-4891b4119930
katotetsuro/ofxLibface
libs/FisherCore.cpp
/** =========================================================== * @file * * This file is a part of libface project * <a href="http://libface.sourceforge.net">http://libface.sourceforge.net</a> * * @date 2009-12-21 * @brief * @section DESCRIPTION * * @author Copyright (C) 2009 by Aleksey * * @section LICE...
ALGO
0.975839
4.35574
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2012-10-20T11:46:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "34eaa814c2...
c3d921b1-8375-4147-a5fa-360984c780af
RahmanMoshiur00/Problem-Solving
CodeForces/CF F.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 long long int intl; typedef unsigned long long intu; typedef tree< intl, null_type, less<intl>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; #d...
ALGO
0.999971
3.624468
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-03-04T15:27: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": "50d9e388ff...
0ebb269f-8395-49b8-936e-89f509d0c63c
liuxueyang/liuxueyang.github.io
assets/src/leetcode/contest/biweekly/70/b.cpp
// Date: Sat Jan 22 22:35:28 2022 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <climits> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <algorithm> #include <utility> #include <fun...
ALGO
0.999846
4.390381
{ "github_metadata": { "branch": "master", "commit_count": 1302, "repo_created_at": "2014-03-18T02:46: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": "7d83c29...
2d9e9106-bf7a-4112-8260-dd457f2f13b8
TrainingAfternoon/CinCity
Jonny/NCNARegional2020/ProblemJ.cpp
// // Created by <NAME> on 2/27/21. // #include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define V vector #define vi V<int> #define vll V<ll> #define vd V<double> #define pii pair<int, int> #define pll pair<ll,ll> #define vpii V<pii> #define vpll V<pll> #define graph V<vi> // l...
ALGO
0.997275
4.701423
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2021-02-20T01:02:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a4402009...
82246a5b-b4df-453f-9cc2-6ded222e88c7
Gregz9/ComputerVision
src/sift.h
#ifndef MY_SIFT_H #define MY_SIFT_H // #include "opencv2/core.hpp" #include <vector> #include <opencv2/core.hpp> #include <opencv2/core/mat.hpp> #include <opencv2/core/types.hpp> #include <opencv2/opencv.hpp> #include <stdlib.h> #include <cmath> #include <limits> constexpr int NUM_OCT = 8; constexpr int NUM_SCL_PER_O...
ALGO
0.996021
5.60102
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2024-04-25T13:18: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": "26cf5c170...
49f10812-f9f9-4cb7-b5b3-78ffb65788e8
Jak2423/Labs
ICSI201-Object-Oriented-Programming/Lab9/Shape.cpp
#include <iostream> #include <string.h> #include <math.h> using namespace std; #define pi 3.14 class Shape { protected: char *name; public: virtual float perimeter() = 0; public: Shape() { name = new char[2]; strcpy(name, ""); } Shape(char *n) { name = new char[strlen(n) + 1]; ...
ALGO
0.999129
4.007318
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-12-25T09:23: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": "e68129b8cb4...
7e52b1e7-3d84-4c17-ab66-a28653883c48
Pradeep434680/Assignments-DSA
Assignment_4/q1.cpp
#include<iostream> using namespace std; int max_pow2 =0; struct Node { int data; Node * next; }; Node * create_poly(int max_pow,struct Node *N) { struct Node * head = NULL; struct Node * temp; struct Node * curr; int data; int n =max_pow; n++; while(n--) { cout<<"ent...
ALGO
0.994851
3.809845
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-10-03T09:36: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": "9db07e1dcd33...
80c59b05-da7b-4c8f-a698-6e1f65697573
alvas-education-foundation/ISE_3rd_Year_Coding_challenge
4AL17IS023_KSHAMA/Pradeep sir_Coding_Challenge 1/prog4.cpp
/* Question: 4) Solve the challenge where, You are given a 2D array. An hourglass in an array is a portion shaped like this: a b c d e f g For example, if we create an hourglass using the number 1 within an array full of zeros, it may look like this: 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
ALGO
0.999762
4.542384
{ "github_metadata": { "branch": "master", "commit_count": 1813, "repo_created_at": "2020-05-19T08:53:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8536547...
b89fd4d9-6596-45e9-a148-51c9f123ec8a
monolife506/problem_solving
대회/Codeforce/#843 (Div. 2)/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; void solve() { int n; cin >> n; vector<vector<int>> p(n); map<int, int> cnt; for (int i = 0; i < n; ++i) { int k; cin >> k; p[i].resize(k); for (int j = 0; j < k; ++...
ALGO
0.999891
4.849145
{ "github_metadata": { "branch": "master", "commit_count": 433, "repo_created_at": "2019-09-18T12:56: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": "aead572e...
37dfec6e-811d-4983-abb6-d2b75501bebf
adhikareeprayush/cpp-console-based-games
hang-man/main.cpp
// Hangman Game #include<iostream> class Player { public: std::string name; int score; Player(std::string name) { this->name = name; this->score = 0; } }; class Figure{ public: int wrong_guesses; Figure() { this->wrong_guesses = 0; } void drawFigu...
TOOL
0.99035
3.250126
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-04-29T17:14:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea8347b0d8ca...
2eda82d1-3d60-4a2e-819d-2f60f8b7d584
777rakesh/Code
CodingSites/vs_proj_cpp/GeeksforGeeks/kmatchingpair_day3.cpp
#if 0 // { Driver Code Starts // Initial Template for C++ //#include <bits/stdc++.h> #include <iostream> #include <algorithm> using namespace std; // } Driver Code Ends class Solution { public: int find_min(int sockcount[], int numcol, int reqpairs) { // Your code geos here sort(sockcount, soc...
ALGO
0.999827
4.149062
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2014-01-22T08:54: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": "8fa714414...
d76471c4-e5ba-4838-a604-9b8d7dd95d3b
avmaharaj/neural_network_cpp
nn.cpp
// This code begins from the base file written by <NAME>.(see below) // I will make edits to change this to a different type of gate, and/or to change the activation // Function etc. <NAME>aj. Jan 2017 // Some edits made: // 1. Added an OR gate (easy) (01/24/2017) // 2. Added a ReLU activation function - // turns...
ALGO
0.999086
4.9735
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-01-25T04:10: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": "8bf9d29928...
c79d6b25-255e-4f11-98ea-f091e1ba7ecc
so-miyamoto/kremer_grest_smymt
src/md_integrator.h
/** * @file compute_force.h * @author <NAME> (<EMAIL>) * @brief * @version 0.1 * @date 2022-09-15 * * @copyright Copyright (c) 2022 * */ #pragma once #include "md_system.h" #include "atoms.h" #include "sim_box.h" #include "cell_list.h" #include "pair_potential.h" #include "bond.h" #include "rand.h" struc...
ALGO
0.999087
6.187577
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-08-18T15:11:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f8e39c99f42...
39d66547-e3da-43dc-8e12-e4aebfaa955a
mrdonee/image-approximation
run.cpp
/* Compile with: g++ -std=c++11 `pkg-config --cflags opencv` -o example example.cpp draw.cpp `pkg-config --libs opencv` */ #include "draw.h" // renderPolyImage(), score() #include <opencv2/core/core.hpp> // Mat, Point, Scalar #include <opencv2/highgui/highgui.hpp> // imread(), imwrite(), imshow() #include <algorithm...
ALGO
0.999623
5.129248
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-06-10T23:51: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": "4e2ab34d3c...
553ce4c7-6110-4ad9-95af-344829edef81
Vignesh16879/CSES
1671.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; ll n, m, d[100000], vis[100000], dis[100000]; vector<pair<ll, ll>> par[100000]; void dij() { for(ll i = 2; i < n+1; i++) dis[i] = LLONG_MAX; priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> q; q.push({0...
ALGO
0.999967
3.995119
{ "github_metadata": { "branch": "rdfg", "commit_count": 4, "repo_created_at": "2022-01-24T05:09: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": "9732630b6108...
e43f5e6b-8eb5-4834-b5e3-2ca4b05f1edf
rioyokotalab/Hatrix
examples/BLR2_weak_LDL.cpp
#include <algorithm> #include <cstdint> #include <cmath> #include <iostream> #include <tuple> #include <unordered_map> #include <utility> #include <vector> #include <cassert> #include "Hatrix/Hatrix.hpp" using vec = std::vector<int64_t>; using randvec_t = std::vector<std::vector<double> >; std::vector<double> equall...
ALGO
0.998696
4.948022
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2021-04-07T06:03:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 12, "pull_requests": 1 }, "file_meta": { "content_id": "81ee2f3a...
0bf7270b-ceb6-41cc-85ec-f4845640edef
redplait/cses
Graph/reach.cc
#include <stdlib.h> #include <stdio.h> #include <iostream> #include <string.h> #include <vector> #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,tune=native") #pragma GCC optimize("-Ofast") // Reachable Nodes // main idea - for some vertex we can OR mask of reachable nodes for all out-goimg nodes using nam...
ALGO
0.999951
4.344304
{ "github_metadata": { "branch": "main", "commit_count": 221, "repo_created_at": "2023-09-22T12:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f6dc05a03...
58e1eda6-6774-4a4f-a065-658eef227fc1
kevinlisun/romans_stack
matlab_toolbox/gptoolbox/mex/collapse_small_triangles.cpp
// // V2 = [0 0 0;1 0 0;0 1 0;0 1.004 0]; // F2 = [1 2 3;3 2 4]; // [CF] = collapse_small_triangles(V,F,1e-3); // #include <igl/collapse_small_triangles.h> #include <igl/read_triangle_mesh.h> #include <igl/EPS.h> #include <igl/pathinfo.h> #include <igl/writeOFF.h> #include <igl/writeOBJ.h> #include <igl/writeD...
ALGO
0.930777
5.891205
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2017-05-12T17:31:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 5, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "6995a404...
d700fda2-31c5-4a56-be24-9c1ffc8973e0
david-perez/competitive-programming
UVa/010489.cpp
#include <iostream> #include <iomanip> #include <sstream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <deque> #include <map> #include <unordered_map> #include <set> #include <stack> #include <list> #include <forward_list> #include <algorithm> // max... #include <utility> // pair #in...
ALGO
0.999897
3.692626
{ "github_metadata": { "branch": "master", "commit_count": 707, "repo_created_at": "2015-10-28T23:24:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 6, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "7045d02...
83ceeaff-ef80-4f9b-8fa7-025093b5f6bc
z4yross/sobel-paralel-kernel
sobelomp/main.cpp
#include "sobelOMP.cpp" #include <unistd.h> void usage(const char *argv0){ fprintf(stderr, "Usage: %s [-i nombreImagen][-T hilos][-t sobelTreshold][-b blur][-k blurSize][-s blurSigma][-m calcularPromedio][-u intentos][-h help-]\n", argv0); exit(EXIT_FAILURE); } int main(int argc, char **argv){ std::string n...
TOOL
0.981866
4.504494
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-04-22T06:33: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": "1a19d5ad0af...
4c895252-c884-4155-88c5-92eef94422fc
RahulScripted/LeetCode-Problems
Leetcode 75/Priority Queue/_2336_SmallestNumberInInfiniteSet.cpp
// You have a set which contains all positive integers [1, 2, 3, 4, 5, ...]. Implement the SmallestInfiniteSet class: // 1. SmallestInfiniteSet() Initializes the SmallestInfiniteSet object to contain all positive integers. // 2. int popSmallest() Removes and returns the smallest integer contained in the infinite se...
ALGO
0.978855
5.224011
{ "github_metadata": { "branch": "main", "commit_count": 151, "repo_created_at": "2024-09-24T14:55: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": "c151f1653d...
5c294265-edd7-4242-8138-7b87473bb069
frankbozar/Competitive-Programming
Solo Competition/Manthan, Codefest 17/E.cpp
#include<cstdio> #include<cstring> typedef long long lld; lld cc[64][64]; lld dp[16][64][1024]; lld C(int n, int m) { if( n<m || m<0 ) return 0; else if( n==m || m==0 ) return 1; lld& ans=cc[n][m]; if( ans<0 ) ans=C(n-1, m-1)+C(n-1, m); return ans; } lld f(in...
ALGO
0.999652
3.536002
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2016-12-01T17:21: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": "fb3c4be6...
03f98416-b40d-448c-8c32-23de6da0fdab
ishandutta2007/codeforces-k
kude/normal/1439/A2.cpp
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = (n)-1; i >= 0; --i) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using ll = long long; using P = ...
ALGO
0.999904
3.52946
{ "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": "5b192b4d8e05...
a328a16e-ad7a-43b4-8788-e20a25085d59
joshua1535/LabosFunda
Cuarto_corto/ejercicio3.cpp
#include "iostream" using namespace std; float Leer_nota(float notasest[][5], int numest){ //funicon que pide las notas de los 5 examenes de cada estudiante for (int i = 0; i < numest; i++) { cout << "Estudiante " << i << endl; for (int n = 0; n <= 4; n++) { cout << "Ingrese la nota " << n << ": "; cin ...
TOOL
0.973631
3.998032
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2020-03-24T21:33: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": "fe1f35c7e...
0a4b8729-903b-4a95-8549-3eac4f408f1a
Divyanshnigam/PEPCO
Garbage Codes/Allocate_min_num_of_pages .cpp
/* You are given N number of books. Every ith book has Ai number of pages. You have to allocate contagious books to M number of students. There can be many ways or permutations to do so. In each permutation, one of the M students will be allocated the maximum number of pages. Out of all these permutations, the task i...
ALGO
0.999982
5.256598
{ "github_metadata": { "branch": "master", "commit_count": 352, "repo_created_at": "2020-09-13T05:21:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 57, "issues": 4, "pull_requests": 21 }, "file_meta": { "content_id": "86957...
ca12a11e-22d0-4ac2-8525-096aea4c98b2
jxzhou147/SCN
fun.cpp
#include<iostream> #include<fstream> #include<vector> #include<gsl/gsl_errno.h> #include<gsl/gsl_odeiv.h> #include<math.h> #include<random> #include "kuramoto.h" #include "fun.h" using namespace std; int func (double t, const double y[], double f[], void *params) { Kuramoto kura_func = *(Kuramoto *)params; ...
ALGO
0.998047
4.180995
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-09-11T08:24:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03cb5aa9c4...
ec7bc374-533b-4e89-b4a4-45ed9a860871
pehli025/CSCI3081W-Program-Design-and-Development
project/include/sim_helper.h
/** * @file sim_helper.h */ #ifndef SIM_HELPER_H #define SIM_HELPER_H /******************************************************************************* * Includes ******************************************************************************/ #include <EntityProject/facade/delivery_system.h> #include "composite_fac...
ALGO
0.958134
4.883948
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-03-07T04:20:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb4cbdad50a6...
91697b93-487b-417f-b1ad-2e01dbee63eb
Lwao/awesome-ufrn
DCA0803 - Programação Avançada/Unidade 1/Ponteiros/(Pt2_Crash)Resolução - Prova 2016.1.cpp
/* DCA0803 - PROGRAMAÇÃO AVANÇADA PROVA - 1a UNIDADE DATA: 08/03/2016 NOME: _____________________________________________________ MATRÍCULA: ___________________________ Inicialmente, coloque no espaço acima o seu nome e número de matrícula e salve o arquivo. Caso queira acrescentar alguma observação para o profes...
ALGO
0.99192
4.484087
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-10-23T04:08:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3874a25f523...
d83650ab-7e7e-4c43-8852-29f82d4a6bf3
camelml/camel
test/kmeans/KMeans.cpp
#include "KMeans.hpp" #include <iostream> #include <math.h> KMeans::KMeans(std::string const &path, const int &k) { dataSet.load(path); this->k = k; } void KMeans::print() { cout << dataSet << endl << k << endl; } void KMeans::findMinMax() { extremas = zeros<mat>(2, dataSet.n_cols); // c...
ALGO
0.99782
5.135352
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2019-01-31T13:29:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d448e261...
0f88b5ab-56e8-4186-8fcd-25554d4d4f7f
aroramoksh11/SwiftBot
Line following algorithm.ino
void lineFollow() { sensorLeftValue = analogRead(sensorLeftPin); sensorRightValue = analogRead(sensorRightPin); // Adjust motor speeds based on sensor readings if (sensorLeftValue > threshold && sensorRightValue > threshold) { // Both sensors on the line, move forward moveForward(); } else if (sensor...
ALGO
0.968869
5.291503
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-08-03T13:20:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a99fb7e8ee50...
b0aea51e-35fe-40de-8ec6-149b3c92e0e0
KalashRastogi/P3
LinkedList/polynomialAddition.cpp
#include <bits/stdc++.h> using namespace std; class Node{ public: int coeff; int expo; Node *next; }; void insertAtBack(Node **head, int coeff, int expo){ Node *newNode = new Node(); if(newNode==NULL){ cout<<"Memort not available"; return; } else{ newNode->coeff =...
ALGO
0.991051
4.07922
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2019-06-02T17:32: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": "7bb520500...
fdcf3189-6b9d-46c8-8144-b3ab3bfd723d
Kiritow/OJ-Problems-Source
HDOJ/1253_autoAC.cpp
#include <iostream> #include <vector> #include <string> #include <queue> #include <algorithm> #include <cmath> #include <ctime> #include <cstdio> #include <sstream> #include <deque> #include <functional> #include <iterator> #include <list> #include <map> #include <memory> #include <stack> #include <set> #include <numer...
ALGO
0.999889
3.711519
{ "github_metadata": { "branch": "master", "commit_count": 939, "repo_created_at": "2016-04-10T01:06:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ba9e98...
54d5d5b8-35f0-42ac-9dd2-0dd3ff51a105
Dol3v/ap-knn-classifier
utils.tpp
#include <random> #include <utility> namespace utils { /// swaps two variables that implement the deref operator template<typename Iter> void swap(Iter a, Iter b) { auto temp = *a; *a = *b; *b = temp; } /// partitions the iterable to contain elements less than the pivot on...
ALGO
0.999393
6.530003
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-07-22T14:01:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ce5bd46893d...
ecaa2820-36e4-484c-9c99-b8d21182527c
NCAR/Siparcs2023_CI_CD
CMake/MPIStencil/oneThread/functions.cpp
/* functions.cpp * Contains the host-side functions specific to this problem * by: <NAME> (<EMAIL>) */ #include <float.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include "pch.h" #define MAX(X,Y) (((X) > (Y)) ? (X) : (Y)) LJ_return LaplaceJacobi_naiveCPU(float *M, const int ny, const int nx){ ...
ALGO
0.999967
5.492476
{ "github_metadata": { "branch": "main", "commit_count": 257, "repo_created_at": "2023-05-31T20:16:38.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "abe80bfcb6d...
0725870f-1c3f-432b-8157-5904d3b969c2
GetOverMassif/QSP-SLAM
src/core/Ellipsoid.cpp
#include "include/core/Ellipsoid.h" #include "src/Polygon/Polygon.hpp" #include <Eigen/Core> #include <Eigen/SVD> #include <Eigen/Dense> #include "include/core/Plane.h" #include "include/core/ConstrainPlane.h" #include <boost/math/distributions/chi_squared.hpp> // 卡方分布的分布函数 double chi2cdf(int degree, double chi) { ...
ALGO
0.907725
3.92735
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2023-12-07T04:17: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": "bbf9c10f30f...
f81dc872-083a-42f9-a0d4-33b524e60ad8
rapidsai/cuml
cpp/include/cuml/tsa/batched_arima.hpp
/* * Copyright (c) 2019-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
ALGO
0.995924
6.806396
{ "github_metadata": { "branch": "branch-25.08", "commit_count": 16067, "repo_created_at": "2018-10-11T15:45:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4828, "forks": 580, "issues": 895, "pull_requests": 67 }, "file_meta": { "content...
bac93db9-b48c-4752-a4c9-b87f7213fe5f
teruuuuuu/kyoupro
c++/src/atcoder/abc111/d.cpp
#include <algorithm> // std::transform #include <cmath> #include <iterator> #include <sstream> #include <iostream> #include <set> #include <tuple> #include <vector> const char U = 'U'; const char D = 'D'; const char L = 'L'; const char R = 'R'; std::set<int> vec_to_mod_set(const std::vector<std::tuple<int, int>>& nu...
ALGO
0.999652
4.182334
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2018-11-17T13:44:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "d126ba1ed...
2cd4ab61-53e6-4d5c-821b-adb4b6b6b595
manav13/Competitive-Coding
TakeUForward/DP Series/DP05_Max_Sum_Non_Adajcent_Elements.cpp
#include<bits/stdc++.h> using namespace std; int findMaxSum(vector<int> nums, int index, vector<int> &dp) { if(index < 0) { return 0; } if(dp[index] != -1) { return dp[index]; } int pick = nums[index] + findMaxSum(nums, index-2, dp); int notPick = findMaxSum(nums, index-1, dp)...
ALGO
0.999971
4.975808
{ "github_metadata": { "branch": "main", "commit_count": 187, "repo_created_at": "2020-12-19T05:58:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "99310d7951...
71627f59-4c56-4ee8-9e61-6e78334d08b1
husterxsp/leetcode
025-reverse-nodes-in-k-group/reverseKGroup.cpp
#include <iostream> #include <stdio.h> #include <vector> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; // AC ListNode* skip(ListNode* node, int steps){ while (steps-- && node) { node = node->next; } return node; } ListNode* re...
ALGO
0.999946
4.686531
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2016-06-27T12:12:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "322b565d9...
1191898c-d1cc-4040-bdc1-ebdf7b210c96
ibudiselic/contest-problem-solutions
tc 160+/ABCPath.cpp
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> using namespace std; vector<string> G; int m, n; int dp[50][50][26]; int go(int i, int j, char c) { if (i<0 || j<0 || i>=m || j>=n || G[i][j]!=c) return 0; if (dp...
ALGO
0.999847
4.687826
{ "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": "61bb05cf5...
1241f9c7-f8cc-40a5-b6e7-9e125515a098
LuoshuiTianyi/Code
Codeforces/102538/C/C.cpp
#include <cstdio> #include <iostream> using namespace std; #define LL long long #define go(G, x, i, v) \ for (int i = G.hd[x], v = G.to[i]; i; v = G.to[i = G.nx[i]]) char read_str[1 << 25], *CH = read_str; #define getchar() (*CH++) LL read() { char ch = getchar(); int fl = 0; LL x = 0; while (!isdigit(ch)) {...
ALGO
0.999961
3.262969
{ "github_metadata": { "branch": "master", "commit_count": 971, "repo_created_at": "2019-09-09T08:42: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": "94c40a97...
8a667d5d-67d6-453c-bc2b-6605b89792bf
tmustafa123/SPMProject18
tt_farm.cpp
#define cimg_use_jpeg 1 #include "CImg.h" #include <iostream> #include <string> #include <vector> #include <thread> #include <atomic> #include "util.h" #include <utility> #include <atomic> #include <stdio.h> #include <dirent.h> using namespace cimg_library; /***** Farm Components ****/ void tt_emitter(int nw); void t...
DATA
0.984595
4.786003
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-09-28T12:13:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1619916077...
87bad13f-a099-4f28-a6b8-681a3f8ff408
pratiksaha/practice
array/distinctPalindromicSubstring.cpp
//to find all distinct palindrome substrings of a given string //Using features of C++ Standard (2011) Compile using g++ -std=c++11 #include<iostream> #include<string> #include<unordered_map> using namespace std; void palindromicSubStrs(string s) { unordered_map<string, int> hash; int n = s.size(); int re...
ALGO
0.999815
5.820297
{ "github_metadata": { "branch": "master", "commit_count": 371, "repo_created_at": "2014-10-03T04:22:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bf1c8982...
c2ac953c-b88d-4721-af61-b71f309fc8c8
atharvsankpal7/Diwali-Bootcamp-2k24
Day01/assignments/_01_disappeared_elements.cpp
// in leetcode they have given vector, but we can solve it using array too, you can revisit the problem after completing the day 2 of bootcamp // https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/description/ #include <bits/stdc++.h> using namespace std; int main() { // input int n; c...
ALGO
0.999721
4.208399
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-10-26T11:17: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": "9fada97b6f6...
7e6aedee-a925-4003-afdf-1dac9af4b3d7
apache/doris
be/src/exec/lzo_decompressor.cpp
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
TOOL
0.951127
7.01078
{ "github_metadata": { "branch": "master", "commit_count": 26499, "repo_created_at": "2017-08-10T12:13:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13962, "forks": 3497, "issues": 2697, "pull_requests": 616 }, "file_meta": { "content_i...
1145d529-7356-4c3b-9213-f75869f8ca24
tsimonq2/leetcode-solutions
11/cpp/main.cpp
#include <iostream> #include <vector> class Solution { public: int maxArea(std::vector<int>& height) { int left = 0, right = height.size() - 1; int max_area = 0; while (left < right) { // Height * width int current_area = std::min(height[left], height[right]) * (rig...
ALGO
0.999974
7.544621
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2024-09-29T02:48: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": "4bae0a6ca06...
94b6da0b-1596-44e5-b0b7-794d8075d01b
johnathan79717/competitive-programming
CodeChef/TWOFL/main.cc
#include <functional> #include <list> #include <string> #include <vector> #include <climits> #include <cstring> #include <map> #include <queue> #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <set> #include <deque> #include <stack> #include <cassert> using namespace std; #define FOR...
ALGO
0.999972
3.109655
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-04-07T07:50:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e8fc5880...
95aedcda-8c19-43de-9d86-9730e499c40b
CUG-LXY/undergraduateproject
C++for图像边缘检测与模糊/RunLengthEncoding.h
#pragma once #ifndef RUNLENGTHENCODING_H #define RUNLENGTHENCODING_H #include <opencv2\core\core.hpp> #include <opencv2\imgproc\imgproc.hpp> #include <opencv2\highgui\highgui.hpp> #include <iostream> #include"PixImage.h" struct runNode { uchar data;//像素 int num;//个数 runNode* lnode;//左结点 runNode* rnode;//右结点 runN...
ALGO
0.975363
3.465782
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-02-16T12:21: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": "a813ddb28bf...
d9f795e2-a8ac-4190-977c-1ac0f95dbbce
FragrantRookie/VoiceChangerSDK
VoiceChangerSDKCore/VCSDKCoreBPMDetect.h
//// VCSDKCoreBPMDetect.h // VoiceChangerCFramework // // Created on 2020/12/15. // // #ifndef VCSDKCoreBPMDetect_h #define VCSDKCoreBPMDetect_h #include "VCSDKCoreType.h" #include "VCSDKCoreFIFOSampleBuffer.hpp" namespace vcsdkcore { /// Minimum allowed BPM rate. Used to restrict accepted result above a reas...
ALGO
0.959839
6.1424
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2024-07-30T19:35: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": "9469c4719a...
8d369ac7-cc56-4f6a-908d-e888571cbbf6
hongiii/aha_algorithm_practice
8.1图的最小生成树/main.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; struct edge { int u; int v; int w; }; const int N = 110; int n, m, a[N]; edge node[N]; void init() { memset(a, 0, sizeof(a)); for(int i = 1; i <= n; i++) ...
ALGO
0.999978
3.514647
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-05-12T08:08: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": "081969783c...
e28313e7-dce5-44c9-a09b-4c415f76bdf4
the-tushar-sonar/DSA
SortingAlgorithms/selectionSort.cpp
#include <iostream> using namespace std; void print(int *arr, int n) { for (int i = 0; i < n; i++) { cout << arr[i] << " "; } cout << endl; } void selectionSort(int *arr, int n) // Time Complexity --> O(n^2) { for (int i = 0; i < n - 1; i++) { int minIdx = i; // loop fo...
ALGO
0.999973
5.479448
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2025-05-01T15:26: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": "be438ec8f70...
16391442-9418-4737-8d20-031dfccced2d
pumaka/TIL
Baekjoon/DynamicProgramming/1932.cpp
#include <iostream> using namespace std; int arr[501][501] = {0}; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int sum[n]; //initialize list for(int i = 0; i < n; i++) sum[i] = 0; // get inputs for(int i = 0; i < n; ...
ALGO
0.999986
3.384904
{ "github_metadata": { "branch": "main", "commit_count": 123, "repo_created_at": "2022-02-06T01:05: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": "e07529c218...
1a8d3452-d165-45c9-827b-8bbb9b116639
saiftyfirst/RythmCpp
HackerRank/HusGame.cpp
/* Source: https://www.spoj.com/problems/HUSGAME/ * According to the problem description the only way to win the game is to have 2 stones remaining when a player gets his turn. * 1. Observation: It appears that A has a good chance of winning if he has even number of stones during his turn. * 2. Even Strategy: If A s...
ALGO
0.999901
3.754919
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-11-07T18:59: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": "1f42aa49e...
70ddf110-4c55-4575-a1a9-500706be158c
redeff/cmp
cf/1093/D/main.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll MOD = 998244353ll; ll pow2(ll n) { if(n == 0ll) return 1ll; ll rec = pow2(n / 2ll); if(n % 2ll == 0ll) return (rec * rec) % MOD; else return (2ll * rec * rec) % MOD; } int main() { ll t; cin >> t; for(ll tes...
ALGO
0.999954
5.573841
{ "github_metadata": { "branch": "master", "commit_count": 126, "repo_created_at": "2017-10-21T13:35:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51174aae...
5c8a28a9-e6d2-4ad3-9584-9e2db1f49648
Mahmud0808/Programming-Problem-Solving
Solved Problems/[UVa 1209] Wordfish.cpp
#include <bits/stdc++.h> using namespace std; struct link { string name; int dis; } p[21]; bool cmp(link a, link b) { if (a.dis == b.dis) { if (a.name < b.name) return true; else return false; } else { if (a.dis > b.dis) return true; else return false; } } int main() { string str; vecto...
ALGO
0.999982
3.380429
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-10-28T21:17:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "336c253fe8ea...
2048e709-a72c-4029-a508-bafc484dcce5
tuan0101/LeetCodeC
2017-minimum-number-of-flips-to-make-the-binary-string-alternating/2017-minimum-number-of-flips-to-make-the-binary-string-alternating.cpp
class Solution { public: int minFlips(string s) { // from O(N) - > O(1) space // int n = s.size(); // int l=0, diff1=0, diff2=0; // int ans1, ans2, idx; // int res = n + 1; // for(int r=0; r<2*n; r++){ // if(r < n) s[r] -= '0'; // convert to integer 0 or ...
ALGO
0.999998
5.682724
{ "github_metadata": { "branch": "main", "commit_count": 502, "repo_created_at": "2023-02-02T23:06: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": "adc33ab12b...
abebfc57-c75b-4006-a594-30c932b7df12
Feinbube/hybridNet
OpenCLExamples/HybridParallelLibraryOpenCL/HybridParallelLibraryOpenCL/src/RayTracing.cpp
/*#include "../include/RayTracing.h" RayTracing::RayTracing() : bitmap(NULL), memSizeX(NULL), memSizeY(NULL), memSizeZ(NULL), spheresR(NULL), spheresRadius(NULL), spheresX(NULL), spheresY(NULL), spheresZ(NULL), spheres(NULL) { } RayTracing::~RayTracing() { this->discardMembers(); } std::string Ra...
ALGO
0.998371
5.04417
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2015-05-08T15:18: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": "f9ef46a9...
9bf70de5-a3ca-4e95-8918-8d40819f0463
why116600/ReinforcementLearning
SnakeAI/RLIteration.cpp
#include <vector> #include <set> #include "FileRecorder.h" #include "Environment.h" #include "RLIteration.h" RLIteration::RLIteration(int nSize) :m_nSize(nSize) { } RLIteration::~RLIteration() { } void RLIteration::SetValue(const Environment& env, double v) { std::pair<double, int> p; if (m_value_policy.count...
ALGO
0.979261
4.125656
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2021-02-01T15:19: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": "5922ae6e6...
9faa2136-f35f-49ca-a4f5-55a8d04a6a86
bishal1995/Comptetive_coding
UVa/10114_Loansome_Car_Buyer.cpp
#include<iostream> #include<utility> #include<vector> using namespace std; // Processing each test case void check_month( int ld ){ int loan_duration = ld,depreciation_record_count = 0,last_month,month; float down_payment = 0.0,loan_amount = 0.0,last_month_rate; vector<pair<int,float>> depreciation_record; cin...
ALGO
0.994681
3.447721
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2016-11-10T15:31:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1759ddf39...
eef96205-8fa0-4f66-b343-8435c7f5b1bd
foolnotion/advent-of-code
source/2019/06/solution.cpp
#include <aoc.hpp> #include <fplus/fplus.hpp> namespace fp = fplus; namespace { struct object { u64 id; mutable bool visited{false}; std::vector<object*> in; std::vector<object*> out; }; auto parse(auto const& input) { aoc::util::hash hash; aoc::dense::map<...
ALGO
0.999731
5.786422
{ "github_metadata": { "branch": "master", "commit_count": 250, "repo_created_at": "2022-11-13T19:54:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71a5f64...
949c8f4f-a9b8-4dda-bdbd-cc0a335cb9db
simmran2003/ml_major
New_Db/188334346.cpp
#include <bits/stdc++.h> #define int long long using namespace std; struct point{ int x,y; }; struct line{ point p1,p2; }a[4]; int len_line_pow(line a){//求线段长度的平方 return (a.p1.x-a.p2.x)*(a.p1.x-a.p2.x)+(a.p1.y-a.p2.y)*(a.p1.y-a.p2.y); } bool check_same_point(point p1,point p2){//判断两点是否相同 ...
ALGO
0.999875
4.97109
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-11-06T15:42: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": "5da10b3a7ce3...
c9afdd5a-5bd4-4127-9d36-72bf216b8d6f
IAS-Astrophysics/athenak
src/mesh/meshblock_tree.cpp
//======================================================================================== // AthenaXXX astrophysical plasma code // Copyright(C) 2020 <NAME> <<EMAIL>> and the Athena code team // Licensed under the 3-clause BSD License (the "LICENSE") //==================================================================...
TOOL
0.921835
5.430326
{ "github_metadata": { "branch": "main", "commit_count": 1618, "repo_created_at": "2024-05-08T20:28:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 75, "forks": 54, "issues": 33, "pull_requests": 12 }, "file_meta": { "content_id": "0ce18a...
78be7f25-83b6-4afd-b43f-031500f956e6
NgesBrian/saferewrite_for_test
build/openFHE_bgvrns_getCyclicOrder/ref/clang++_-O1_-fwrapv_-march_native/analysis-execute.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> extern const uint64_t getCyclicOrder(uint32_t,uint32_t,uint32_t); uint32_t static_a[1]; uint32_t static_b[1]; uint32_t static_c[1]; uint64_t static_d[1]; int main(int argc,char **argv) { uint32_t *alloc_a = (uint32_t *) malloc(4); u...
ALGO
0.999721
3.625139
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2022-08-04T06:02: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": "8e983777559...
fc8bb202-11b1-4f49-850c-1620a69db12c
PrashamModi/Leetcode
0648-replace-words/0648-replace-words.cpp
struct Node { Node *links[26]; bool flag = false; bool containsKey(char ch) { return links[ch - 'a'] != NULL; } void put(char ch, Node* node) { links[ch - 'a'] = node; } Node *get(char ch) { return links[ch - 'a']; } void setEnd() { flag = true; ...
ALGO
0.999988
5.599732
{ "github_metadata": { "branch": "main", "commit_count": 427, "repo_created_at": "2023-09-12T10:35: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": "cd9cf9ff90...
c88ec39e-30de-4d6a-abb6-1c4116c445ce
wslee/euphony
thirdparty/z3/src/tactic/portfolio/pb2bv_solver.cpp
/*++ Copyright (c) 2016 Microsoft Corporation Module Name: pb2bv_solver.cpp Abstract: Author: <NAME> (nbjorner) 2016-10-23 Notes: --*/ #include "tactic/portfolio/pb2bv_solver.h" #include "solver/solver_na2as.h" #include "tactic/tactic.h" #include "ast/rewriter/pb2bv_rewriter.h" #include "tactic/filt...
ALGO
0.978353
6.519267
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-02-24T16:34:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35092733...
bb3f9a51-4321-4d72-b4e8-137e47307723
sohaib1268/Library-Management-System-C-
2B-1-20L-1268-assignment5.cpp
#include<iostream> #include<fstream> #include<cstdlib> #include<cstring> #include<string> #include<windows.h> using namespace std; class CreatingGrid{ private: int wordsinthefile; bool fileopen; string wordInput[15]; string sorting; int count; int placeword = 0; int i = 0; int rowsofgrid; int cols...
TOOL
0.984889
3.206875
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-06-04T21:01: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": "97cbf9a81eb2...
d5e283b3-5ed6-4c71-8e3e-18487218e820
trilinos/Trilinos
packages/nox/src-petsc/NOX_Petsc_Group.H
// @HEADER // ***************************************************************************** // NOX: An Object-Oriented Nonlinear Solver Package // // Copyright 2002 NTESS and the NOX contributors. // SPDX-License-Identifier: BSD-3-Clause // ********************************************************************...
TOOL
0.957021
6.968561
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
832f32d9-99b4-49cb-8bf6-2208b1ff09b1
MohamedAEmara/Dynamic-Programming-Problems
UVA/Walking-on-the-safe-side-UVA825/Walking-on-the-safe-side.cpp
#include <bits/stdc++.h> #define int long long #define fast ios_base::sync_with_stdio(false);cin.tie(NULL); #define endl '\n' using namespace std; const int mod = 1e9 + 7; /* استعن بالله ولا تعجز */ int n, m; // use map for memoization and block locations // As the statement doesn't contain any constrains. set<...
ALGO
0.999439
4.121108
{ "github_metadata": { "branch": "main", "commit_count": 65, "repo_created_at": "2022-12-16T08:24:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1f786f8368c...
40ecd34b-6c76-43cf-94b5-f80184e73630
shmVirus/AcademicCodings
CSE-106--DataStructuresLab/Lab-10__2020-12-24__binarySearchTree/binarySearchTree.cpp
#include <iostream> struct tree { tree *leftLink; int data; tree *rightLink; } *firstTree=NULL,*currentTree,*newTree; void insertData (int newData) { newTree = new tree(); newTree->data = newData; newTree->leftLink = NULL; newTree->rightLink = NULL; if (newData <= currentTree->data) { ...
ALGO
0.999312
4.812886
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-01-16T08:16: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": "53605cf4bc6b...
827963a4-e001-4c11-9194-4814dbc1c0f9
iamsadee/Online-Judge-Code
UVA/intersecting line.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; struct pp{ double first,second; }; pair<double,double> chk(pp A, pp B, pp C, pp D) { double a1 = B.second - A.second; double b1 = A.first - B.first; double c1 = a1*(A.first) + b1*(A.second); double a2 = D.second - C.second; doub...
ALGO
0.999409
3.810615
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-10-22T11:15:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c074e5d13f...
725e590d-ee45-4d71-8042-09b288df8681
yokola95/TCD270319
coinchange2/coinchange2bottomup.cpp
#include <iostream> // per cin e cout using namespace std; const int MAXN = 1005; const int MAXM = 105; long long dp[MAXN][MAXM]; int N,M; int C[MAXM]; int main(){ // Leggo l'input cin >> N; cin >> M; for(int i = 0; i < M; ++i) cin >> C[i]; //Programmazione dinamica BOTTOM UP // Iniz...
ALGO
0.999995
4.453594
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-03-27T10:14: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": "ff1e86e536...
7817e257-924e-4280-95ec-db1992ef4ca6
algoboy101/LeetCodeCrowdsource
backup/source/cpp/[480]滑动窗口中位数.cpp
//中位数是有序序列最中间的那个数。如果序列的大小是偶数,则没有最中间的数;此时中位数是最中间的两个数的平均数。 // // 例如: // // [2,3,4],中位数是 3 // // [2,3],中位数是 (2 + 3) / 2 = 2.5 // // 给出一个数组 nums,有一个大小为 k 的窗口从最左端滑动到最右端。窗口中有 k 个数,每次窗口向右移动 1 位。你的任务是找出每次窗口移动后得到的新窗 //口中元素的中位数,并输出由它们组成的数组。 // // // // 示例: // // 给出 nums = [1,3,-1,-3,5,3,6,7],以及 k = 3。 // // 窗口位置 ...
ALGO
0.999996
6.806983
{ "github_metadata": { "branch": "master", "commit_count": 194, "repo_created_at": "2020-03-06T03:43:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "78884c12...
042abd25-599c-434b-99eb-6a2ec05c9547
SidAnnRan/class
02-05/05int2bin5.cpp
#include <iostream> using namespace std; bool int2bool (int m) { return (m % 2 == 1) ? true : false; } void inttobin (int i) { const int LEN = 4; bool bin [LEN] = {false}; //Most significant bit bin[3] = int2bool(i); i /= 2; bin[2] = int2bool(i); i /= 2; bin[1] = int2bool(i)...
ALGO
0.999176
4.814563
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2024-03-08T05:56: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": "7ed8334ef28...
b9084bf7-3857-4344-8093-56041ded7b2c
kunidesuyo/competitive-programming
ABC/301~350/303/B.cpp
#include <bits/stdc++.h> #include <cmath> #define all(x) (x).begin(), (x).end() using ll = long long; const ll INF = 1LL << 60; const int inf = INT_MAX / 2; using namespace std; int main() { int n, m; cin >> n >> m; int a[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> a...
ALGO
0.999933
3.201598
{ "github_metadata": { "branch": "master", "commit_count": 332, "repo_created_at": "2021-05-23T09:30: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": "0900a2ce...
d8d49dc6-2496-4aca-a00c-56b90f0b1103
shariarhossain17/contest_practice
judge/codeforces/div_4/product_binnary.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<vector<long long>> findFactors(long long k) { vector<vector<long long>> factors; for (long long a = 1; a * a * a <= k; ++a) { if (k % a == 0) { for (long long b = a; b * b <= k / a; ++b) ...
ALGO
0.999849
5.005153
{ "github_metadata": { "branch": "main", "commit_count": 165, "repo_created_at": "2023-10-01T13:53:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2f19a91e5...
1f8310c0-96b0-4a8a-9458-e2bb1f51dae6
cloudrick/UVaOnlineJudge
src/10946.cpp
#include<iostream> using namespace std ; int main() { int i,j ; for(;;) { int x,y ; cin >> x >> y ; if( cin.eof() ) break ; int alphabet[26] ; int **table ; int **count ; for( i=0 ; i<26 ; ++i) alphabet[i] = 0 ; table = new int* [x+2] ; count = new int* [x+2] ; for( i=0 ; i<x+2 ; ++i...
ALGO
0.999386
3.21774
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-02-24T17:22: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": "5240313062...
75c8bbcf-7822-4a72-94ea-cc8b840de8d8
Razirp/SLIC_Simple-Linear-Iterative-Clustering
SLIC.cpp
#include "SLIC.h" SLIC::SLIC(Mat src) { init(src, 1024); //默认超像素数为1024 } SLIC::SLIC(Mat src, int k) { init(src, k); } void SLIC::doSLIC() { processed = true; const int maxIterateNums = 20; //设置最大迭代数 for (int i = 0; i < maxIterateNums; ++i) { updatePixels(); bool changed = updateClusteringCenter(); if (!...
ALGO
0.9938
4.484523
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-04-22T14:10: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": "f127f4f567e9...
fc2d5150-cd2f-4bc5-b676-39d9a0d59e22
andersonmrib/Competitive-Programming
Beecrowd/C++/1500 - Horrible Queries.cpp
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef vector<ull> vi; vi A, st, lazy; int l(int p) { return (p<<1)+1; } int r(int p) { return (p<<1)+2; } ull conquer(ull a, ull b){ if(a == -1) return b; if(b == -1) return a; return a+b; } void build(int p, int L, int R){ if(L...
ALGO
0.999687
4.968203
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2025-06-09T14:40:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "576d8dda82b...
7a989715-019a-44f8-bf51-32a885fa5843
lja3723/study_book-ModernCppIntro_console
출판사 예제 파일/chapter2/PenApp/App1-1/CoinMoneyApp.cpp
//========================================================= // 응용 과제 1-1 // 1장의 응용 과제 1을 발전시킴 // C 포인터 버전 //========================================================= #include <iostream> using std::cout; using std::endl; struct CoinMoney { int c50; int c100; int c500; }; inline int CoinMoney_value(const CoinMoney& ...
TOOL
0.956682
4.621404
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2022-01-08T11:50: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": "7f3f134d9...
3adbd1ca-5aee-47e1-8a01-f99af4ef3786
gromanx/CSE_330
lab5.cpp
/* <NAME> * Lab 5 * This program develops and implements the concept of linked lists. * July 18, 2019 */ // libraries #include<iostream> #include<cassert> using namespace std; // Lnode interface template <typename T> class Lnode { public: T data; Lnode *lptr; // left pointer Lnode *rptr; // right poin...
ALGO
0.968794
5.057684
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-04-01T21:49: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": "b50e0c6ded...
280af22e-da54-419f-a111-6ef2df93b9c7
ethz-asl/ethzasl_ptam
ptam/thirdparty/agast/src/agast5_8_nms.cc
// // agast5 - AGAST, an adaptive and generic corner detector based on the // accelerated segment test for a 8 pixel mask // // Copyright (C) 2010 <NAME> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as publis...
ALGO
0.998818
4.901958
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2011-11-22T17:20:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 234, "forks": 183, "issues": 45, "pull_requests": 4 }, "file_meta": { "content_id": "850d...
55bdfd55-60a5-4e01-b247-87989dfb9fd6
ishandutta2007/codeforces-m
maximumshot/normal/571/A.cpp
#include <iostream> #include <cmath> #include <math.h> #include <vector> #include <algorithm> #include <stdio.h> #include <cstring> #include <string> #include <set> #include <map> #include <stack> #include <queue> using namespace std; #define vec vector #define ALL(x) (x).begin(), (x).end() #define mp make_pair type...
ALGO
0.99971
4.132636
{ "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": "7cf36c47950f...
21f5cea8-57d7-4c05-82f8-ae4ba4fc0c8d
ada2161/Codeforces
Seating on a bus.cpp
/* Problem link: http://codeforces.com/problemset/problem/660/B Problem name: Seating on a bus Consider 2n rows of the seats in a bus. n rows of the seats on the left and n rows of the seats on the right. Each row can be filled by two people. So the total capacity of the bus is 4n. Consider that m (m ≤ 4n) people occ...
ALGO
0.999986
3.243768
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-11-16T01:10: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": "63b96071b8...
6b5abae9-183b-4ca4-8dd8-0f1954fade04
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/ai_code/train/0_0_1657.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; const long long MOD = 1e9 + 7; int main() { int n; long long T; cin >> n >> T; vector<int> t(n); for(int i = 0; i < n; i++) { cin >> t[i]; } sort(t.begin(), t.end()); long long num_solved = 0; ...
ALGO
0.999994
5.001538
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "508a5f20e3b...