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
29207582-9c08-45dd-99bc-9b4f2cbed62e
khushi-arya/binarysearch
binary.cpp
#include<iostream> using namespace std; int binarySearch(int array[], int x, int low, int high) { // Repeat until the pointers low and high meet each other while (low <= high) { int mid = (low + high) / 2; if (array[mid] == x) cout<<"u r entered key is found at index: \n"<<mid; if (array[mid] ...
ALGO
0.999727
4.419413
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-01-17T07:09: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": "7001fb3c8622...
87cc6b90-6ba0-42aa-b08d-4d4d9c88f75a
pawan8979/Cpp-Learnings
college/del2.cpp
#include <iostream> using namespace std; int front = -1, back = -1, n = 10, d, ch; void enqueue(int queue[]) { if (back == n - 1) cout << "Overflow" << endl; else { cout << "Enter the element to push" << endl; cin >> d; queue[++back] = d; if (front == -1) ...
ALGO
0.995
3.989297
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-03-31T18:30:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f300e05310f...
81a694db-3c44-4982-952c-e599c928464b
saumyayadav25/DSA-Supreme-3.0
20 Graphs/Graphs Class - 6/01-scc-kosa-raju-algorithm.cpp
#include<iostream> #include<list> #include<unordered_map> #include<queue> #include<vector> #include<stack> using namespace std; // TC: O(V+e)-> linear TC class Graph{ public: unordered_map<int, list<int>> adj; void addEdge(int u, int v, bool direction){ // direction 1-> directed edge ...
ALGO
0.999877
5.974311
{ "github_metadata": { "branch": "main", "commit_count": 382, "repo_created_at": "2024-04-26T16:43:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 78, "forks": 25, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b67ad703...
cbfc4f0e-e61e-41a1-b049-0e6a89a36976
hotman78/cpplib
graph_tree/top_tree.hpp
/** * @brief TopTree(WIP) */ template<typename T,typename E> class top_tree{ struct node; using np=node*; struct cluster{ bool is_compress,is_edge,guarded; int l,r; T key=et; np ch[3]={nullptr,nullptr,nullptr}; np p=nullptr; cluster(){} cluster(int l,int r,bool is_compress,bool is_edge):l(l),r(r),is...
ALGO
0.999156
4.935844
{ "github_metadata": { "branch": "master", "commit_count": 378, "repo_created_at": "2020-09-10T07:30:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4996e1ca...
26b32b1b-b78a-4e98-87eb-35beb72e6dc0
priyanshusaini1102/DSA
Graph/adjacencyList.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; //DFS /* // void DFS(unordered_map<int,vector<int>> adj, vector<int> &ans, vector<int> &vis, int i){ // ans.push_back(i); // vis[i] = 1; // for(int c: adj[i]){ // if(vis[c]!=1){ // DFS(adj,ans,vis,c); // } // ...
ALGO
0.999888
5.106509
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2022-04-06T19:01: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": "636305b2b...
f0456c7f-2410-4a5f-b05c-557bfd723a4d
KirtiPahwa/Striver-SDE-Sheet
4 Arrays-IV/4SumProblem.cpp
class Solution { public: vector<vector<int>> fourSum(vector<int> &arr, int target) { sort(arr.begin(), arr.end()); vector<vector<int>> s; int n = arr.size(); for (int i = 0; i < arr.size(); i++) { for (int j = i + 1; j < arr.size(); j++) { ...
ALGO
0.999977
5.825561
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2022-09-11T15:53: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": "7ca064c6b5...
1e02d45e-7eb6-4723-8c80-f80a0be7aa27
fzi-forschungszentrum-informatik/Lanelet2
lanelet2_validation/src/Cli.cpp
#include "lanelet2_validation/Cli.h" #include <boost/program_options.hpp> #include <iostream> namespace po = boost::program_options; namespace lanelet { namespace validation { CommandLineConfig parseCommandLine(int argc, const char* argv[]) { CommandLineConfig cfg; auto& config = cfg.validationConfig; po::opt...
TOOL
0.948485
6.495445
{ "github_metadata": { "branch": "master", "commit_count": 591, "repo_created_at": "2018-08-24T13:52:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 857, "forks": 338, "issues": 9, "pull_requests": 6 }, "file_meta": { "content_id": "d5564...
560bb6d8-b9ee-48f5-b9ce-9d5e39886acd
Anderwer/Algorithm
刷题/Luogu/P_4568_JLOI_2011_飞行路线.cpp
#include <bits/stdc++.h> using i64 = long long; using namespace std; struct DIJ { using PII = array<i64, 3>; vector<vector<i64>> dis; vector<vector<int>> vis; vector<vector<array<i64, 2>>> G; int n; DIJ() {} DIJ(int n_): n(n_) {G.resize(n + 1);} void add(int u, int v, int w) { ...
ALGO
0.999914
4.850437
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2025-04-02T01:50: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": "85d620a22...
76bbb832-b799-4159-aab3-1620d265e830
ishandutta2007/codeforces-s
spy20051623/normal/1567/F.cpp
#include <bits/stdc++.h> using namespace std; const int dir[4][2] = {-1, 0, 0, 1, 1, 0, 0, -1}; char s[505][505]; int c[505][505]; int r[505][505]; void op(int x, int y, int k) { r[x][y] = k; for (auto i : dir) { int xx = x + i[0], yy = y + i[1]; if (s[xx][yy] != 'X') continue; if (c[xx][yy] == 2) { for ...
ALGO
0.999912
3.924495
{ "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": "ab746b381e23...
4aa99fee-c254-451f-beac-08177c8da200
umng/Learn-to-Program
c_cpp/afterSummer/Questions/Tree/printNodesAtKDistanceFromNode.cpp
#include <iostream> #include <vector> using namespace std; typedef struct node { int info; node *left; node *right; }tnode; tnode *createNode(int info, tnode* left = NULL, tnode* right = NULL) { tnode* node = new tnode(); node -> info = info; node -> left = NULL; node -> right = NULL; return node; } int KDo...
ALGO
0.999916
4.103835
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2017-02-15T09:32:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90431fd6c...
a4e535c2-188e-4caf-9195-8c68a88870d8
DerekRoesch/Mercury
src/control/include/control/drive.hpp
#ifndef DRIVE_HPP #define DRIVE_HPP #include <ros/ros.h> #include <armadillo> #include <sensor_msgs/Joy.h> #include <hw_interface_plugin_dynamixel/groupServoUpdate.h> #include <hw_interface_plugin_dynamixel/servoStateResponse.h> #include <msgs_and_srvs/DriveVector.h> #include <msgs_and_srvs/ServoCommands.h> #include <...
TOOL
0.926819
6.170212
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-04-07T18:46: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": "d0510c5599...
4de37684-c555-44cd-a6b8-e342890bdb52
Ocaedaltar/Ready_Set_Boole_42
ex05/srcs/main.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
TOOL
0.995989
5.174428
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2022-02-25T13:32: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": "d93e0190c...
51adc0f1-b5a8-448b-a14e-3c8d9fa39fa4
voidwarlock/Clustering_Visualize
clustering/Agglomerative.h
#ifndef AGGLOMERATIVE_H #define AGGLOMERATIVE_H #include <iostream> #include <vector> #include <Eigen/Dense> // 用于矩阵运算 #include <Eigen/StdVector> #include <algorithm> // 提供排序等功能 #include <random> // 用于随机数生成 #include <queue> // 使用优先队列实现最小堆 /** * ClusterNode:表示聚类树中的一个节...
ALGO
0.999986
5.919405
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-06-06T13:02:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "657141c7a9b...
e77f82bf-9c45-487f-8193-d3450be75b4c
KostasKostil/Chess-Fog-of-War
Main project/mystockfish.cpp
#include "mystockfish.h" using namespace std; namespace Stockfish { double EvaluatePiece(Type t, int x, int y) { // x == 0 => white side if (t == Type::Pawn) return 1+0.01*(x-1); if (t == Type::Knight) return 3-0.1*sqrt(pow(abs(x-3.5), 2) + pow(abs(y-3.5), 2)); if (t == Type::Bishop) return 3-0.05*sqr...
ALGO
0.997958
5.574455
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-05-18T06:39:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3bb2886e10e...
89c9ce81-3ae5-4424-9445-f5633b2bf33f
amitprat/cppcode
CodeProject/gkg/MinPlatforms.h
#pragma once #include "../Header.h" class MinPlatforms { public: static void test() { { vector<pair<int, int>> arr = { {900,910}, {940,1200}, {950,1120}, {1100,1130}, {1500,1900}, {1800,2000} }; int count = minPlatforms(arr); cout << "Min platforms = " << count << endl; ...
ALGO
0.984927
5.171441
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-07-12T03:02: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": "cbb72ed7b...
b1d5124a-a03d-4b08-b9db-35c44bcde508
luongphambao/cattuong
sasukecodewar34/bai9/bai9/bai9.cpp
// bai9.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include<vector> #include<functional> #include<algorithm> using namespace std; bool check(std::vector<int> a) { int n = a.size(); for (int i = 0; i < n; i++) if (a[i] != 1) return false; retur...
ALGO
0.999819
4.959961
{ "github_metadata": { "branch": "master", "commit_count": 467, "repo_created_at": "2020-02-15T11:59: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": "7dd3b427...
ae8e1d3a-8fd8-4818-bd4f-ec75d37c4e32
khomyakov42/Data-structures-training-2
Complex/Complex/Complex.h
#include<iostream> #include<math.h> class Complex{ private: double real, image; public: Complex(){ real = 0; image = 0; }; Complex(double r){ real = r; image = 0; }; Complex(double r, double i){ real = r; image = i; }; Complex(const Complex &v){ real = v.real; image = v.im...
TOOL
0.932543
4.607939
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2012-02-02T08:53:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b390d65562...
21c03bf9-79fe-46cc-8594-73ea5dff1e16
sstjepa/C-plus
Lab2/stu/stu.cpp
#include "Student.h" #include <iostream> #include <fstream> using namespace std; void sortProsecnaOcena(int n, Student* studenti) { for (int i = 0; i < n-1; i++) { for (int j = 0; j < n - i-1; j++) { if (studenti[j].prosecnaOcena() < studenti[j + 1].prosecnaOcena()) { Student temp; temp= studenti[j]; ...
ALGO
0.998145
4.799076
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-24T22:30: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": "9e728b6ab3ad...
2df36789-79f5-4c2e-97a4-5826db98a8d9
nikolaev94/parallel-computing-samples
parallel-computing-samples/mpi-cannon-algorithm/mpi-cannon-algorithm.cpp
#include <fstream> #include <iostream> #include <mpi.h> int main(int argc, char* argv[]) { const int dim = 6; if (argc < 3) { std::cout << "Missing matrices input files" << std::endl; exit(1); } const char* inputMatrA = argv[1]; const char* inputMatrB = argv[2]; double matrA[dim][dim] = { 0.0 }; double ...
ALGO
0.999414
5.1078
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-03-10T17:11: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": "1cbe6f1b2...
1df9980f-9966-4f9d-82d1-d2723c6c78ff
tickscn/algo
sort/sort.cpp
#include "sort.h" #include <cstring> void InsertSort(int* ar, int n) { int key; for (int i = 1; i < n; i++) { key = ar[i]; int j; for (j = i - 1; j >= 0; j--) { if (key < ar[j]) ar[j + 1] = ar[j]; else break; } ar[j + 1] = key; } } void Merge(int* ar, int p, int q, int r) { int n1 = q -...
ALGO
0.999744
3.990836
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2019-03-02T09:26: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": "cc070dd76...
716faedb-0d1f-4ba5-b6ce-ccfeb136a20a
ryseto/LF_DEM
LF_DEM/Contact.cpp
// // // Created by <NAME> and <NAME> on 12/10/12. // Copyright (c) 2012 <NAME> and <NAME>. All rights reserved. // #include "Contact.h" #include "Interaction.h" #include "System.h" void Contact::init(System* sys_, Interaction* interaction_) { sys = sys_; interaction = interaction_; dashpot.init(sys_, interaction...
ALGO
0.993092
5.6723
{ "github_metadata": { "branch": "master", "commit_count": 2253, "repo_created_at": "2020-08-31T09:32:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d700ac...
76396f49-b193-44ac-88dd-3433689a3e7a
Rkda8071/PS
JUNGOL/1129/main.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int n; ll dap; struct A{ ll x1,y1,x2,y2; }a[10100]; bool isMeet(A x, A y){ ll r1 = (x.y2 - x.y1) * (y.x1-x.x1) - (y.y1-x.y1) * (x.x2-x.x1); ll r2 = (x.y2 - x.y1) * (y.x2-x.x1) - (y.y2-x.y1) * (x.x2-x.x1); //printf...
ALGO
0.999335
4.100314
{ "github_metadata": { "branch": "master", "commit_count": 126, "repo_created_at": "2020-01-30T13: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": "a63b70d0...
ba98874b-6844-4eba-a320-91a1e52a90ef
JMetalian/Pathtracer-with-Ray-Triangle-Intersection
src/cgrpt1.cpp
#define MODEL "./meshes/tetraeder.off" //Change the model's name for different meshes #include <stdlib.h> #include <stdio.h> // Make: g++ -O3 -fopenmp cgrpt1.cpp -o cgrpt for compilation #include <omp.h> // Usage: ./cgrpt <samplesPerPixel> <y-resolution>, e.g.: ./cgrpt 500 800 (for Motion Blur, pass "-wit...
ALGO
0.998354
4.324347
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-11-28T13:33:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "627d33f44d2...
be1e040d-6c0c-4ffb-a839-87e87db6bdf8
JackLagas/SylverMath
include/MatrixNew.hpp
#pragma once #include "Types.hpp" #include "Vector.hpp" #include <format> namespace Sylver::Math{ template<std::size_t L, std::size_t W, typename T> struct Matrix{ private: Vector<W, T> m_Values[L]; public: Matrix(); Matrix(const Matrix<L, W, T>& mat); ...
TOOL
0.91202
7.010254
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-07-21T02:56:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "748453dd57e8...
52520ee6-a18a-4725-a25b-6a7dbf8acf2f
jordicollcaballero/WMaxCDCL_Paper
WMaxCDCL-flags/core/Solver.cc
/***************************************************************************************[Solver.cc] MiniSat -- Copyright (c) 2003-2006, <NAME>, <NAME> Copyright (c) 2007-2010, <NAME> Chanseok Oh's MiniSat Patch Series -- Copyright (c) 2015, Chanseok Oh Maple_LCM, Based on MapleCOMSPS_DRUP --Copyright (c) 2017, <NA...
ALGO
0.999805
3.714789
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-10-09T13:38: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": "ebf44d04e865...
16dd164b-2f45-470b-b009-d20712a4e0b4
vncharles/CTDL-GT
THI_KT_TH/Cau2.cpp
#include<iostream> #include <string.h> using namespace std; struct LoaiHoa{ char maHoa[10]; char tenHoa[20]; double giaBan; int soLuong; }; struct Node { LoaiHoa data; Node *link; }; struct List { Node* first; Node* last; }; void initList(List &l){ l.first = l.last = NULL; } Node* getNode(Loai...
TOOL
0.99905
3.763112
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-10-13T14:19:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a049ab08d1...
628cc197-b93c-4056-a7df-7bae11cd8185
Adnatull/Competitive-Programming
UVA Online Judge/CPP/11060 Beverages/11060 Beverages.cpp
#include <bits/stdc++.h> //macros #define sc scanf #define pr printf #define mp make_pair #define pb push_back #define sz size #define szf sizeof //typedefs/enums typedef long long LL; typedef unsigned long long ULL; typedef long L; typedef unsigned long UL; using namespace std; int main() { //freopen ("in.txt...
ALGO
0.999939
3.577116
{ "github_metadata": { "branch": "master", "commit_count": 151, "repo_created_at": "2016-05-08T15:04: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": "a63bd7dc...
b48243ef-e6c1-47f9-aa21-2fa6bd19d1b9
ethantran03/Project1-SysNet1
myshell.cpp
#include <iostream> #include <unistd.h> // for fork, execvp #include <sys/wait.h> // for wait, waitpid #include <fcntl.h> // for open #include <cstring> // for strtok, strcmp #include "param.hpp" // Param class and its methods #include "parse.hpp" // parseInput() function #define MAX_INPUT_SIZE 1024 /...
TOOL
0.925472
6.479236
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-09-12T04:08:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d3e4c09b1c...
6ea71843-8d6a-474b-bc47-d45f876abf3f
nxtcoder17/Competitive_Programming
Competitions/CodeForces/Hello_2019/A/sol.cxx
#include <bits/stdc++.h> using namespace std; #define print_container(ct,sep) cout<<*ct.begin();for(auto it=ct.begin()+1; it != ct.end(); it++) cout << sep << *it; cout << endl; #define MOD (pow(10, 9) + 7) #define endl '\n' #define decimal_places(x, d) int(round(x * pow(10, d))) / double(pow(10, d)) int main() { ...
ALGO
0.99996
4.022987
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-01-05T06:47:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45ddf042b...
e2806581-53ae-4fec-8628-2601741aaa0a
keywet06/code
Luogu/LuoguT196496.cpp
#include <bits/stdc++.h> auto gcd = std::__gcd<int>; int n, x, y, max, idx; int main() { std::ios::sync_with_stdio(0); std::cin.tie(0), std::cout.tie(0); std::cin >> n; for (int i = 1; i <= n; ++i) { if (gcd(i, n) > 1) continue; x = i, y = 1; while (x > 1) x = x * i % n, ++y; ...
ALGO
0.999947
4.164891
{ "github_metadata": { "branch": "master", "commit_count": 702, "repo_created_at": "2019-04-21T10:13:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aeec98ce...
38f2403f-d6cf-4c85-9eee-cbc5aedce22e
waleed-iftikhar/Baby-stroller-using-PIC-16F877a-microcontroller
final_code.cp
#line 1 "E:/Waleed/live_person/Nawaf_Ozzy/Final_Year_Project/Final_Year_Project/Implementation/Final_Code/final_code.c" double ADC(unsigned char); void Apply_Brakes(void); void Lift_Brakes(void); void PORTB_INT_ISR(void); unsigned int DATA=0; double STEP_SIZE = 4.88; char Driver=0; char Baby=0; char Belt=0; char Br...
ALGO
0.996405
4.439104
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-08-20T14:31: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": "d8e09da009...
ac7c33ac-75fd-4407-9f86-31a4b8ae1940
azizulnayem/Data-Structure-Algorithm-Laboratory
011201262/Homeworks/badol.cpp
#include <iostream> #include <vector> #include <limits> #include <iomanip> using namespace std; void optimal_bst(int n, vector<double>& p, vector<double>& q) { vector<vector<double>> e(n + 2, vector<double>(n + 1, 0)); vector<vector<double>> w(n + 2, vector<double>(n + 1, 0)); vector<vector<int>> root(n +...
ALGO
0.999992
4.556379
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-10-09T06:32: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": "b9ca88158da...
6277418b-0d5f-4c1d-8242-5e969fdddc44
raunak51299/Contests
codechef/Starter-68/XOR_Product.cpp
// <NAME> #include <bits/stdc++.h> #define us unordered_set<int> #define vi vector<int> #define vvi vector<vi> #define vl vector<long> #define vvl vector<vl> #define vll vector<ll> #define vvll vector<vll> #define vb vector<bool> #define ll long long #define pb push_back #define mem1(a) memset(a, -1, sizeof(a)) #defin...
ALGO
0.999813
4.86547
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-02-28T11:35:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c2ef26153ec...
cd22c89f-8b62-45ea-aa03-11cfebc33c3e
KhoiBui16/28Tech_Code_Online
Data structure algorithm/Source Code DSA Contest/SapXepTimKiem/B08_SapXepNoiBot.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { int n ; cin >> n; int a[n]; for(int i = 0 ; i < n ; i++) cin >> a[i]; for(int i = 0 ; i < n - 1 ; i++) { for(int j = 0 ; j < n - i - 1 ; j++) { if(a[j] > a[j + 1]) swap(...
ALGO
0.999967
3.97737
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2024-01-13T13:33:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c42bee548...
ba2cd1ed-4520-4fd2-8890-ef7e6f0115b7
Asad-Bin/cf-ac-problems
codeforces/1365/B..cpp
//...<NAME>... // Code by <NAME> // 08 06 2020 #include <bits/stdc++.h> using namespace std; // typedefs... typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<int, pii> piii; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<ll, ll> pll; // constants... const...
ALGO
0.99997
3.602526
{ "github_metadata": { "branch": "master", "commit_count": 1445, "repo_created_at": "2024-06-24T14:45: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": "20486a5...
ec4f30fc-354f-494a-96cc-2cfe04f8c625
Keshav-Thakur8/Leetcode-Stuffs
minimum-path-sum/minimum-path-sum.cpp
class Solution { public: // //Top-Down // int solve_dp(vector<vector<int>>& grid, int i, int j, vector<vector<int>> &dp) { // int m = grid.size(); // int n = grid[0].size(); // //if i and j is out of bound // if(i >= m || j >= n) { // return INT_MAX; // ...
ALGO
0.99998
5.896097
{ "github_metadata": { "branch": "main", "commit_count": 863, "repo_created_at": "2021-06-26T14:31: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": "92fad7387b...
b600a981-2f11-47f6-b63a-b453865727c2
s0y0ung/Problem-Solving
BAEKJOON/1197_1.cpp
#include <bits/stdc++.h> using namespace std; int v, e; vector<pair<int, int>> adj[10005]; bool check[10005]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> v >> e; for(int i=0; i<e; i++){ int a, b, cost; cin >> a >> b >> cost; adj[a].push_back({cost, b}); adj[...
ALGO
0.99993
4.199164
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2022-07-26T03:43: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": "b3019dec...
f8f26f6a-8dbb-4d62-bf34-1501f38c5993
BulaBula3/test.Day15fang
test.15fang(3).cpp
#include <iostream> using namespace std; #include<string> //1、设计英雄结构体 struct Hero { string name; int age; string six; }; //冒泡排序 实现年龄升序排列 void bubbleSort(struct Hero heroArray[], int len) { for (int i = 0; i < len - 1; i++) { for (int j = 0; j < len - i - 1; j++) { // ...
ALGO
0.970808
3.719224
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-02-16T12:20: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": "b4197abd1521...
86273f1f-e363-49c6-bc1d-fa5d4024588b
WhereIsHeroFrom/Code_Templates
大数/高精分数 模板.cpp
#include <iostream> #include <cstring> #include <cstdio> #include <cstdlib> using namespace std; typedef int hugeint; typedef unsigned long long ULL; //应不大于,以防乘法时溢出 const int Base = 1000; const int Capacity = 100; struct xnum { int Len; int Data[Capacity]; xnum() : Len(0) {} xnum(const xnum& V) : Len...
ALGO
0.998733
3.132528
{ "github_metadata": { "branch": "master", "commit_count": 193, "repo_created_at": "2018-01-28T09:29:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 153, "forks": 42, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66c51...
6b1b12d4-83df-4e86-8c9c-f5b5b0c218e6
az7792/Competitive-Programming-Code
AtCoder/ABC328/B_11_11.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define all(x) (x).begin(), (x).end() #define eb emplace_back const ll MAX = 2e5 + 10; const ll MOD = 998244353; typedef pair<int, int> pii; typedef pair<ll, ll> pll; string A, B; bool ok(int a, int b) { A = to_string(a); B = t...
ALGO
0.999921
4.228536
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2024-03-09T13:46: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": "28ddddfb9...
69fe90db-9a4e-4d16-b800-79c591743cd9
QianMo/GPU-Gems-Book-Source-Code
GPU-Gems-2-CD-Content/Geometric_Complexity/Ch_06_Hardware_Occlusion_Queries_Made_Useful/demo2/HierarchyNode.cpp
#include "HierarchyNode.h" #include "glInterface.h" #include <math.h> #include <limits.h> #include <float.h> typedef vector<Geometry *> GeometryList; // criteria and values partly taken from Piringer's thesis // values used as termination criteria for the tree generation // the overall surface float HierarchyNode::s...
ALGO
0.947458
4.361497
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2018-04-21T15:43:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1080, "forks": 449, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "b93e...
e37968f8-362d-43c1-acb3-fa7532a508bf
robparrish/lightspeed
src/cpp/lr/thc.cpp
#include <lightspeed/lr.hpp> #include <lightspeed/resource_list.hpp> #include <lightspeed/tensor.hpp> #include <lightspeed/becke.hpp> #include <lightspeed/gridbox.hpp> #include <lightspeed/math.hpp> namespace lightspeed { std::shared_ptr<Tensor> THC::mo_thc_X( const std::shared_ptr<ResourceList>& resources, c...
ALGO
0.982472
6.125563
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-02-13T04:57:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 9, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "3514f86587...
785ac016-7229-412b-b165-d0881d3e0886
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/02/0210/personal_submission/cf1082d_tsreaper.cpp
#include <bits/stdc++.h> #define MAXN 500 using namespace std; typedef pair<int, int> pii; int n, A[MAXN + 5]; vector<pii> ans; void conn(int x, int y) { ans.push_back({x, y}); A[x]--; A[y]--; } int main() { scanf("%d", &n); vector<int> X, Y; for (int i = 1; i <= n; i++) { scanf("%d"...
ALGO
0.999961
3.550956
{ "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": "e679...
98857d04-32ec-4b77-b06a-e01e0660f19e
mehemmedv/DB_Imp_Seminar
include/ALGraph.h
// // Created by mahammad on 8/21/17. // #ifndef DB_IMP_SEMINAR_ALGRAPH_H #define DB_IMP_SEMINAR_ALGRAPH_H #include <list> #include <vector> #include <functional> // Adjacency list implementation of Graph class ALGraph{ class EdgeIter { class iterator { public: iterator(std::list<uin...
ALGO
0.965161
4.92672
{ "github_metadata": { "branch": "master", "commit_count": 103, "repo_created_at": "2017-08-22T18:13:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "c923cb8e...
de84f4aa-cbfc-483b-a702-052d97650315
daeyun/mesh-to-depth
cpp/lib/depth_tracer.h
// // Created by <NAME> on 12/21/20. // #pragma once #include "ray_mesh_intersection.h" #include "camera.h" namespace mesh_to_depth { class DepthTracer { public: // `ray_tracer` is managed externally. DepthTracer(const RayTracer *ray_tracer, const Camera *camera, size_t width, ...
ALGO
0.935618
6.96278
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-01-02T16:32:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 39, "forks": 4, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "51264746...
6ba7de5a-e9de-4f2a-a66e-81f32dbeb35f
Pram1535/OS-CSA0489
osx20worst-fit algorithm.cpp
#include <stdio.h> #define MAX_PARTITIONS 6 #define MAX_PROCESSES 5 // Function to allocate memory using worst-fit algorithm void worstFit(int partitions[MAX_PARTITIONS], int processes[MAX_PROCESSES], int allocation[MAX_PROCESSES]) { for (int i = 0; i < MAX_PROCESSES; ++i) { int worstFitIdx = -1; ...
ALGO
0.999446
5.854979
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2024-02-21T07:26: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": "cd73c898c48...
502a34c8-7a81-47da-83c3-2952b14d991a
lvjonok/ibc_programming
day_2/programming_assignment_3/task1.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <chrono> using namespace std; int get_path_cost(vector<int> vertices, vector<vector<int>> paths, int n){ int path_cost = 0; for (int i = 0; i < n; i++){ path_cost += paths[vertices[i]][vertices[(i + 1) % n]]; } r...
ALGO
0.999763
4.488264
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2020-08-10T10:02: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": "73b565c13...
11af9a44-fdce-4d4a-95d8-bbcf7410934b
awishkarghimire/Advanced-Algorithms
Bipartite-Matching.cpp
#include<iostream> #include<vector> #include<list> #include<queue> #include<algorithm> using namespace std; void displayGraph(vector<list<int>> graph, int capacity[][202], int n); int breadthFirst(vector<list<int>> graph, int capacity[][202], int n); int edmond_karp(vector<list<int>> graph, int capacity[][202], int n...
ALGO
0.999946
3.311518
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-07-20T07:39: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": "2c3c70ff9e...
a846f658-ed30-40b1-b148-de2d2269c831
Hasan525/My-Codeforces-submission
Contest/Codeforces Round #710 (Div. 3)/E - Restoring the Permutation.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define vi vector<ll> #define vpi vector<pair<ll,ll> > #define mpi map<ll,ll> #define si set<ll> #define pqi priority_queue<pair<ll, ll> > #define rep(i,a,n) for(ll i=a;i<n;i++) #define reP(i,a,n) for(ll i=a;i<=...
ALGO
0.999995
3.495881
{ "github_metadata": { "branch": "main", "commit_count": 88, "repo_created_at": "2022-01-21T08:54: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": "8e92e2e4dc8...
d006b675-fc71-4522-8b3d-2650e8dbad98
ravi2320/LeetCode
day_387_2818. Apply Operations to Maximize Score.cpp
/* 2818. Apply Operations to Maximize Score Solved Hard Topics Companies Hint You are given an array nums of n positive integers and an integer k. Initially, you start with a score of 1. You have to maximize your score by applying the following operation at most k times: Choose any non-empty subarray nums[l, ..., r] ...
ALGO
0.999995
7.028621
{ "github_metadata": { "branch": "main", "commit_count": 576, "repo_created_at": "2023-10-17T20:36: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": "c7c273a49e...
15c6544a-adcd-412e-b89b-f10d82cdef74
shinglyu/leetcode-solution
002_add_two_numbers.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2, int carry=0) { if (!l1 && !l2){ // TODO: simply this base case if...
ALGO
0.999897
6.045704
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2016-01-09T08:13: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": "6d23b3ca4...
9bebf2a5-7e56-4e58-af54-82cf0309d78c
wjkcow/cuda_conv_fft
cuda_conv.cpp
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <omp.h> // Include CUDA runtime and CUFFT #include <cuda_runtime.h> #include <cufft.h> #include "cuda_fft_lib.h" #include "cuda_conv.h" bool mGpu_conv(float * cpuImg, float * cpuFilter, float *ans, int x, int y, int ch, int batc...
ALGO
0.970063
4.837568
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2014-10-01T17:54: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": "61482a97fb...
37537ac4-06ef-40ae-9e32-142c88a7369d
j-sed/PIA-Projekt__2020-21
data.hpp
#pragma once #define kappa 1.4 #define tiha 10 #include <cmath> //trida data class data{ public: //definice vnitrnich promennych double h, hU; // vektor neznamych data F(); //metoda vracejici slozky toku pocitane z vnitrnich promenych tridy double u(); //metoda vracejici hodnotu rychlosti ...
ALGO
0.991979
3.273429
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-11-17T07:58:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a953d6cd776...
438a5495-b478-46c5-8e4f-fb53832fd5df
dadaguaijiangjungd/image-fusion
solution1/syn/systemc/blendOpt_Loop_1_proc.h
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2019.1 // Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved. // // =========================================================== #ifndef _blendOpt_Loop_1...
ALGO
0.908587
3.013644
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-03-04T15:54: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": "7884e19ed8...
f275eaf9-7063-482e-9bac-4080ed9184f9
subhamchawda01/SubhamTwoRoads
MIDTERM/basetrade/MToolsCode/fslogr.cpp
/** \file MToolsCode/fslr_so_nomeandata.cpp \author: (c) Copyright Two Roads Technological Solutions Pvt Ltd 2011 Address: Suite 217, Level 2, Prestige Omega, No 104, EPIP Zone, Whitefield, Bangalore - 560066, India +91 80 4060 0717 */ #include <ctime> #include "dvccode/CDef/math_utils.hpp" #inclu...
DATA
0.998111
5.584955
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-08-05T14:58:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfd434949...
91e375e1-cf2e-4bea-a954-d81bff5ba6f1
google/libkml
src/kml/convenience/http_client.h
// Copyright 2009, Google Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and ...
TOOL
0.968766
6.05489
{ "github_metadata": { "branch": "master", "commit_count": 743, "repo_created_at": "2013-11-07T17:56:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 97, "forks": 55, "issues": 14, "pull_requests": 3 }, "file_meta": { "content_id": "628b45...
cefb384a-145c-46c3-82e3-53b1be4c1f76
Altu-Bitu-2/Notice
03월 25일 - 백트래킹/과제/1205.cpp
#include <iostream> #include <vector> using namespace std; int findRanking(int n, int new_score, int p, vector<int> &ranking) { int idx = 1; int ans = 1; //새로운 점수를 어느 위치에 넣을지 탐색 while (idx <= n) { if (new_score > ranking[idx]) { break; } if (new_score < ranking[idx]...
ALGO
0.99999
5.043174
{ "github_metadata": { "branch": "main", "commit_count": 271, "repo_created_at": "2022-02-22T12:42:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 34, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f224878b02...
af42cd70-bbe4-4fc4-8915-5eca2f0ca2a8
morris821028/UVa
volume115/11516 - WiFi.cpp
#include <stdio.h> #include <algorithm> #include <math.h> using namespace std; int A[100005]; int n, m, i, l, r, mm; int greedy(int mm) { static int cnt; static int r; cnt = 1; r = A[0] + mm; for(i = 0; i < m; i++) { if(abs(r-A[i]) <= mm) {} else { cnt++; if(c...
ALGO
0.999928
3.245334
{ "github_metadata": { "branch": "master", "commit_count": 1197, "repo_created_at": "2013-06-14T12:34:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 571, "forks": 269, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "316...
d5fbd919-73a4-4ad7-a37a-4580fbb1e9ba
RaviPrasadWA/AHRS
STABILIZER/PID.cpp
#include "PID.h" float PID::get_p(float error) const { return (float)error * _kp; } float PID::get_i(float error, float dt) { if((_ki != 0) && (dt != 0)) { _integrator += ((float)error * _ki) * dt; if (_integrator < -_imax) { _integrator = -_imax; } else if (_integrator > _...
ALGO
0.976389
5.161222
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2020-11-01T05:16: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": "57323e04f4cc...
9b9d25c1-c70b-4649-b5f4-539a9c157650
erjiaqing/my_solutions
tc/SRM678_Div1/TheEmpireStrikesBack.cpp
#define maxn (100000 + 1) #define mod (1000000007) #define x first #define y second class TheEmpireStrikesBack { public: vector<pair<long long, long long> > pt; vector<pair<long long, long long> > p; bool check(int t, int m) { int nw = 0; for (int i = 0; i < m; i++) { int mxy = p[nw].y; int mxx = -1; wh...
ALGO
0.999976
4.057096
{ "github_metadata": { "branch": "master", "commit_count": 341, "repo_created_at": "2014-05-27T06:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "879e3814...
44fe7978-ee6e-4bb0-87d9-916e889f24d8
ammardab3an/ACM
problems/done/qoj/qoj - B. Red Black Tree.cpp
// B. Red Black Tree // https://qoj.ac/contest/1339/submissions // By AmmarDab3an #include <bits/stdc++.h> using namespace std; #define int int64_t #define ll int64_t // typedef unsigned int uint; // typedef long long int ll; // typedef unsigned long long ull; typedef pair<int, int> pii; typede...
ALGO
0.999942
4.577041
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2021-10-06T07:54:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14d804ea56a...
eb0cd9d7-e56d-4b55-bbde-5acde9be3712
transfix/trans-vr
src/SweetMesh/vertex.cpp
/*************************************************************************** * Copyright (C) 2010 by <NAME> * * <EMAIL> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU...
ALGO
0.998263
4.448644
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-05-02T20:41: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": "d70a1e4cb0...
db2c4b78-aa70-4e7b-b2dc-add9f3f2c702
Wavator/code_lib
7.18multi/8.8/1001.cpp
#pragma optimize("-O3") #include <bits/stdc++.h> using namespace std; #define pb push_back #define rep(i,a,n) for(int i=(a);i<(n);++i) #define per(i,a,n) for(int i=(n)-1;i>=(a);--i) #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define fi first #define se second #ifdef Wavator #define debug(fmt,...
ALGO
0.997051
3.543046
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2018-06-14T07:46:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75e8969fe...
f09fac1e-5438-467d-9378-8d3d95338c27
progCyrok/bmstu_computer_networks
CLionProjects/bmstu_cpp_works/letuchka_6.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> // Структура для хранения информации о студенте struct Student { std::string name; int age; int rating; }; // Функция для чтения данных из файла std::vector<Student> read_file(const std::string& filename) { std::ifstream file(f...
TOOL
0.999265
5.782731
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-02-19T19:47:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a6c3c361855...
9703c714-b142-494d-995a-6f21a16c8700
elufe/algorithm
hamiltonian.cpp
#include <iostream> #include <stdio.h> #include <cstdlib> using namespace std; void hamiltonian(int); int n, **w, *vindex; bool promising(int); int main() { cout << "n?"; cin >> n; w = new int*[n]; for (int i = 0; i < n; i++) w[i] = new int[n]; cout << "w?" << endl; for (int i = 0; i < n; i++) for (int j ...
ALGO
0.999597
3.761202
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2018-10-14T08:49:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfaab23db...
0f809487-9f90-4a53-8237-f5ca69b9750c
martinmarklund/TNM097_SnapIt
SnapIt/version7_corrRot/mean2.cpp
/* * Academic License - for use in teaching, academic research, and meeting * course requirements at degree granting institutions only. Not for * government, commercial, or other organizational use. * * mean2.cpp * * Code generation for function 'mean2' * */ /* Include files */ #include "rt_nonfinite.h" #inc...
ALGO
0.99975
5.634495
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-03-22T13:26: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": "e2f5a84dc4...
13439c85-870c-43cc-8edc-622d309dd708
bob881688/school_data
程式設計( 二 )/王國華/4. Rectangles_Sorting_using_Vector_Class/Rectangles_Sorting_using_Vector_Class.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <iomanip> using namespace std; class Rectangle{ public: Rectangle( int length, int width ){ this->length = length; this->width = width; area = computearea(); diagonal = compu...
ALGO
0.999656
4.896221
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-05-16T15:12: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": "7d84e151967...
0b758102-ef42-42ae-ae5b-2e228d12ae7d
StudyingFather/my-code
Codeforces/1606C.cpp
// Problem: <NAME> // Contest: Codeforces - Educational Codeforces Round 116 (Rated for Div. 2) // URL: https://codeforces.com/contest/1606/problem/C // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <iostream> using namespace std; int a[15]; long long pow10(int ...
ALGO
0.999433
4.20934
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2018-09-22T17:05:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66449ddfb...
b02f6b5e-269e-4991-8e96-6e5aa3e93dcf
soonyubi/algorithm
august/august/10176.cpp
/* * Time : * Subject : * * Coded by soonyubing */ #include <bits/stdc++.h> #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> // INT_MAX INT_MIN LLONG_MAX LLONG_MIN using namespace std; inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int cnt[26]; void sol...
ALGO
0.999963
4.409304
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2022-07-01T12:48: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": "2a60bb157...
5c7966dc-e429-496a-bb8d-719b1d681b46
Iordan-Iulian-Bogdan/Compressive-Sensing-Image-Encryption
ImgReconstruct_backend/image_decryption.cpp
#include "image_decryption.hpp" #include "image_encryption.hpp" decrypt_image::decrypt_image(const std::string input_path) { encrypted_img = cv::imread(input_path, cv::IMREAD_COLOR); encrypted_img = encrypted_img.reshape(0, encrypted_img.total()); cv::Mat retrievedMat(11, 1, CV_8UC3); for (int i = 0; ...
TOOL
0.96236
5.908155
{ "github_metadata": { "branch": "CPU_Limited_memory_BFGS", "commit_count": 104, "repo_created_at": "2024-03-05T21:42:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "conte...
91922f1b-5005-4020-aeab-0fc08351978f
mphilipp622/115
Lab8/Lab8/Lab8/AVLTree.h
#pragma once #include "AVLNode.h" #include <algorithm> using namespace std; template <typename T> class AVLTree { public: AVLTree(); ~AVLTree(); private: // Get total height of the tree int Height(AVLNode<T> *n) { if (n == NULL) return -1; return 1 + max(Height(n->left), Height(n->right));) } // Sets the...
ALGO
0.998908
5.336621
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2018-02-09T21:10: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": "da9f78c67...
dfaa067b-9149-4dcd-86f6-11cf28332592
emn2/Competitive-Programming-Algorithms
Problems/Codeforces/UFPE Starters Final Try-Outs 2021/B.cpp
#include "bits/stdc++.h" using namespace std; #define pb push_back int main(){ int n; cin >> n; vector<vector<int> > adj(20); for(int i = 0; i < n; i++){ int q; cin >> q; for(int j = 0; j < q; j++){ int a; cin >> a; a--; adj[i].pb(a); } ...
ALGO
0.990279
3.570873
{ "github_metadata": { "branch": "main", "commit_count": 515, "repo_created_at": "2020-10-02T19:34:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce0ce128ec...
84f2e039-31c3-4ccc-8f4f-58c8e1c5df18
chirag05-coder/Competitive_Coding
Three dices.cpp
Link for Ques: https://www.codechef.com/START6B/problems/THREDICE #include<bits/stdc++.h> #define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define lli long long int using namespace std; const int M=1e9+7; lli power(lli a,lli b) { if(b==0 ) return 1; if(b==1) ...
ALGO
0.999329
3.951413
{ "github_metadata": { "branch": "main", "commit_count": 575, "repo_created_at": "2021-03-27T07:19:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "07c63a52d0...
7bf709ff-3e2d-4688-b8c6-16727ee37e0e
seiropixeled/Github
assignment10.cpp
#include <iostream> #include <string> using namespace std; struct Book { string isbn; string title; string author; int year; }; // Function to search for a book using its ISBN void searchBook(const Book books[], int size, const string &isbn) { for (int i = 0; i < size; i++) { if (books[...
TOOL
0.996807
6.391978
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-02-29T12:18: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": "c0c2f7f9a7c...
27b8d6d0-cfc8-4959-894e-542a84291b96
Nikita21219/webserv
app/srcs/sources/DirectiveParser.cpp
#include "DirectiveParser.hpp" std::string const DirectiveParser::_key_words[KEY_WORDS_SIZE] = {"listen", "server_name", "root", "autoindex", "methods", \ "max_body_size", "directory", "index", "bin_path", "redirection", "alias", "location", "error_pages"}; /* ** ------------------------------- CONSTRUCTOR --------...
TOOL
0.920208
4.947793
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-11-22T11:23: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": "ca49d827a2f...
e1eb5d4b-f669-4944-ba0b-a9e5cb39eda9
RavenProject/Ravencoin
src/crypto/sha256.cpp
// Copyright (c) 2014 The Bitcoin Core developers // Copyright (c) 2017-2019 The Raven Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "crypto/sha256.h" #include "crypto/common.h" #include <assert.h> #i...
ALGO
0.992837
7.020641
{ "github_metadata": { "branch": "master", "commit_count": 16643, "repo_created_at": "2017-07-09T21:42:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1104, "forks": 696, "issues": 155, "pull_requests": 27 }, "file_meta": { "content_id": ...
d2228fde-2e44-42cf-b66d-015410615267
embiway/Junior_Training
C2/C_Substring_Game_in_the_Lesson.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; #define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define mp make_pair #define pb push_back #define ff first #define ss second #define vi vector<int> #define vll vector...
ALGO
0.999976
3.609303
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-08-20T13:53: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": "64ae0687d5...
d7519e67-3bb2-4d35-a325-a77134057a8c
NelsonGomesNeto/Competitive-Programming
Algorithms and Data Structures/Graph/floydWarshall.cpp
#include <bits/stdc++.h> using namespace std; const int maxVertices = 1e3, inf = 1e7; int n, m; void printMatrix(int mat[maxVertices][maxVertices]) { printf(" | "); for (int i = 0; i < n; i ++) printf("%3d%c", i, i < n - 1 ? ' ' : '\n'); printf(" | "); for (int i = 0; i < n; i ++) printf("---%c", i < n - 1 ...
ALGO
0.999993
4.424335
{ "github_metadata": { "branch": "master", "commit_count": 333, "repo_created_at": "2019-08-07T17:50:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "78140f1...
0f494b2a-daf4-4295-91be-457222023581
Yamadashoei/CG4
External/KamataEngine/include/math/MathUtility.h
#pragma once #include "Matrix4x4.h" #include "Vector2.h" #include "Vector3.h" #include "Vector4.h" namespace KamataEngine { namespace MathUtility { const float PI = 3.141592654f; // 単項演算子オーバーロード Vector2 operator+(const Vector2& v); Vector2 operator-(const Vector2& v); // 代入演算子オーバーロード Vector2& operator+=(Vector2& ...
TOOL
0.920336
6.085205
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2025-05-22T05:05:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "845d28ed6f...
badf76ec-0b1e-4d2b-885f-0285241fa731
akash4-sys/DSA
Codeforces/1100/1850E.cpp
#ifdef __INTELLISENSE__ #include "../../headers.h" #else #include <bits/stdc++.h> using namespace std; #endif #define ll long long #define vec vector<ll> #define vv vector<vec> #define vvv vector<vv> #define all(v) v.begin(), v.end() #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define...
ALGO
0.999723
4.772571
{ "github_metadata": { "branch": "main", "commit_count": 272, "repo_created_at": "2022-07-17T09:39:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10d3a707f8...
56d551a0-0396-457e-96a4-8176d5c1bdf1
shammun/phitron_cse_fundamentals
3_Basic Data Structures/Module 1/linear_complexity_O_n.cpp
#include <iostream> using namespace std; int main() { int n; // O(1) cin >> n; // O(1) // O(n) for(int i = 0; i < n; i++) { cout << i << " "; } // O(n) for(int i = 0; i < n-5; i++) { cout << i << " "; } // O(n) for(int i = 0; i < n/2; i++) { cout << i...
ALGO
0.999333
4.33833
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-11-18T11:52: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": "903ef0f1bac...
4b15b015-490d-4722-bcb0-44c17124db02
trilinos/Trilinos
packages/ml/src/Coarsen/ml_qr_fix.cpp
/* ******************************************************************** */ /* See the file COPYRIGHT for a complete copyright notice, contact */ /* person and disclaimer. */ /* ******************************************************************** */ #include "ml_include...
TOOL
0.938949
5.252009
{ "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":...
46ac3a12-9da4-40ad-872a-6c2b2e08bacc
ZEFFERSKIOICH/Cses-Tree-algorithms-
Tree_Algorithms/company_queries_2.c++
// coded by zeffy #pragma GCC optimize("O3","unroll-loops","omit-frame-pointer","inline") //Optimization flags #pragma GCC option("arch=native","tune=native","no-zeroupper") //Enable AVX #pragma GCC target("avx","popcnt") //Enable AVX #include <x86intrin.h> //SSE Extensions #include <bits/stdc++.h> using namespace st...
ALGO
0.999986
4.624209
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-03-20T15:28:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "474d833f6c2b...
2f6f05ee-7bb7-4202-9320-511d5c421ab1
sahillroy/cp
189.RotateArray.cpp
#include<iostream> #include<vector> using namespace std; vector<int> rotate(vector<int>arr,int k){ int n = arr.size(); vector<int> res(n); for(int i = 0;i<n;i++){ res[(i+k) % n] = arr[i]; // i+k ka mod isiliye liya if unka sum array ke size se bada hua toh wo wps ussi me rahe // like if key is 8 and a...
ALGO
0.999937
5.55939
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2025-05-21T16:43: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": "251f094ad...
356d5c3a-7dbc-46ef-9e00-0b6adc77c77d
ducnguyen-uconn/Export-Airfoil-Version-2.0-Source-Code
EAFv2.0/Matrix.cpp
#include "matrix.h" #include "vector_matrix.h" /////////////////// Constructors ////////////////////////////////////////// // Constructor that overrides compiler generated default constructor matrix::matrix() { // constructs an empty object with rows = columns = 0 rows = 0; columns = 0; xx = NULL; } ...
ALGO
0.994664
5.39618
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2020-10-08T07:45: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": "7fa191bccf7c...
7d089674-35ad-4666-9740-d163aaacee9c
kimwalisch/primesieve
include/primesieve/ctz.hpp
/// /// @file ctz.hpp /// @brief Count the number of trailing zeros. /// /// Copyright (C) 2024 <NAME>, <<EMAIL>> /// /// This file is distributed under the BSD License. See the COPYING /// file in the top level directory. /// #ifndef CTZ_HPP #define CTZ_HPP #include "macros.hpp" #include <stdint.h> // GCC/Clang ...
ALGO
0.905644
7.070137
{ "github_metadata": { "branch": "master", "commit_count": 4824, "repo_created_at": "2013-09-24T17:58:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1024, "forks": 125, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "8b...
3f6f1518-a74b-43b1-9ff6-c5fdd648fd01
singh-shivam789/Data-Structures-with-CPP-Java-Coding-Ninjas
Hashmaps/cpp/Longest Consecutive Sequence.cpp
/* 128. Longest Consecutive Sequence (Leetcode : Medium) Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example 1: Input: nums = [100,4,200,1,3,2] Output: 4 Explanation: The longest consecutive elements se...
ALGO
0.999912
5.885227
{ "github_metadata": { "branch": "main", "commit_count": 245, "repo_created_at": "2020-12-01T00:01:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4b9c8c78...
79ca6d4c-6b3b-4976-92e1-70f661d9b9ad
Dristy03/Samsung-Coding-Tests
11-cycleUndirectedGraph.cpp
/* 13 15 1 2 2 3 3 4 4 6 4 7 5 6 3 5 7 8 6 10 5 9 10 9 10 11 11 12 11 13 12 13 */ #include <iostream> #include <vector> #include <unordered_set> using namespace std; const int N = 100000; vector<int> graph[N]; vector<vector<int> > cycles; void dfs_cycle(int u, int p, int color[], int par[], int& cyclenumber) { ...
ALGO
0.99994
4.526091
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-01-12T11:55:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5c81e6c8eac...
080b2455-309f-4752-84c9-7bfe05440e4a
shitangdama/leetcode
algorithms/149.Max_Points_on_a_Line/Max_Points_on_a_Line.cpp
<<<<<<< HEAD #include <bits/stdc++.h> /** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0), y(0) {} * Point(int a, int b) : x(a), y(b) {} * }; */ class Solution { public: int maxPoints(vector<Point> &points) { // IMPORTANT: Please reset any member data ...
ALGO
0.999611
5.01659
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2015-04-07T06:47:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14eeeaa3b...
467b3b8f-f6fb-4bf5-ae77-dac9bbdb51a2
pineal/SC_AI_Flash
ualbertabot-master/SparCraft/source/Player_AttackDPS.cpp
#include "Player_AttackDPS.h" using namespace SparCraft; Player_AttackDPS::Player_AttackDPS (const IDType & playerID) { _playerID = playerID; } void Player_AttackDPS::getMoves(GameState & state, const MoveArray & moves, std::vector<UnitAction> & moveVec) { moveVec.clear(); for (IDType u(0); u<moves.numUnits()...
ALGO
0.919194
5.538373
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-06-24T00:25:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "43b3cebbe6...
bfa0b2c3-e8a9-44af-9b36-34a2fd9a7da2
FloraChang/Codility
Distinct.cpp
/* Write a function int solution(vector<int> &A); that, given a zero-indexed array A consisting of N integers, returns the number of distinct values in array A. Assume that: N is an integer within the range [0..100,000]; each element of array A is an integer within the range [−1,000,000..1,000,000]. For ex...
ALGO
0.999857
5.658274
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2016-07-15T18: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": "d9d8e43bb...
c13c401a-77a3-416d-b4f5-7d4d5c975778
rachit2905/Leetcode-solutions
Modify Linked List-1 - GFG/modify-linked-list1.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; struct Node* modifyTheList(struct Node *head); struct Node { int data; struct Node* next; Node(int x){ data = x; next = NULL; } }; void print(Node *head) { Node *temp=head; wh...
ALGO
0.999859
5.232774
{ "github_metadata": { "branch": "main", "commit_count": 2462, "repo_created_at": "2022-10-22T07:12: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": "33d02ddce...
cc88dc29-17c8-46c5-811e-16160c3540b5
sahmedASC/Nothing-of-note
Data Structures/hw8/Rope_student.cpp
/* Write your Rope implementation in this file. You do not have to keep any of the code that is already in this file. Functions that are required that you have not implemented have an assert 0 meaning they will always crash. This should help you make sure you implement everything. */ #include <cassert> #include "Rope...
ALGO
0.973024
4.767481
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-01-15T03:27:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d8adbcbd...
891acca6-ebd3-4ad1-8247-3023cfc1fdaf
yangjufo/LeetCode
C++/29. Divide Two Integers.cpp
class Solution { public: int divide(int dividend, int divisor) { if(dividend == INT32_MIN){ if(divisor == -1) return INT32_MAX; else if(divisor == 1) return dividend; else return ((divisor&1) == 1) ? divide(dividend+1,divisor) : divide(dividend>>1, divisor>>1); ...
ALGO
0.999921
5.824761
{ "github_metadata": { "branch": "master", "commit_count": 1058, "repo_created_at": "2018-03-25T13:07: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": "9ee8ef1...
443a5f42-365f-4694-847a-9cc524ab0761
Mids/LeetCode
23. Merge k Sorted Lists.h
// // Created by jin on 7/15/2021. // #ifndef LEETCODE_23_MERGE_K_SORTED_LISTS_H #define LEETCODE_23_MERGE_K_SORTED_LISTS_H #include <queue> using namespace std; struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode...
ALGO
0.999766
6.502341
{ "github_metadata": { "branch": "master", "commit_count": 142, "repo_created_at": "2021-01-04T07:18:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd5cc8c9...
9dff886f-fcf0-4a7d-8ee6-9c716ceeaf68
barkolorious/codeforces-solutions
2033C_sakurako_s_field_trip.cpp
// barkolorious - 27 October 2024 // in god, do we trust? #include <bits/stdc++.h> using namespace std; #define FIN(x) freopen(x ".in", "r", stdin) #define FOUT(x) freopen(x ".out", "w", stdout) #define int long long #define pb push_back #define fr first #define sc second #define __ << " " << const int N = 2e5 ...
ALGO
0.999571
4.236482
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-12-03T13:31:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a2f9e16b2b7...
3d8d5fe5-a069-4f20-84e3-3b8d3c9c143f
anandatul144/CG-18
core/matrix.cpp
#include <core/matrix.h> #include<core/assert.h> #include<math.h> #include<core/scalar.h> namespace rt { Matrix::Matrix(const Float4 & r1, const Float4 & r2, const Float4 & r3, const Float4 & r4) { this->r1 = r1; this->r2 = r2; this->r3 = r3; this->r4 = r4; } Float4 & ...
TOOL
0.948582
3.750191
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-11-10T18:30: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": "597ba9b971...
62a3eb52-ced6-4aba-bcf0-091251f3144c
RamseyKamar/Simulating-Binding-to-Surfaces
main.cpp
#include <iostream> //BALLS_AND_BOXESII #include <fstream> #include <math.h> #include <stdlib.h> #include <time.h> #include <random> #include <chrono> // This program defines a class which is used to simulate the probability distribution of finding fluorescently labeled DNA molecules // occupying multivalent protein bi...
TOOL
0.984219
3.69789
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2016-07-25T00:46: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": "8f38823520...
86852975-47a7-4b92-b255-a1beb2f883b9
shivenducs1136/C-Codes
CodeDrizzle/somanyplots.cpp
#include<bits/stdc++.h> using namespace std; void solution (int n, vector<int> plots, vector<int> costs_arr) { int cost = 0 ,j=0,k=1; int plot_area=0,i,a; for(i=0;i<n;i++){ plot_area = plot_area + plots[i]; } for(i = 0 ; i < n && j<n && k<n; i++ ){ cost = cost + plots[j++] + plots[k]; ...
ALGO
0.999979
3.387512
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-07-31T14:07: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": "0c0cf2f9967...
69d77fa3-0d31-4c78-b025-57cec38346d6
Jaehyeok-Soh/DataStructure
DataStructure/avlTree.cpp
#include "pch.h" #include "avlTree.h" bool avlTree::insertNodeAVL(avlTreeNodeData element) { bool ret = false; avlTreeNode* pParentNode = nullptr; avlTreeNode* pNewNode = nullptr; avlLinkedStack* pStack = new avlLinkedStack(); pParentNode = pRoot; while (pParentNode != nullptr) { pStack->pushAVLTreeNode(pP...
ALGO
0.984975
4.648004
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2025-04-21T05:42: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": "4602b0656...