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
bdaffc8c-feb2-40ac-84a8-a5405d7da167
vuquelam28/competitive-programming-topics
basic_problems_c++/lec10_reference_and_pointer/thay_the_phan_tu/solution.cpp
#include <iostream> using namespace std; int arr[101]; void input_array(int n, int* p_arr) { for (int i = 0; i < n; ++i) cin >> *(p_arr + i); } int find_max_array(int n, int *p_arr) { int max_value = 0; for (int i = 0; i < n; ++i) if (*(p_arr + i) > max_value) max_value = *(p...
ALGO
0.999522
4.097892
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-08-02T16:27: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": "d7750053451f...
a5d1df7d-0d77-4dc1-8132-30ae1c8941df
anyalallart/CIR2
algo/tp-d6/main.cpp
#include <iostream> #include <vector> #include <string> using namespace std; const int TAILLEDUGRAPHE = 6; const int INFINI = 9999999; std::vector<string> vecSommets; int arcs [TAILLEDUGRAPHE][TAILLEDUGRAPHE]; int cheminCourt [TAILLEDUGRAPHE][TAILLEDUGRAPHE]; int pointChemin [TAILLEDUGRAPHE][TAILLEDUGRAPHE]; void ...
ALGO
0.999848
4.181746
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-09-02T09:49:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1368f675161e...
b5cea4d4-05a0-44ec-b257-3a96e014052e
kisssick0/algorithms
module_3/2/main.cpp
//Дан невзвешенный неориентированный граф. В графе может быть несколько кратчайших путей между какими-то вершинами. Найдите количество различных кратчайших путей между заданными вершинами. //Требования: сложность O(V+E). //Формат ввода. //v: кол-во вершин (макс. 50000), //n: кол-во ребер (макс. 200000), //n пар реберны...
ALGO
0.999822
5.3785
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-29T12:04: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": "d0539c9b89be...
c2e5ea01-edbd-4424-81fb-0610f11851ba
bqi343/cp-notebook
Contests/USACO Solutions/2016-17/Dec 2016/Plat/roboherd_slow.cpp
#include<vector> #include<fstream> #include<iostream> #include<algorithm> #include<set> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i=a; i<b; i++) #define F0R(i, a) for (int i=0; i<a; i++) #define pb push_back // ifstream cin ("roboherd.in"); // ofstream cout ("roboherd.out"); ll N,K, ...
ALGO
0.999944
3.093131
{ "github_metadata": { "branch": "master", "commit_count": 1350, "repo_created_at": "2017-07-11T03:52:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2642, "forks": 429, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "05...
b1ae1622-50af-4215-958d-d9daefb08b2f
molujia/graph_algorithm_package
loop_removing1.cpp
#include <iostream> #include <vector> #include <algorithm> // for std::remove #include <queue> using namespace std; class Graph { public: int V; vector<vector<int>> adj; Graph(int V); void addEdge(int u, int v); void removeEdge(int u, int v); bool detectAndRemoveCycle(); }; Graph::Graph(int...
ALGO
0.99967
6.115837
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-09-01T12:28:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa8f1ce2b801...
b3eda5c5-9983-4ba6-91c5-1485e8c6c9a8
re2201225/ADVALGO-CW
Task2.cpp
//#include <iostream> //using namespace std; // //// Node structure for doubly linked list //struct Node { // int data; // Node* next; // Node* prev; // Node(int data) : data(data), next(nullptr), prev(nullptr) {} //}; // //// Function to append node to the end of the doubly linked list //void append(Node**...
ALGO
0.999992
6.351949
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-04-27T20:56:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5d18c3a1e...
794c21c1-9853-4ccd-9850-e557ce772c81
jindalshivam09/cppcodes
ACM/n-queen.cpp
#include<iostream> #include<vector> using namespace std; class Solution { public: int ans, lim; void solve(int row, int ld, int rd) { if (row == lim) { // have placed row queens ans ++; // we have a solution return; } int pos = lim & (~(row | ld | rd)); // val...
ALGO
0.99999
5.120206
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2014-08-21T11:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6c3296755...
9578d41d-41d4-4d33-bf90-5d6e4076a29f
hafizcode02/coding-cpp-kuliah
Semester 3/STRUKDATA/Pertemuan 9/2.CPP
#include <iostream.h> #include <stdio.h> #include <conio.h> #include <stdlib.h> struct Node { char data; Node * kiri; Node * kanan; }; int count; void tambah(Node **root, char databaru) { if ((*root) == NULL) { Node *baru; baru = new Node; baru->data = databaru; baru->kiri = NULL; baru->k...
ALGO
0.998963
3.227551
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-11-04T12:08: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": "421d2085ef1c...
7520361f-024f-464f-934b-205248f314f4
ishandutta2007/codeforces-i
intothenight/normal/1158/D.cpp
#include <bits/stdc++.h> using namespace std; template<class T> struct point{ T x{}, y{}; point(){ } template<class U> point(const point<U> &otr): x(otr.x), y(otr.y){ } template<class U, class V> point(U x, V y): x(x), y(y){ } template<class U> explicit operator point<U>() const{ return point<U>(static_cast<U>(x)...
ALGO
0.999977
3.740265
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39: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": "a26a93c751ff...
b6945788-a59b-4c5d-b334-1d481df09997
watashi/AlgoSolution
codeforces/140/A2.cpp
#include <cmath> #include <cstdio> #include <algorithm> using namespace std; const double EPS = 1e-8; const double PI = acos(-1.0); bool gao(int n, double R, double r) { if (r > R) { return false; } else if (n == 1) { return true; } else if (r > R / 2) { return false; } else {...
ALGO
0.99821
3.545501
{ "github_metadata": { "branch": "master", "commit_count": 522, "repo_created_at": "2011-10-06T10:40:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 204, "forks": 61, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d023b...
dd7e86bc-fe6e-42c6-9a2c-a6d81ee9eadb
Sh3ra2/C-CPlus-tasks
calculator.cpp
#include<iostream> using namespace std; class calculate { public: float add(float a,float b) { float c; c=a+b; cout<<"Sum of numbers is "<<c; } float mult(float a,float b) { float c; c=a*b; cout<<"Multiplication of numbers is "<<c; } float sub(float a, float b) { float c; c=a-b; ...
TOOL
0.925714
3.06778
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2022-09-08T08:11:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3a9fbe66962...
b74d8120-a6d7-440f-ac16-863d6744284d
trox667/aoc
2021/cpp/day_17.cpp
// // Created by trox667 on 17.12.21. // #include "day_17.hpp" #include "utils.hpp" #include <iostream> #include <regex> namespace day17 { struct Area { long sx, ex, sy, ey; }; struct Hit { long x, y, maxy; }; [[nodiscard]] Area get_input(const std::string &line) { std:...
ALGO
0.998769
5.54913
{ "github_metadata": { "branch": "main", "commit_count": 226, "repo_created_at": "2020-11-27T17: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": "7036324cdd...
39dd5b29-ce20-4f5e-a0b1-6becdcb975f0
Ary0405/leetcode_problems
Stack/valid_parenthesis.cpp
// Problem - 20 (Valid Parenthesis) // Time Complexity - O(n) // Space Complexity - O(n) #include <iostream> #include <vector> #include <algorithm> #include <stack> using namespace std; bool isValid(string s) { if (s.length() == 0) { return true; } stack<char> st; bool isV = true; f...
ALGO
0.998415
6.16916
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2024-06-03T04:05: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": "c74d90a3e4...
c20759d9-58a2-4922-9351-7408e60b6829
anshyyy/CPP
Atcoder/abc231_c.cpp
#include <bits/stdc++.h> #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define loop(i,a,n) for(int i=a;i<n;i++) typedef long long ll; const ll INF = 1e9+7; const ll MOD = 998244353; using namespace std; int countGreater(vector<ll>&arr, ll n, ll k) { int l = 0; int r = n - 1; ...
ALGO
0.999935
5.110281
{ "github_metadata": { "branch": "master", "commit_count": 339, "repo_created_at": "2021-04-30T13:43:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1221af48...
50a5d977-1ead-4883-9b6e-e0bf7e27fdd4
HPC-Fortran2CPP/Fortran2Cpp
data/deepseek_coder_base_6.7B/readable_format_HPEC/cpp/file205.cpp
Certainly! Below is the translated Fortran code to C++. Note that in C++, arrays are zero-indexed, unlike Fortran which is one-indexed. Also, C++ does not have a direct equivalent of Fortran's `write` statement for formatted output, but we can use `std::cout` with formatting. ```cpp #include <iostream> #include <ioman...
ALGO
0.920962
6.269381
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-04-05T20:02:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 5, "issues": 55, "pull_requests": 0 }, "file_meta": { "content_id": "bb9a8c0410...
f614e245-1401-4479-a7da-23e46ac2f8fd
Prathmesh311/DSA
Linked List/MaximumTwinSumofaLinkedList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: int pairSum(ListNode*...
ALGO
0.999937
5.627856
{ "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": "f69c35dc...
d5e00fa7-d1f8-40aa-b5d3-2b626dc0e427
opencv/opencv
apps/createsamples/utility.cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
TOOL
0.97996
5.470315
{ "github_metadata": { "branch": "4.x", "commit_count": 35401, "repo_created_at": "2012-07-19T09:40:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 83079, "forks": 56217, "issues": 2595, "pull_requests": 138 }, "file_meta": { "content_id"...
d8022c1a-9df5-4591-88b1-db3abbc3211a
kaushik27mishra/Daily_Practice_CP-DSA
geeksforgeeks/look_up_table_count_set_bits.cpp
#include <bits/stdc++.h> using namespace std; #define deb(x) cout<<#x<<" "<<x<<endl; #define fo(i,n) for(int i=0;i<n;i++) #define Fo(i,k,n) for(int i=k;i<n;i++) #define N 101 #define ll long long #define endl "\n" #define mod 1000000007 #define pb push_back #define F first #define S second #define mp make_pair #define...
ALGO
0.999505
3.67371
{ "github_metadata": { "branch": "master", "commit_count": 291, "repo_created_at": "2020-04-02T07:28:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 111, "forks": 43, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f52c2...
dbb92598-5d9e-4816-96b9-79c4eccb3a17
bruno-omf/AED
Classes/Class 6 - Searching Algorithms/binarySearch.cpp
#include <iostream> # include <stdio.h> #define SIZE 12 using namespace std; int binarySearch(int vector[], int key) { int start = 0, end = SIZE - 1, middle; while (start <= end) { middle = (start + end) / 2; // divisoes sucessivas do array pra poder encontrar o meio dele, ou seja, o valor do meio d...
ALGO
0.999901
4.437172
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2025-03-16T20:43:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72730e3c8b3...
0884bd5e-c88c-4a8a-94c9-6c8337b7757e
kuriringohankamehameha/neuralnet
main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <string> #include <math.h> #include "lol.hpp" perceptron::perceptron(float eta, int epochs) { m_epochs = epochs; m_eta = eta; } void perceptron::fit(vector< vector<float> > X, vector<float> y) { for (int i = 0; i < X[0...
DATA
0.955105
4.731735
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-11-08T11: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": "5c346139ef...
71c123d7-2aaf-4d79-b2a4-fdec114fc3f8
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/04/0404/personal_submission/cf852b_Nreyog.cpp
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; vector<vector<int>> mat_mul(vector<vector<int>>& a, vector<vector<int>>& b) { // 给定n x p和p x m的两个矩阵a和b, 求a x b int n = a.size(), p = a[0].size(), m = b[0].size(); int mod = 1e9 + 7; vector<vector<int>> c(n, vector<int> (...
ALGO
0.999908
4.418908
{ "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": "4e3b...
3679239b-6832-40ab-aa39-8639de5ad8cf
roaming-debug/Cipher-Experiment
AHCJ018/RC4/RC4.cpp
#include <stdio.h> #include <string.h> void InitS(unsigned char *s) { int i; for(i=0;i<256;i++) s[i]=i; } void InitT(unsigned char *t,char *key) { int i; for(i=0;i<256;i++) { t[i]=key[i%strlen(key)]; } } void Swap(unsigned char *s,int first,int last) { unsigned char temp; temp=s[first]; s[first]=s[la...
ALGO
0.999433
3.562919
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-10-15T12:30:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b14b6fde2...
ddbf2b18-f6ee-49b5-ba0c-7ed1b745b3dc
domejiraphon/algorithm
practice/957_prisonAfterNDays.cpp
/* 957. Prison Cells After N Days There are 8 prison cells in a row and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to the following rules: If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied. Otherwi...
ALGO
0.999946
5.554494
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2022-09-02T14:28: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": "83648edb38...
7860e96d-64f9-47f2-8f26-7254b9d53bc6
hmnshudhmn24/ar-ruler-opencv-cpp
main.cpp
#include <opencv2/opencv.hpp> #include <opencv2/aruco.hpp> #include <iostream> using namespace cv; using namespace std; const float MARKER_SIZE = 0.05f; // 5 cm marker void detectArucoMarkers(Mat &frame, Ptr<aruco::Dictionary> &dictionary, Ptr<aruco::DetectorParameters> &parameters) { vector<int> markerIds; ...
TOOL
0.905429
6.127741
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-02-16T05:54: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": "bb834b479c98...
42dec063-a132-4756-9f53-f2f9774bb8b8
google/monster-mash
third_party/libigl/include/igl/screen_space_selection.h
#ifndef IGL_SCREEN_SPACE_SELECTION_H #define IGL_SCREEN_SPACE_SELECTION_H #include "igl/igl_inline.h" #include <Eigen/Core> #include <vector> // Forward declaration namespace igl { template <typename DerivedV, int DIM> class AABB; } namespace igl { // Given a mesh, a camera determine which points are inside of a g...
ALGO
0.998819
6.170921
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-01-28T21:04:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1312, "forks": 182, "issues": 24, "pull_requests": 0 }, "file_meta": { "content_id": "167d01...
9187ee8a-2dc4-42a2-9535-d4c943b039d9
SCahmedmohamed/Competitive-Programming
codeforces/1037D. Valid BFS?.cpp
// By <NAME> . Apr/10/2022 22:20 #include <bits/stdc++.h> using namespace std; #define ld long double #define ll long long #define el endl #define ff first #define ss second #define Scorpion ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const int N = 2e5 + 5; int n , ord[N] , a[N]; vector<int> g[N]; bool vis[N];...
ALGO
0.999989
4.201051
{ "github_metadata": { "branch": "main", "commit_count": 296, "repo_created_at": "2021-11-21T13:11: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": "883f8eb857...
4c55e5bf-3c9e-4e9a-9f8d-2507ebe3d2f2
abdullahkhan-AI/C-Plus-Plus
074_Email_Validation.cpp
#include <iostream> using namespace std; int main() { char email[50]; int atlocation; bool before = false, at = false, dotafterat = false, textafterat = false; cout << "Enter a valid email address: "; cin >> email; if (email[0] != '@' && email[0] != '.') { before = true; for (int i = 1; email[i] != '\0'; i+...
TOOL
0.975429
4.075913
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2020-12-13T09:51: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": "c251eb9b73e...
7e0955c9-5b30-48da-8a25-9f69d435a99c
saumyaranjan1111/CP-Practice
Combinatorics/B_Alice_and_the_List_of_Presents.cpp
//headers #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define endl "\n" #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 #define INF 1e18 #define pb push_back #define ppb pop_back #defin...
ALGO
0.999993
4.541895
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-02-05T07:49: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": "59a246eac714...
81a2af08-6162-4fd0-94a3-a6d8b6955319
SHIKHArajCHAUHAN/leetcode
0919-complete-binary-tree-inserter/0919-complete-binary-tree-inserter.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999972
6.025218
{ "github_metadata": { "branch": "main", "commit_count": 4702, "repo_created_at": "2022-03-18T06:48:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4efb84b08...
79e9b6c9-1a21-4150-84c0-3d389f0f8c0d
vishalpandya1990/HeckerRankProblems
merging_communities.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; /* * Problem statement :- https://www.hackerrank.com/challenges/merging-communities/problem */ typedef long long ll; struct component { ll parent; }; ll getRoot(component c[], ll n, ll idx) { ...
ALGO
0.999958
3.999133
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2017-07-30T10:22: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": "0383d3779...
7ace39e6-38d6-4ded-b437-743409a76fe9
aestesis/elektronika
src/Alib/flashSDK/Source/sndcodec.cpp
/**************************************************************************** CONFIDENTIAL AND PROPRIETARY INFORMATION. The entire contents of this file is Copyright © Macromedia, Inc. 1993-1998, All Rights Reserved. This document is an unpublished trade secret of Macromedia, Inc. and may not be viewed, copied or dis...
TOOL
0.94812
5.948935
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2012-03-25T13:55:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 25, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96a44daf...
68e629d4-6bec-47c9-8cd1-00f33999cf5b
pratham-0094/50DaysOfCode
Day-29/DistanceBetweenTwoNodes.cpp
#include <iostream> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int val) { data = val; left = NULL; right = NULL; } }; Node *LCA(Node *root, int n1, int n2) { if (root == NULL) { return NULL; } if ...
ALGO
0.999992
5.649868
{ "github_metadata": { "branch": "main", "commit_count": 367, "repo_created_at": "2021-10-01T15:56: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": "5db5a5d299...
370a4700-26b4-405b-bbc7-4cc6fdcb4561
leopnt/neft
NEFT/src/organism.cpp
#include "NEFT/organism.hpp" Organism::Organism( const int& brainInputSize, const std::vector<int>& hiddenLayersSizes, const int& braineOutputSize): m_fitness(0.f), m_brain(brainInputSize, braineOutputSize), m_isDead(false) { // add hidden layers for(const int& layerSize: hi...
ALGO
0.948664
5.822495
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-06-20T11: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": "de275e11e59b...
8e54248c-8f4b-4e5f-aa7d-552d867f8b0b
eval-exec/Algorithm
LeetCode/Minimum_Adjacent_Swaps_to_Reach_the_Kth_Smallest_Number/main.cxx
#include <bits/stdc++.h> #include <gtest/gtest.h> using namespace std; //// START /* ## Minimum Adjacent Swaps to Reach the Kth Smallest Number */ class Solution { public: int getMinSwaps(string num, int k) { vector<int> nums; for (auto n : num) { nums.push_back(n - '0'); } ...
ALGO
0.999942
6.286012
{ "github_metadata": { "branch": "master", "commit_count": 643, "repo_created_at": "2020-12-27T13:17:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "763d47e6...
de0a0671-8ed6-4c00-b6b3-d656227083e7
ismdeep/ICPC
hdu/2098/main.cpp
#include <iostream> using namespace std; #define MAXN 10010 bool iIsPrime[MAXN]; void iMakePrime() { // 素数打表,因为这里素数不是那么多,范围也就10000以内。 // 这个素数打表有点思维变换的那种 ,,,iIsPrime[i] ,表示i是不是素数,如果为true,则是素数,否则不是。 for (int i = 0; i < MAXN; i++) { iIsPrime[i] = true; } iIsPrime[0] = false; iIsPrime...
ALGO
0.999635
4.286179
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2013-04-30T07:19:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "48182051...
8bbd89a6-d771-4607-bdf3-db0a51ddb162
Shahraaz/CP_S4
codeforces/practice/DIV2_418D.cpp
//Optimise #include <bits/stdc++.h> using namespace std; #define Online 1 // #define multitest 1 #define Debug 1 void ControlIO(); void TimerStart(); void TimerStop(); #ifdef Debug #define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__); template <typename Arg1> void ZZ(const char *name, Arg1 &&arg1) { std::cerr << name << " =...
ALGO
0.99966
4.531206
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2019-05-19T15:08: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": "d9e212a9e...
5c84c092-fc34-4cd9-972b-ad84125bb4f9
youngsangc/foscar-international-student-car-competition-2023
src/lidar_team/lidar_team_morai/src/dbscan_morai.h
#ifndef DBSCAN_H #define DBSCAN_H #include "header_morai.h" #define UN_PROCESSED 0 #define PROCESSING 1 #define PROCESSED 2 inline bool comparePointClusters (const pcl::PointIndices &a, const pcl::PointIndices &b) { return (a.indices.size () < b.indices.size ()); } template <typename PointT> class DBSCANSimpleC...
ALGO
0.996028
5.833581
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2023-07-11T09:01:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59213d584c5...
c2feaa4e-6ef0-481c-96ff-8544f45f3b16
vnsrz/TEP
lista_2/d.cpp
// Shortest path of the king #include <bits/stdc++.h> using namespace std; using ll = long long; void solve(string s, string t){ int dist_x = abs(s[0]-t[0]); int dist_y = abs(s[1]-t[1]); cout << max(dist_x, dist_y) << endl; while (s != t) { if (s[0] < t[0]) { cout << "R"; ...
ALGO
0.999979
4.660742
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2023-09-03T23:41: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": "a7d67e641c1...
0c0be63e-80ef-45bc-84f5-690c9883a3ef
trilinos/Trilinos
packages/kokkos-kernels/batched/dense/impl/KokkosBatched_ApplyQ_TeamVector_Impl.hpp
//@HEADER // ************************************************************************ // // Kokkos v. 4.0 // Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Governmen...
ALGO
0.903699
7.372779
{ "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":...
73ce428c-6d66-4efd-84fc-603a60d72f17
Larissagilliane/Algorithms
Merge e Quick sort/quick_sort.cpp
#include <iostream> // cont , endl #include <vector> // vector #include <algorithm> // copy #include <iterator> // ostream_iterator #include <utility> //swap //QUICK SORT typedef std::vector<int>::iterator T; //Compara valores inteiros bool compare( int a, int b ) { return ( a < b ); } T particao( T first, ...
ALGO
0.99985
5.605159
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-01-29T11:56: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": "edb9317415...
c2d3ad9c-8bac-4e47-854b-71cc558e7eb3
Prashant0664/gfg-solutions
word-baggle.cpp
// // //{ Driver Code Starts // // // Initial template for C++ // // #include <bits/stdc++.h> // // using namespace std; // // // } Driver Code Ends // // class Solution { // // public: // // int verify(int i,int j,int n,int m){ // // if(i<0||j<0||i>=n||j>=m){ // // return 1; // // } // // return...
ALGO
0.998323
5.293958
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2023-01-18T14:53: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": "c62beca7a...
6c570b19-dea9-4efc-90b3-17f178364142
xdfc1745/GWNU-Junior
Algorithm/algorithm/ks3.cpp
#include <iostream> #define MAX 50 using namespace std; int W[] = { 2, 4, 5, 8, 3 }; int P[] = {4, 6, 8, 9, 6}; float ks_DP_3(int n, int M) { float Sx[6][20], Sy[6][20], SPx[6][20], SPy[6][20]; //(Sx[물건갯수][물건무게], Sy[물건갯수][물건무게]) = S(x,y) Ki-1(W) //(SPx[][], SPy[][]) = SP(x,y) Ki-1(w-w[i])+P[i] float high = 0, ho...
ALGO
0.99991
3.310073
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-11-20T03:08:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84249d354...
63f0f418-9af0-4ac4-9181-d6b6c47b4ffb
Nalluh/CPSC335
project_2_c.cpp
//<NAME> //CPSC-335 //7.17.21 //Using HeapSort/MinHeap to organize multiple merged LinkedLists #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; };//end Node //Creating our nodes for sorting struct Node* newNode(int data) { // Allocate node struct Node* new_n...
ALGO
0.99994
5.590862
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-07-14T00:58:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1bcd82ffe26d...
d21cafc1-9ddd-4079-817b-266eb613321c
Follow-my-Flow-GaLA/v8
src/code-regex-extractor.cc
#include <iostream> #include <string> #include <regex> #include <vector> #include <algorithm> // For std::find // namespace v8 { // namespace internal { class CodeRegexExtractor { private: std::vector<std::string> keywords = { "abstract", "arguments", "boolean", "break", "byte", "case", ...
TOOL
0.968191
3.705722
{ "github_metadata": { "branch": "main", "commit_count": 32895, "repo_created_at": "2023-11-29T18:51:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1557ec1dc...
9929036b-38fc-48c1-b372-8dfca9297494
hrithik712/C-Codes
insertLinkList.cpp
#include<iostream> using namespace std; class Node { public: int data; Node *next; //constructor... Node(int data) { this->data=data; this->next=NULL; } // destructor.. ~Node() { int value = this->data; // memory free.. if(this->next != NUL...
ALGO
0.999741
4.520075
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-03-27T17:40:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "43ce462cddf2...
da0e2191-9103-488f-a274-ce84b07d61a5
lk-box/Project1
Project1/PNPSolver.cpp
#include "PNPSolver.h" #include "Drawline.h" // 本类用于快速解决PNP问题,顺带解决空间绕轴旋转以及图像系、相机系、世界系三系坐标投影问题 // 调用顺序: // 1.初始化本类 // 2.调用SetCameraMatrix(),SetDistortionCoefficients()设置好相机内参数与镜头畸变参数 // 3.向Points3D,Points2D中添加一一对应的特征点对 // 4.调用Solve()方法运行计算 // 5.从RoteM, TransM, W2CTheta等属性中提出结果 // // 原理参见:http://www.cnblogs.com/singlex/...
ALGO
0.999344
4.283768
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-12-24T05:03:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c70736bdf...
3fd491a2-3359-4abb-8c5a-8793fa76eb35
daroo-m/lab04
findNumInArray2.cpp
#include <iostream> const int NUM_COLS = 5; // Example column size, can be any value bool isFound(int arr[][NUM_COLS], const int numRows, const int val) { // Iterate over each row for (int i = 0; i < numRows; ++i) { // Iterate over each column in the current row for (int j = 0; j < NUM_COLS; ...
ALGO
0.999535
6.208068
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-16T00:26: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": "28bc13fe1034...
5bbccbfa-d8e9-4cc0-a0d8-c027afbf5682
nehcoah/algorithm-template
atcoder/abc/374/c.cpp
#include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; using u32 = unsigned; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> k(n); for (int i = 0; i < n; i++) { cin >> k[i]; } ll tot = accum...
ALGO
0.999987
4.378097
{ "github_metadata": { "branch": "main", "commit_count": 591, "repo_created_at": "2023-09-11T02:34: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": "9db6b12d3c...
c0ef08fd-6962-4630-b315-26c5a4417bb0
Nignik/competetive_programming
src/other/ChmaxRush.cpp
#include <bits/stdc++.h> using namespace std; constexpr long long MOD = 998244353; bool check(int p, int k, vector<int>& vec) { if (vec[p] == 0) vec[p] = k; else if (k != vec[p]) return false; return true; } int main() { int n, q; cin >> n >> q; vector<int> p(q), v(q), k...
ALGO
0.999949
4.496619
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-03-08T19:56: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": "c28b1833e4a...
fbb1a210-54fe-41d3-bcaf-3a19fdd44e75
yogykwan/acm-challenge-workbook
src/poj2836.cpp
/* * POJ 2836: Rectangular Covering * 题意:给出平面上n个点,用若干矩形将所有点覆盖,要求每个矩形覆盖至少2个点。求矩形的面积和最小值。 * 类型:状态DP * 算法:状态内的点一定被覆盖,但被覆盖的点不一定在状态内,预处理出任意两点构成的矩形面积和包含的点状态。记忆化dp递归时,选取状态内的点与整个平面的点构成矩形。 */ #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int INF = 0x3f3f3f3f; int d[1 << 15]; int ...
ALGO
0.999784
3.834753
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2016-11-12T12:14:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1766, "forks": 340, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "187b...
0e3c7c1e-67b6-46c6-991d-59035c78ffff
blakeim/ACM-Programming-Contest-Solutions
vertexes.cpp
#include <iostream> #include <cstdio> using namespace std /* Vertex (UVa 280) https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=216 Author: <NAME> & <NAME> Date: 03/15/2013 This problem was meant to be an implementation of a shortest path algorithm. We were given input represe...
ALGO
0.999562
3.707062
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-04-02T03:32:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd7760a5d2...
c1c1ded7-0912-4952-ad5f-52fb814d3464
satyamtiwari07/Strivers-SDE-Sheet-Challenge
Complete_String.cpp
#include <bits/stdc++.h> class Node{ public: bool flag = false; Node* links[26]; bool contains(char c){ return links[c - 'a'] != nullptr; } void put(char c){ links[c - 'a'] = new Node(); } Node* next(char c){ return links[c - 'a']; } void setEnd(){ f...
ALGO
0.999979
5.181365
{ "github_metadata": { "branch": "main", "commit_count": 188, "repo_created_at": "2023-06-05T05:16:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a0894bb76...
25abd65f-fd3a-4245-bd6b-02a3f4f773bf
ishandutta2007/codeforces-h
hellkitsune/normal/429/C.cpp
#include <cstdio> #include <cmath> #include <cstring> #include <string> #include <sstream> #include <algorithm> #include <iostream> #include <iomanip> #include <map> #include <set> #include <list> #include <queue> #include <stack> #include <vector> #include <cassert> using namespace std; #define pb push_back #define ...
ALGO
0.999996
3.348417
{ "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": "4a7480ca3d7c...
c2c675bb-73b0-49c1-98e0-b6366c98ad3f
AmanAssassin/DSA
CP/Codechef/Chef and Closure .cpp
#include <bits/stdc++.h> #include <algorithm> using namespace std; #define fastio() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 #define INF 1e18 #define nline "\n" #define pb push_back #define pp...
ALGO
0.999938
4.400076
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2021-08-24T02:30:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8dd7db878...
11f77825-3bf5-497f-983a-bc9ba08e9441
tzupengwang/PECaveros
contest/opencup/XVIII/Urals/d.cpp
#include <bits/stdc++.h> using namespace std; #define N 10000010 typedef long long LL; const int mod = 1000000007; inline int add( int a , int b ){ a += b; return a >= mod ? a - mod : a; } inline int sub( int a , int b ){ a -= b; return a < 0 ? a + mod : a; } inline int mul( LL a , int b ){ a *= b; return a...
ALGO
0.999335
3.59407
{ "github_metadata": { "branch": "master", "commit_count": 448, "repo_created_at": "2014-08-20T16:02:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 51, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70d1862...
ee2155fa-8e80-48bf-a70e-9f5cefdcd318
bigstupidx/acm_problem_code
poj/1502/7051450_AC_0MS_628K.cc
#include <cstdio> #include <queue> #include <cstring> using namespace std; struct edge{ int to; int d; edge *next; }edg[20010], *vert[102]; char str[20]; const int inf = 1000000000; int n, dis[102], mark[102]; struct QN{ int u; int d; bool operator <(const QN &a)const{ return a.d < d; }...
ALGO
0.996128
3.297838
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2013-09-06T08:43:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51468acce...
1882a498-72d0-4d24-aad1-548846284e02
ch812248495/Leetcode-Everyday
longestPalindromicSubstring.cpp
// Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. // Example 1: // Input: "babad" // Output: "bab" // Note: "aba" is also a valid answer. // Example 2: // Input: "cbbd" // Output: "bb" #include "head.cpp" bool f(string s,int left,int right) { ...
ALGO
0.999847
5.513593
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-10-23T20:18: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": "ed5c232a4f...
2ca4d1ec-62a4-40a2-9bf2-c922fde44cd5
JoyM1K1/Atcoder
ABC/130/D.cpp
#include <bits/stdc++.h> #define REP(i, N) for (int i = 0; i < (N); ++i) #define ALL(x) (x).begin(), (x).end() #define MOD 1000000007 #define PB push_back #define MP make_pair using namespace std; typedef long long ll; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll div_ceil(ll, ll); int dx[4] = {0, 0, -1, 1};...
ALGO
0.999933
4.178251
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2019-08-28T02: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": "99f4e9a84...
d1d9ebf1-c18a-4499-bb2d-b6acef832a0f
choijiwoong/-ROKA-Cpp-tutorial-files
C++ review_1/32. thread_join & detach, printf, one memory to MultiThread.cpp
#include <iostream> #include <thread>//CreateTread in Window, pthread_create in Linux #include <vector> //Logical error if threads access to same memory. void worker(int& counter){ for(int i=0; i<10000; i++) counter+=1; } int main(){ int counter=0; std::vector<std::thread> workers; for(int i=0; i<4; i++) w...
TOOL
0.981102
5.205132
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2021-06-25T14:15: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": "355f800e9f...
0ded341f-cc2c-4935-a12a-752933e0bd01
mariosal/algo
spoj/dict.cc
#include <cstdio> #include <string> #include <map> using namespace std; struct Trie { bool word; map< char, int > children; }; void add( Trie *T, int &size, char *s ) { char i; int cur; map< char, int >::iterator it; cur = 0; for ( i = 0; s[ i ]; ++i ) { it = T[ cur ].children.find( s[ i ] ); ...
ALGO
0.999878
4.231192
{ "github_metadata": { "branch": "master", "commit_count": 267, "repo_created_at": "2013-10-09T13:28: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": "82e47726...
60762934-1b6d-4154-a177-f05dee4bee1b
allamberto/CSE20311
lab5/digits/dig_vect2.cpp
#include <iostream> #include <vector> using namespace std; //pass freq by reference so it changes without having to return a value void findfreq(vector<int> digits, vector<int>& freq); void results(vector<int> digits, vector<int> freq); int main() { //array with random digits vector<int> digits = {4,3...
ALGO
0.998721
5.036918
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2017-12-21T18:44: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": "1afc9bc0b...
15e8ddc3-e62e-40db-b84a-614f68ab1841
ishandutta2007/codeforces-j
jakube/normal/375/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.precision(10); cout << fixed; int n, m; cin >> n >> m; vector<string> v(n); for (int i = 0; i < n; i++) cin >> v[i]; vector<vector<int>> right(m, vector<int>(n, 0)...
ALGO
0.999937
4.067588
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:42: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": "a3cdd129fc27...
38e78383-b878-40ea-8d26-e02530928cad
mzykovich/std_homeworke3
Pr11/Pr11/Source.cpp
#include<iostream> #include<cmath> using namespace std; int main() { cout << "Enter Number:"; int a, b, c; cin >> a >> b >> c; if (a >= b && b >= c) cout << c << " " << b << " " << a<<endl; else if (b >= c && c >= a) cout << a << " " << c << " " << b << endl; else if (a >= c && c >= b) cout << b << " " << c...
ALGO
0.999399
3.505993
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-10-30T20:37: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": "0195113ac8...
57786933-8edf-40ef-89e4-e87abac73fee
HetP1742431/Cpp-Programs
pointers concept/chasing.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { // declare variables int S, A; cin >> S >> A; int ptr_arr[A]; vector<int> seen_ptrs {0}; // read the input for (int i = 0; i < A; i++) { cin >> ptr_arr[i]; } // solve the problem if (ptr_arr[0] ...
ALGO
0.999949
3.220505
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-03-21T00:57:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "863bddc2d6e...
256a1bca-3c9e-4ada-8758-a938a070c1a7
S-u-e-t-a/Roman_LIPOIS_LABS
Lab2/Lab2.cpp
#include <iostream> #include <windows.h> #include "Math.h" #include "Matrix.h" #include "table_printer.h" int TryGetIntUntilSuccess(std::string inputMessage) { std::cout << inputMessage << std::endl; std::string inputtedString; getline(std::cin, inputtedString); //cin >> inputtedString; try { ...
TOOL
0.952806
3.535155
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2022-09-15T10:06:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5397c1df0d...
2e5cb7f5-dfda-470b-a2bb-adebcb075966
MrM-7/Daa-Lab
Sorting/SelectionSort.cpp
#include<iostream> using namespace std; void swap(int arr[], int i1, int i2){ int temp = arr[i1]; arr[i1] = arr[i2]; arr[i2] = temp; } void selectionSort(int arr[], int n, int &cmp, int &swp){ for(int i=0; i<n-1; i++){ int min = i; for(int j=i+1; j<n; j++){ cmp++; ...
ALGO
0.999874
5.060388
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2022-03-23T05:18:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92ef0507ac0...
3b64a2cc-ef35-4b15-8191-155bab2653c0
SeisComP3/seiscomp3
src/trunk/libs/seiscomp3/processing/secondarypicker/S_l2.h
/*************************************************************************** * Copyright (C) by <NAME> * * * * You can redistribute and/or modify this program under the * * terms of the...
TOOL
0.905201
6.824001
{ "github_metadata": { "branch": "master", "commit_count": 1963, "repo_created_at": "2014-09-19T08:37:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 112, "forks": 90, "issues": 19, "pull_requests": 3 }, "file_meta": { "content_id": "c900...
98fb2452-4f44-4b29-b638-07224a891d7b
chaofiber/hexapod
src/optLib/src/SQPMinimizer.cpp
//TODO: all jacobians and constraints should be represented in terms of the triplets... #include <fstream> #include <iostream> #include <utils/mathUtils.h> #include "optLib/SQPMinimizer.h" #ifdef CRL_USE_OOQP #include "ooqp/OoqpEigenInterface.hpp" #include "ooqp/ooqpei_assert_macros.hpp" #endif #include "eiquadprog/...
ALGO
0.999902
6.010266
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-08-17T09:38:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a2bae52c63...
b1d71b7f-7c80-4136-a814-919952cf325a
RC-Regalado/leetcode
13.roman.cpp
#include <iostream> #include <iterator> #include <string> #include <map> using namespace std; class Solution { public: int romanToInt(string s) { unsigned ret = 0; map<char, int> nums; nums['I'] = 1; nums['V'] = 5; nums['X'] = 10; nums['L'] = 50; nums['C'] =...
ALGO
0.999608
4.751851
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-04-17T19:11:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d93daf44281...
9d408337-5a9d-4eb2-9e50-63770d9209e5
dmilos/math
src/math/random/vdc.hpp
#ifndef _DDMRM_math_random_VanDerCorput_HPP_ #define _DDMRM_math_random_VanDerCorput_HPP_ // ::math::random::VanDerCorput<scalar_name>( index, base ) // ::math::random::VanDerCorput<scalar_name>( index ); base = 2; // ::math::random::vdc<scalar_name, size_name = unsigned, size_name base_size = 2>{} namespace mat...
ALGO
0.931908
5.671435
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2021-04-05T07:42:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e01a9c310...
e3dcd6d6-c31c-490b-8c74-0843d0d42bc8
arianajdari/llamba
include/llamba/base/multiply_parallel.hpp
#ifndef __MULTIPLY_PARALLEL_HPP__ #define __MULTIPLY_PARALLEL_HPP__ #include <vector> #include <math.h> #include <sched.h> #include <pthread.h> #include <llamba/iterators/iterators.hpp> #include <llamba/settings/settings.hpp> #include <llamba/interfaces/base_parallel.hpp> namespace llamba { namespace base { templ...
ALGO
0.998118
5.674043
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2021-04-11T20:07:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e90c78ed2c4...
5d11a374-e025-4053-831f-1c2a1c5bdfef
jhu-cisst/cisst
cisstNumerical/nmrLSISolver.h
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* Author(s): <NAME> Created on: 2004-10-30 (C) Copyright 2004-2013 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst lice...
TOOL
0.998269
6.340667
{ "github_metadata": { "branch": "main", "commit_count": 4711, "repo_created_at": "2014-03-12T21:45:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 69, "forks": 45, "issues": 22, "pull_requests": 1 }, "file_meta": { "content_id": "02cd4c3...
ac49abec-ef8b-472a-b69e-623de75a73fd
DynasticSponge/erasmus
source/worker_deflate.cpp
// // worker_deflate.cpp // ~~~~~~~~~~~~~~~~~~ // // Author: <NAME> // Copyright (c) 2020 <NAME> (<EMAIL> at <EMAIL> dot com) // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include <algorithm> #include <bitset> #include <chrono> #include <ios...
ALGO
0.9989
3.430324
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-05-04T16:46: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": "f558c9a2cc...
81a36e56-d420-4839-8cc8-49c6b685b553
DennisBui/CIS-22B
LabB2.cpp
/* <NAME> CIS 22B Winter 2016 Assignment B Problem B2 This program will prompt the user for the height and radius of a cone and then use that input to calculate the volume of the requested cone. */ #include <iostream> #include <cmath> using namespace std; const double PI = 3.14159265358979323846; class Cone { ...
TOOL
0.97866
5.820932
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2016-05-23T12:21: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": "c99299f6f...
48391d6f-96d2-4883-881c-16e4a6d10b3d
marioyc/Online-Judge-Solutions
UVA/VI/677 - All Walks of length "n" from the first node.cpp
#include <cstdio> using namespace std; int n,len,path[11]; int M[10][10]; bool found; void search(int pos, int mask, int m){ if(m == 0){ putchar('('); for(int i = len;i >= 0;--i){ printf("%d",path[i]); if(i > 0) putchar(','); } putchar(')'...
ALGO
0.999688
3.555783
{ "github_metadata": { "branch": "master", "commit_count": 364, "repo_created_at": "2010-09-24T16:07:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 603, "forks": 359, "issues": 1, "pull_requests": 9 }, "file_meta": { "content_id": "f519...
15312e73-384f-45cd-85ae-85cd902deb6e
adoggie/Algorithm_Package
RBFNet/RBFN_Algorithm.cpp
// RBFN_Algorithm.cpp: implementation of the RBFN_Algorithm class. // ////////////////////////////////////////////////////////////////////// //#include "stdafx.h" #include <assert.h> #include "RBFN_Algorithm.h" #include <time.h> #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #e...
ALGO
0.996962
3.94346
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-04-08T07:35:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9cd05702bf...
be0b64b2-f67a-42e2-ba04-9ad15ea85f44
lakshay-7014/leetcodeProblems
Painting the Fence - GFG/painting-the-fence.cpp
//{ Driver Code Starts #include <bits/stdc++.h> #include<stdio.h> #include<math.h> using namespace std; // } Driver Code Ends class Solution{ public: #define MOD 1000000007 int mul(int a , int b){ return ((a%1000000007 * 1LL * b%1000000007)%1000000007); } int add(int a , int...
ALGO
0.999982
5.717698
{ "github_metadata": { "branch": "main", "commit_count": 891, "repo_created_at": "2022-05-28T17:55: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": "e4ffe22800...
78400fbf-8463-404b-a6a4-543ff89f8d97
993950972/LeetCode
C++/443. String Compression.cpp
/* Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should be a character (not int) of length 1. After you are done modifying the input array in-place, return the new length of the array. Follow u...
ALGO
0.999983
5.464488
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2018-01-09T04:28: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": "1166232ca...
8875ab26-9993-4096-88a8-2f7797a1abee
ar1936/cpp
Job Sequencing Problem.cpp
#include<bits/stdc++.h> using namespace std; // A structure to represent a job struct Job { int id; // Job Id int dead; // Deadline of job int profit; // Profit if job is over before or on deadline }; // } Driver Code Ends // Prints minimum number of platforms reqquired bool comparison(Job a, ...
ALGO
0.999874
5.057518
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-03-02T08:50: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": "82c6015bc05e...
2221746a-55c1-4ec4-a392-1416cd92bf32
TheAlgorithms/C-Plus-Plus
dynamic_programming/kadane.cpp
/** * @file * @brief Implementation of [Kadane * Algorithm](https://en.wikipedia.org/wiki/Kadane%27s_algorithm) * * @details * Kadane algorithm is used to find the maximum sum subarray in an array and * maximum sum subarray problem is the task of finding a contiguous subarray * with the largest sum * * ### Al...
ALGO
0.999915
6.426684
{ "github_metadata": { "branch": "master", "commit_count": 1738, "repo_created_at": "2016-07-16T10:19:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 32391, "forks": 7439, "issues": 10, "pull_requests": 23 }, "file_meta": { "content_id": ...
b1a664e5-1687-48b1-ba25-a2813534b530
donno2048/nn.cpp
main.cpp
#include <iostream> using namespace std; #include <ctime> #include "nn.h" int main(void) { srand(time(NULL)); NN nn(2, 2, 2, .2); // 2 inputs, 2 hidden, 2 outputs, learning rate .2 float input[2] = {0, 0}; unsigned int output = 0; for (unsigned int i = 0; i < 1e5; i++) { input[0] = (((float)...
ALGO
0.99138
4.712466
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-05-24T15:48:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cf2dcb48c4...
fbd19180-9619-43c7-8d3b-1d2bdf2c7bc7
afghangoat/cpp_projects2
xcercise/gyak_12.cpp
// Online C++ compiler to run C++ program online #include <iostream> //begin, end template<typename T> class Node{ private: T data; public: Node* next; Node(T d): data(d){ next=nullptr; } void print() const{ std::cout << data; ...
TOOL
0.963946
4.627753
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2025-06-30T07:27: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": "93f1fa96d7a...
b60e3026-01b7-485b-b4e2-acae6b789e4a
twlostow/kicad-dev
include/geometry/seg.h
/* * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 CERN * @author <NAME> <<EMAIL>> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; ...
TOOL
0.966259
6.481834
{ "github_metadata": { "branch": "gal-preview", "commit_count": 5741, "repo_created_at": "2014-02-18T22:41:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 3, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "4...
10265991-dce9-4985-a189-76b005ad78e6
ishandutta2007/codeforces-s
satashun/normal/248/E.cpp
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <...
ALGO
0.999507
3.693877
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35f9ab923e2f...
b0fabad4-39a4-4804-b691-0798dd2ddfa9
dheenim/Algorithm
Programmers/programmers_단체사진 찍기.cpp
#include <string> #include <vector> using namespace std; // 전역 변수를 정의할 경우 함수 내에 초기화 코드를 꼭 작성해주세요. int answer; int N; vector<string> Data; char elements[8] = {'A', 'C', 'F', 'J', 'M', 'N', 'R', 'T'}; bool chk[8]; char line[8]; void dfs(int haveNum){ if(haveNum == 8){ for(int i=0; i<N; i++){ ch...
ALGO
0.999461
4.165226
{ "github_metadata": { "branch": "main", "commit_count": 447, "repo_created_at": "2021-03-17T12: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": "760f16f0dc...
6fed2730-8cd3-4781-a975-f7e0faf8aa54
SemaMolchanov/cpp-basics
informatics/informatics datatype/structures/a.cpp
#include <iostream> #include <cmath> using namespace std; struct point{ double x, y; point(){} point(double x0, double y0){ this->x = x0; this->y = y0; } double distance(point o){ double x1 = this->x; double y1 = this->y; double x2 = o.x; double y2 =...
ALGO
0.999832
4.048746
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-03-16T12:34: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": "0b6f06b48878...
49949648-ba83-4825-86f0-89cbc97f6620
Malleswaribai/INTERVIEWBIT
BinarySearch/implementPowerFunction.cpp
/* Problem Description Implement pow(x, n) % d. In other words, given x, n and d, Find (xn % d) Note that remainders on division cannot be negative. In other words, make sure the answer you return is non-negative integer. Problem Constraints -109 <= x <= 109 0 <= n <= 109 1 <= d <= 109 Example Input Input 1: x...
ALGO
0.999994
5.778714
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-09-15T07:22: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": "f2fddc71714...
1cd7fcca-171d-47ab-b752-9c87d454bb6c
dyna-bytes/ProblemSolving
백준/Gold/12878. Blocks/Blocks.cc
#include <bits/stdc++.h> using namespace std; #define debug(x) std::cout << "[Debug] " << #x << " is " << x << '\n' #define debugVec(v) do { \ std::cout << "[Debug] ["; \ for(int i = 0; i < ((v.size())-1); i++) std::cout << v[i] << "|"; \ std::cout << v[((v.size())-1)] << "]\n"; \ } while(0) #define debugV...
ALGO
0.999977
3.844836
{ "github_metadata": { "branch": "main", "commit_count": 516, "repo_created_at": "2022-05-16T17:29:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b43169c7d...
a94a5e07-5a9c-4724-9206-d9303a262d9f
richoux/LearningErrorFunctions
learn_ga/include/es/eoEsStandardXover.h
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eoEsLocalXover.h : ES global crossover // (c) <NAME> 2001 This library is free software; you can redistribute it and/or modify it under th...
ALGO
0.989372
6.003029
{ "github_metadata": { "branch": "master", "commit_count": 433, "repo_created_at": "2019-06-05T05:57:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccf9f49d...
03b79be7-a4b7-4074-91c6-318e557ef6aa
mitupatil18/GeeksForGeeks-Solutions
Medium/Optimal Strategy For A Game/optimal-strategy-for-a-game.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //Function to find the maximum possible amount of money we can win. class Solution{ public: long long solve(int i, int n, int arr[], vector<vector<long long>>& dp) { if(i > n) return 0; if(dp...
ALGO
0.999795
5.360593
{ "github_metadata": { "branch": "main", "commit_count": 1172, "repo_created_at": "2023-07-01T07:04: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": "7fffdf947...
548c36a3-c3d4-4aee-8dcd-d8b0e762618c
SafwanIbrahim/All-Code
Phase 01 P2/Class 6/Problem of class 6/F.String_Game.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 2e5+7; string s,p; int arr[N]; bool ok(int l) { string temp = ""; vector<bool>ase(s.size(),false); for (int i = l; i < s.size(); i++) { ase[arr[i]] = true; } for (int i = 0; i < s.size();...
ALGO
0.999959
4.775215
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-05-10T13:27:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e66cadec235...
1b6c9959-108c-443c-b002-882f3d08195a
victorsenam/caderno
code/geometry/3d.cpp
const double pi = acos(-1); // typedef double cood; cood eps = 1e-6; // risky: XXX, untested: TODO struct pnt { // TODO it's not tested at all :) cood x, y, z; pnt () : x(0), y(0), z(0) {} pnt (cood a, cood b, cood c) : x(a), y(b), z(c) {} inline pnt operator - (pnt o) { return pnt(x - o.x, y - o.y, z - o.z); } inl...
ALGO
0.989463
3.784901
{ "github_metadata": { "branch": "master", "commit_count": 248, "repo_created_at": "2017-01-19T19:36:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 3, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "bcbcbb1...
993bc925-774f-4ff3-bd42-d0e2b55ef943
hideohara/AL4_LE2D_SUB
math/org/MathUtilityForText.cpp
#include "MathUtilityForText.h" #include <cassert> #include <cmath> float Matrix4Determinant(const Matrix4x4& m) { float det = +m.m[0][0] * m.m[1][1] * m.m[2][2] * m.m[3][3] + m.m[0][0] * m.m[1][2] * m.m[2][3] * m.m[3][1] + m.m[0][0] * m.m[1][3] * m.m[2][1] * m.m[3][2] - m.m[0...
TOOL
0.993352
4.169633
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2023-09-30T06:37:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "049bc8e45...
1dc6d289-5463-4d6d-830b-e27481b397b8
cliqz-oss/keyvi
keyvi/3rdparty/tpie/doc/olddoc/src/scan_square.cpp
// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup"; -*- // vi:set ts=4 sts=4 sw=4 noet : // Copyright 2008, The TPIE development team // // This file is part of TPIE. // // TPIE is free software: you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public ...
ALGO
0.933805
4.76625
{ "github_metadata": { "branch": "master", "commit_count": 826, "repo_created_at": "2015-07-14T21:25:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 177, "forks": 37, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id": "f64352...
1c56c24f-21fd-4f61-9451-667515c3c772
lucaski2/Competitive-Programming
CodeForces/Black_and_White_Stripe/main.cpp
#include <bits/stdc++.h> using ll = long long; using namespace std; const ll mod = 1000000000 + 7; const char en = '\n'; template<typename T> optional<T> less_or_equal(const set<T>& s, const T& value) { if (s.empty()) { return nullopt; } auto it = s.upper_bound(value); if (it == s.begin()) { return nullopt; }return ...
ALGO
0.999808
4.170953
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-09-26T02:30: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": "32581611028...
427c83f8-013e-4b26-b71b-762c0dd8013b
mrcombajn/SPOJ-solutions
NWW.cpp
#include <iostream> using namespace std; unsigned long long int nwd(unsigned long long int a, unsigned long long int b) { unsigned long long int pom; while (b != 0) { pom = a % b; a = b; b = pom; } return a; } int main() { unsigned long long int n, a; cin >> n; w...
ALGO
0.999978
3.505952
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2020-12-15T21:14:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eddf11689a86...
febc929b-f690-43bb-bead-bc89bef46cc1
ann234/PJH_BaekJoon
Deque/main_5430.cpp
#include <iostream> #include <vector> #include <deque> #include <string> #include <algorithm> using namespace std; int main() { int T; cin >> T; vector<vector<int>> answers; for (int testcase = 0; testcase < T; testcase++) { string P; cin >> P; int N; cin >> N; string arr_str; cin >> arr_str; str...
ALGO
0.999438
4.577762
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-01-18T08:39: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": "f4af54850b...
1f389ae5-99f1-4608-90ed-7f84ec2b6d42
abdulrahman9901/LeetCode-solutions
Manually added/serialize-and-deserialize-binary-tree/Wrong Answer/7-4-2024, 5_06_17 AM/Solution.cpp
// https://leetcode.com/problems/serialize-and-deserialize-binary-tree /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a si...
ALGO
0.999731
6.59019
{ "github_metadata": { "branch": "master", "commit_count": 321, "repo_created_at": "2024-07-06T06:07: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": "3d25eb41...
8d01dc29-04c1-469e-a6bb-3e51af29cc3c
RomanEmreis/leetcode
strings/longest_palindrome.cpp
/* Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, "Aa" is not considered a palindrome. Example: Input: s = "abccccdd" Output: 7 Explanation: One longest palin...
ALGO
0.999837
5.818875
{ "github_metadata": { "branch": "main", "commit_count": 835, "repo_created_at": "2024-04-20T09:22: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": "8d06389c82...
e7624cd8-a9e4-4f01-85ea-d75a344f896a
mapbox/mapbox-gl-native
src/mbgl/util/math.hpp
#pragma once #include <cmath> #include <array> #include <limits> #include <mbgl/util/geometry.hpp> namespace mbgl { namespace util { // TODO: split this file up into individual headers, following mbgl/math/*.hpp. // Find the angle of the two vectors, solving the formula for the cross product // a x b = |a||b|sin(θ...
TOOL
0.938119
7.664063
{ "github_metadata": { "branch": "master", "commit_count": 15978, "repo_created_at": "2014-01-27T17:14:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4413, "forks": 1327, "issues": 295, "pull_requests": 17 }, "file_meta": { "content_id":...