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
75a22365-7827-48d2-a79d-b395ecf8b109
Hemant2056/self-driving-car
motor-control/main-prev/main-prev.ino
const int rearLeftWheel = 11; const int rearRightWheel = 10; const int frontLeftWheel = 5; const int frontRightWheel = 6; const int turnPwmHigh = 170; const int turnPwmLow = 90; //tune turnPwmLow according to your need so as to turn vehicle by certain angle : high , low or medium const int forwardPwm = 150; void tur...
TOOL
0.962424
4.430836
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2023-07-08T10:28: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": "b49ac7f4f49...
41debf48-c834-4c16-838e-b4da729bd3cd
Srilakshmisai2005/OS
day 3 - 1.cpp
#include <stdio.h> #define MAX_PROCESSES 10 #define MAX_RESOURCES 10 int available[MAX_RESOURCES]; int maximum[MAX_PROCESSES][MAX_RESOURCES]; int allocation[MAX_PROCESSES][MAX_RESOURCES]; int need[MAX_PROCESSES][MAX_RESOURCES]; int num_processes, num_resources; int request_resources(int pid, int request[]) { // ...
ALGO
0.999877
4.165194
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-25T05:25: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": "552272c086be...
56ad739f-3ac5-4c3c-92d6-598031c6f089
GEN05/mini-games
sudoku/main.cpp
#include <iostream> #include <vector> #include <ctime> std::vector<std::vector<int>> board; int x, y, col, value, tempX, tempY, randCol; bool check_row() { for (int i = 0; i < 9; i++) { if (board[x - 1][i] == value) { return false; } } return true; } bool check_line() { fo...
ALGO
0.982722
4.831923
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-05-02T14:02:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea9358cff0...
fff7e03f-3064-47cd-af4a-242cf4a5d07a
zw267/acm-icpc
codeforces/cf223B.cpp
//File Name: cf223B.cpp //Created Time: 2017年01月17日 星期二 20时59分50秒 #include <bits/stdc++.h> #define LL long long using namespace std; const int MAXN = 200000 + 2; char s[MAXN],t[MAXN]; int f[MAXN],g[MAXN]; int sum[MAXN][26]; bool solve(...
ALGO
0.999998
3.730084
{ "github_metadata": { "branch": "master", "commit_count": 188, "repo_created_at": "2017-06-27T22:28: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": "64777432...
63b3dd37-e06f-4c9a-a181-395bf0c1e35e
MiaoDX/pose_estimation
AlglibCluster/src/optimization.cpp
/************************************************************************* ALGLIB 3.12.0 (source code generated 2017-08-22) Copyright (c) <NAME> (ALGLIB project). >>> SOURCE LICENSE >>> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
ALGO
0.999661
6.530448
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2017-08-18T16:32:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c51dc8eed...
9ef69f0b-3437-4450-bdd3-2ad0f8e76070
odiraitis/TRECIASND
funkc.cpp
#include "header.h" //setters void mok::set_gal(double g) { gal_=g; } void mok::set_galm(double m) { galm_=m; } // double mediana (std::vector<int> temp_paz, int n) { std::string kuris; for (int a=0; a<n-1; a++) for (int i=a+1; i<n; i++) if (temp_paz[i]<temp_paz[a]) ...
TOOL
0.991468
3.632221
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-04-09T15:04: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": "025c083b3...
aaa84cfb-4100-46c7-b549-9ff3485314a7
yuta1024/aoj
Volume 24/2410.cpp
#include <iostream> #include <sstream> #include <cstdlib> #include <cmath> #include <map> #include <set> #include <queue> #include <string> #include <vector> #include <algorithm> #include <functional> #include <cstdio> #include <numeric> #include <bitset> #include <stack> #include <cstring> using namespace std; const ...
ALGO
0.999609
3.328527
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2012-08-08T18:53: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": "d87f17157d...
ec52c453-2375-4ba2-993b-2146e9f208ca
suvoooo/GALPROP_Local_Sources
source_SNR_event_vec.cc
//**.****|****.****|****.****|****.****|****.****|****.****|****.****|****.****| // * source_SNR_event_vec.cc * galprop package * 10/03/2003 //**"****!****"****!****"****!****"****!****"****!****"****!****"****!****"****| // vectorizable version of source_SNR_event // CC -c source_SNR_event_vec.C ...
ALGO
0.991298
4.358199
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-12-07T06:15:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6e78e998...
8d81ca1f-9b94-4cf7-9b82-510bef77bc8f
Ansh718/GFG
2024/February 24/22-02-24.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends /*You are required to complete this method*/ class Solution { public: int subsequenceCount(string S, string T) { int m = 0; m = T.length(); int n = 0; n = S.length(); if (m > n) ...
ALGO
0.999959
5.878484
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2024-01-02T07:47: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": "cc5b213940f...
7f319627-efd3-444b-985a-33ced6317311
jay99bansal/DSA_course
Dynamic_Programming/Matrix_DP/Chocolates_Pickup.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int solve(int n, int m, vector<vector<int>>& grid) { long long dp[n][m][m]; // Base Case for(int c1 = 0; c1<m; c1++) { for(int c2=0; c2<m; c2++) { ...
ALGO
0.999912
6.207
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2024-07-09T08:15:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 55, "forks": 24, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75e7cdbfa...
e6754715-d9d5-45de-b7d7-a1f69a45f37e
EmilianoCorvalan/Ejercicios-Cpp
3DadosPOO/3DadosPOO/Source.cpp
#include<iostream>; using namespace std; /*Plantear un programa que permita jugar a los dados. Las reglas de juego son: se tiran tres dados si los tres salen con el mismo valor mostrar un mensaje que "gano", sino "perdió". Lo primero que hacemos es identificar las clases: Podemos identificar la clase Dado y la clase ...
ALGO
0.998635
4.634761
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-03-03T19:06: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": "ed226a87fdc...
07bb19a7-3b89-4b56-93d4-35e9c7399693
JeffersonLab/chroma
lib/meas/hadron/wall_qprop_w.cc
/*! \file * \brief Construct a wall-sink propagator */ #include "chromabase.h" #include "util/ft/sftmom.h" #include "meas/hadron/wall_qprop_w.h" namespace Chroma { //! Construct a wall-sink propagator: /*! * \ingroup hadron * * This routine is specific to Wilson fermions! * * Each time slice will have one no...
ALGO
0.977362
5.429268
{ "github_metadata": { "branch": "master", "commit_count": 12973, "repo_created_at": "2013-08-13T18:20:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 65, "forks": 55, "issues": 1, "pull_requests": 12 }, "file_meta": { "content_id": "c718...
87289cd3-c22a-4ac7-a3a3-e7b9af1a5c7a
parthkris13/CC-Solutions
High_Buildings.cpp
#include <stdio.h> #include <bits/stdc++.h> using namespace std; #define int long long int #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int32_t main(){ IOS; int t; cin >> t; int z = t; while(t--){ int n,a,b,c; cin >> n >> a >> b >> c; if(a+b-c > n){ ...
ALGO
0.999696
3.304685
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2020-12-20T18:02: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": "c9464bd79242...
d11c6cdc-7f1d-4b97-97a9-5383b241bda9
LadybirdBrowser/ladybird
Libraries/LibGfx/Matrix.h
/* * Copyright (c) 2020, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include <AK/Assertions.h> #include <AK/StdLibExtras.h> #include <AK/Types.h> #include <initializer_list> namespace Gfx { template<size_t N, typename T> class Matrix { template<size_t U, typename V>...
TOOL
0.923855
7.190272
{ "github_metadata": { "branch": "master", "commit_count": 70489, "repo_created_at": "2024-05-30T09:18:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 45588, "forks": 1949, "issues": 457, "pull_requests": 50 }, "file_meta": { "content_id"...
eca68402-224f-44bf-962c-6efb60cabb47
Rhithick02/C-code
Leetcode/week_241/C.cpp
class FindSumPairs { vector <int> ar1, ar2; map <int, int> hash; public: FindSumPairs(vector<int>& nums1, vector<int>& nums2) { for(int i = 0; i < nums1.size(); i++) { ar1.push_back(nums1[i]); } for(int i = 0; i < nums2.size(); i++) { ar2.push_back(nums2[i]); ...
ALGO
0.999947
5.932658
{ "github_metadata": { "branch": "master", "commit_count": 288, "repo_created_at": "2020-04-21T14:09: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": "689f0d68...
2607e991-92f2-40e0-b3d9-70833d926fba
M4rc10n3/Esercitazione_1_IO
main.cpp
#include <fstream> //in order to input and output on files #include <iomanip> //in order to manipulate the inputs and outputs #include <iostream> //in order to print on the standard error // #include <limits> //in order to check for the number of decimal digits using namespace std; //so that I don't have to write "std...
DATA
0.996962
4.480206
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2025-03-23T23:51: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": "3f55c6c6f3...
661de198-905e-4ae8-9ced-c233f1ff52f7
MathiasBalling/Datastrukturer-Algoritmer
tests/heap.cpp
#include "BinaryHeap.h" #include <iostream> using namespace std; int main() { try { // Create a BinaryHeap instance BinaryHeap<int> heap; // Insert elements into the heap cout << "Inserting elements: 10, 20, 5, 15, 30" << endl; heap.insert(10); heap.insert(20); heap.insert(5); heap....
ALGO
0.947194
6.299137
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-09-02T11:42: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": "7462e4815bf...
8bc6463f-f755-4705-b6c0-05d00f92a7b6
wtz19945/Cassie
Controller/Code_gen/codegen/mex/temp_MPC3DFootV98_form_Step0/temp_MPC3DFootV98_form_Step0.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. * * temp_MPC3DFootV98_form_Step0.cpp * * Code generation for function 'temp_MPC3DFootV98_form_Step0' * */ /* I...
ALGO
0.999611
3.741218
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-01-03T19:29: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": "9a65fc1fa9e2...
a66042ad-4841-4388-ae73-1d8f33d2a286
minmaxmean/Codeforces
contest/172/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef map <int, int> mii; typedef pair <int, int> pii; typedef pair <ll, ll> pll; int const maxn = int(1e5 + 12); int const maxb = int(2e6 + 12); int const inf = int(1e9 + 7); ll const linf = ll(1e18 + 12); double ...
ALGO
0.999945
3.57932
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2015-06-28T18:20: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": "3f8c30a33...
802d0357-a2c3-4a41-a840-d1d88b2f5a5f
sazid/codes
problem_solving/devskill/dcp-466.cpp
#include <bits/stdc++.h> #define PLN pair<long, node*> using namespace std; struct node { string data; bool visited = false; vector<PLN > adjacents; }; PLN VISIT(long cost, node *n, node *find) { if (n->visited || n == find) return {cost, n}; n->visited = true; // cout << "Visiting " << n->dat...
ALGO
0.999918
4.181057
{ "github_metadata": { "branch": "master", "commit_count": 169, "repo_created_at": "2017-03-22T18:01:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "413bc25d...
926d5d59-077c-43a0-838e-7d3430b5e1fb
Willzy-x/DataStructure-homework-2018-sophomore
SeqStack/main.cpp
// // main.cpp // SeqStack // // Created by Yucheng on 2018/9/29. // Copyright © 2018 Yucheng. All rights reserved. // #define N 100 #include <iostream> #include <stdio.h> #include <string> #include <string.h> #include <cstdlib> #include "SeqStack.cpp" using namespace std; void Transform(int num, int s); void Trans...
ALGO
0.999507
4.028017
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2018-11-12T12:53: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": "c28134739...
c5953a53-04f3-45c2-93c0-298bf6aa2fef
ankit-sarawag/Data-Structure-Practicals-3rd-Semester-
Q5/Q5.cpp
// Q5 implementing queue as an ADT #include <iostream> #include <stdio.h> using namespace std; const int queueSize = 5; template <class T> class Queue { private: int front = -1; int rear = -1; T queue[queueSize]; public: bool isQueueEmpty() { if (front == -1 && rear == -1) { retur...
ALGO
0.977647
6.405723
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-03-16T13:12: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": "ad38600cac...
a63cbc3f-933e-41a0-bbb5-db458ac51c39
NASA-AMMOS/VICAR
vos/mars/src/prog/marsautotie2/marsautotie2.cc
//////////////////////////////////////////////////////////////////////// // marsautotie2 - multimission tiepoint gathering program: automated // Based on keypoints detection, description and matching //////////////////////////////////////////////////////////////////////// #include "vicmain_c" #include "mars_support.h...
TOOL
0.987216
4.395624
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2020-10-15T23:32:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 52, "forks": 12, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6cd0da3...
b7553959-72f6-4347-87b4-62d284f2cf3c
Shaun-Shane/DigitalImageProcess
DigitalImageProc/CImgEnhance.h
#pragma once #pragma GCC optimize('O2') #include "CGrayImgData.h" #include<vector> #include<algorithm> using std::sort; using std::vector; template<class T> class CImgEnhance:public CGrayImgData<T> { public: CImgEnhance(CGrayImgData<T>& other) : CGrayImgData(other) {} CImgEnhance() : CGrayImgData() {} vi...
ALGO
0.901531
4.924078
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2021-10-31T03:51: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": "8fe625d8928...
f90fd014-19f9-496a-ad00-ede4615fb30f
sakakibear/LeetCode
0036.Valid-Sudoku/Solution.h
class Solution { public: bool isValidSudoku(vector<vector<char> > &board) { for (int i = 0; i < 9; i++) { if (!checkRow(board, i)) { return false; } if (!checkColumn(board, i)) { return false; } } for (int i = 0;...
ALGO
0.999318
6.491246
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2015-01-08T02:24: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": "004650878...
ea197ace-5bff-4368-a151-e3bf4d9acff9
vartika2302/Crack-Your-Placement
Given a linked list of 0s, 1s and 2s, sort it. - GFG/given-a-linked-list-of-0s-1s-and-2s-sort-it..cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; /* Link list Node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; struct Node *start = NULL; // } Driver Code Ends /* Node is defined as struct Node { int data; ...
ALGO
0.99995
5.386
{ "github_metadata": { "branch": "main", "commit_count": 808, "repo_created_at": "2022-05-09T19:34:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "798ed7a9f8...
c5f1eb76-5eca-4261-a990-d4f86c8fbf93
romeauthentic/moneybotccselfleak
cheat/internal_rewrite/math.cpp
#include <xmmintrin.h> #include "math.hpp" #include "interface.hpp" using _m128 = __m128; namespace math { uint32_t md5_pseudorandom( uint32_t seed ) { using fn = uint32_t( __thiscall * )( uint32_t seed ); static auto func = pattern::first_code_match< fn >( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC ...
ALGO
0.989812
6.010619
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-06-17T19:47:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 31, "forks": 12, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "f709512591...
fa247ec0-54ed-42c6-b54c-3b54284780af
ishandutta2007/codeforces-e
enjapma/normal/1307/D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; typedef pair<P, ll> T; long long int INF = 1e18; const ll fact_table = 800008; double Pi = 3.1415926535897932384626; priority_queue <ll> pql; priority_queue <P> pqp; //big priority queue priority_queue <ll,vector<ll>,great...
ALGO
0.999918
3.940538
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:34: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": "7bcb9b9c31eb...
18cf402b-182c-4e24-8f04-7ec8da5b6b27
dani-tro/DAA_practicum_24_25
Exam-1/students-solutions/nzmihaylov_K1/escape_02_9p.cpp
#include <iostream> #include <algorithm> using namespace std; using llong = long long; int const MAX = 1e5; struct water { llong cont, tube; bool operator<(water const& other) const { return tube > other.tube || (tube == other.tube && cont > other.cont); } }; water a[MAX+10]; bool check(ll...
ALGO
0.999835
4.182922
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2025-02-24T13:47:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d7f652306d...
a8529efa-01ab-47e5-802f-de7ff5342972
orfeotoolbox/OTB
Modules/StereoProcessing/DisparityMap/include/otbDisparityMapMedianFilter.h
/* * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES) * * This file is part of Orfeo Toolbox * * https://www.orfeo-toolbox.org/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of ...
ALGO
0.957712
6.879484
{ "github_metadata": { "branch": "develop", "commit_count": 34510, "repo_created_at": "2015-07-17T15:56:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 370, "forks": 120, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0b...
3bf50696-895a-49ff-8a51-69f673b217b8
shuaidongshuai/programming
C/算法训练 操作格子(自己升级).cpp
#include<stdio.h> struct dong{ int l,r, sum,//用来记录 左右子树的和 m;//用来记录 左右子树中最大的一个 }a[1000000]; int max(int a,int b) { return a>b?a:b; } int init(int l,int r,int i) { a[i].l = l; a[i].r = r; a[i].m = 0; a[i].sum = 0; if(l!=r) { int mid = (l+r)/2; init(l,mid,2*i); init(mid+1,r,2*i+1); } } void ...
ALGO
0.999988
3.579745
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2017-09-06T13:11: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": "a84578736...
6fb6ea6d-a758-4390-b935-1ffe92aa3267
ishandutta2007/codeforces-g
gyz_gyz/normal/594/D.cpp
#include<cstdio> #include<algorithm> #define rep(i,x,y) for(int i=(x);i<=(y);i++) #define mo 1000000007 #define N 1048577 #define ll long long #define lb(x) ((x)&(-(x))) using namespace std; struct pr1{int l,r,w;}d[N]; struct pr2{int l,r,id;}q[N]; int n,m,s,t,x,i1,i2;ll al,a[N],R[N],ans[N]; int A[N],pp[N],pr[N],Pr[N],...
ALGO
0.999953
3.324759
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:55: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": "fd50065f781f...
6d535757-332f-4c96-8f35-33c2be2f987e
AutoPas/AutoPas
src/autopas/utils/Quaternion.cpp
/** * @file Quaternion.cpp * @author <NAME> * @date 17/08/2022 */ #include "Quaternion.h" #include "ExceptionHandler.h" namespace autopas::utils::quaternion { std::vector<std::array<double, 3>> rotateVectorOfPositions(const std::array<double, 4> &q, con...
ALGO
0.984149
5.332724
{ "github_metadata": { "branch": "master", "commit_count": 11166, "repo_created_at": "2018-04-06T00:43:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 39, "forks": 10, "issues": 107, "pull_requests": 26 }, "file_meta": { "content_id": "a1...
58f53f96-b64b-4161-9302-981505659490
RafaelAyala/Gra-Sim-Project
cpp/main.cpp
/* * <NAME> * * <NAME> * * Final Project * * TODO decay on collide * remove dead variable */ #ifdef __APPLE__ // Mac OpenGL Libraries #include <GLUT/glut.h> #include <OpenGL/gl.h> #include <OpenGL/glu.h> #else // Linux OpenGL Libraries #include <GL/glut.h> #include <GL/glu.h> #include <GL/gl.h> #i...
TOOL
0.966856
3.636282
{ "github_metadata": { "branch": "master", "commit_count": 130, "repo_created_at": "2011-11-08T01:38:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5ca8fb0...
891395ff-798a-4059-b0d0-40fe436e4b65
zimpha/acm-icpc
ZOJ/ZJP2014/ZOJ3787.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> using namespace std; const int MAXN = 40000 + 10; struct Node{ int ti, b; bool operator < (const Node &rhs) const{ return ti < rhs.ti; } }; Node a[MAXN]; int main() { int T; scanf("%d", &T); while (T --) { int n...
ALGO
0.999924
3.151305
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2013-06-01T11:50:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d87bcc1...
d64e9183-13ec-455f-98bb-560f4d449736
Victoriaester741/Atividade-estrutura-de-dados
Atividades victoria/Busca e ordenação/Busca dados reais.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #define NUM_ALUNOS 10 #define MAX_NOTA 100 // Estrutura para armazenar dados de um aluno typedef struct { char nome[100]; int nota; } Aluno; // Função para realizar a troca de dois alunos void swap(Aluno* a, Aluno* b) { Aluno temp = *a; *a = ...
ALGO
0.999934
6.091672
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-12-04T04:48: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": "1ae7ddd0ed5b...
10e26b44-3f2e-4c90-8152-1cad06397c53
AlvaroAnz/Mi_Repositorio_Final_Alvaro_Anz
Tercer Bimestre/Práctica 0/Control_secuencia_colores_RGB/Control_secuencia_colores_RGB.ino
/* Fundación Kinal Centro Educativo Técnico Labral Kinal Electrónica Grado: Quinto Sección: A Curso: Taller de Electrónica Digital y Reparación de Computadoras I Nombre: <NAME> Carné: 2019373 */ //Directivas de preprocesador #define Rojo 3 #define Azul 6 #define Verde 5 #define Potem A0 //Variables a ...
TOOL
0.946904
4.275301
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-10-10T16:26:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9aa6d219bfbb...
36f17ca9-adf1-40e3-a435-f3313c5dc9de
Haemin-Park/Algorithm_Study
HSHyeon/heap/11279.cpp
// 11279.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다. //자연수면 힙에 넣고, 0이면 가장 큰 값 출력, 배열에서 제거 //배열이 비어있다면 0 출력 #include <iostream> #include <vector> using namespace std; vector<int> heap; void insertheap(int num) { heap.push_back(num); //리프 노드에 변수 삽입 int idx = heap.size() - 1; //리프 노드 위치 while (i...
ALGO
0.999922
4.660089
{ "github_metadata": { "branch": "master", "commit_count": 305, "repo_created_at": "2020-08-10T15:27:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8820814e...
54bb9ce7-f045-4229-a0e9-75d9d0acece1
abhishek100699/GeeksForGeeks
Bit magic/PowerOfTwo.cpp
#include<bits/stdc++.h> using namespace std; //naive solution bool Powerof2(int n){ if(n==0){ return false; } while(n!=1){ if(n%2 !=0){ return false; } n = n/2 ; } return true; } void ispoweroftwo(int n){ if(n&(n-1) == 0){ cout << "The bum...
ALGO
0.999363
4.946501
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-03-06T20:12: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": "f3b1c6b16840...
8eaac94f-1d22-42f2-ad13-f99e3372fa17
cocm1324/algo
_1035.cpp
#include <iostream> #include <queue> #define ROWLEN 5 using namespace std; int loop(int*, int, int, int, int, int); int zero_factor(int*, int, int, int, int, int, int, int); int count_line(int*, int, int, int, int, int, int, int); bool grid_check(int*); int main() { int* grid = new int[ROWLEN * ROWLEN]; int...
ALGO
0.999756
4.096173
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-11-24T12:39: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": "53a14a476...
7c9ba883-f0b9-44b4-aefb-1acef1f0992e
NirbhaySirsikar/MyPrograms
Binary Tree/LowestCommonAncestor.cpp
#include <bits/stdc++.h> #include "BinaryTree.cpp" using namespace std; bool getpath(node *root, int key, vector<int> &path) { if (root == NULL) { return false; } path.push_back(root->data); if (root->data == key) { return true; } if (getpath(root->left, key, path) || get...
ALGO
0.999998
4.665946
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-07-08T11:43:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5364f2407b93...
573a670f-6ef3-4c2a-a5af-a46771e6644a
Nandu0786b/DSA
TREE/64_4_Top View of Binary Tree.cpp
// Top View of Binary Tree // https://practice.geeksforgeeks.org/problems/top-view-of-binary-tree/1?utm_source=gfg&utm_medium=article&utm_campaign=bottom_sticky_on_article // https://www.codingninjas.com/codestudio/problems/top-view-of-the-tree_799401 class Solution//gfg { public: //Function to return a list o...
ALGO
0.999995
5.445813
{ "github_metadata": { "branch": "master", "commit_count": 167, "repo_created_at": "2023-04-20T10:32:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76722919...
6f8bf0a4-7752-4c32-9f96-ab5d76cbef21
youeo/pjj
백준/Gold/2470. 두 용액/두 용액.cc
#include <bits/stdc++.h> using namespace std; typedef long long ll; //===================================== int n, x; ll arr[100'000]; //===================================== int main() { cin.tie(0)->ios::sync_with_stdio(0); ll min = 0x7f7f7f7f7f7f; cin >> n; // 배열 생성 for (int i = 0; i < n; i++) { cin >> ar...
ALGO
0.999999
4.421546
{ "github_metadata": { "branch": "main", "commit_count": 257, "repo_created_at": "2024-10-06T10:40:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9d41e99e3...
fdd3ea6e-071d-4a53-8fce-eb3c6e2ebd4e
1dongdongyang1/Data-structure
BSTree/BSTree_KV.hpp
#pragma once #include<iostream> using namespace std; template<class K, class V> struct BSTreeNode { public: BSTreeNode<K,V>* _left; BSTreeNode<K,V>* _right; K _key; V _value; BSTreeNode(const K& key, const V& value) :_left(nullptr) , _right(nullptr) , _key(key) , _value(value) {} }; template<class K, ...
ALGO
0.999295
4.114985
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2024-10-22T12:18: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": "2738f263e7...
19d25dcd-bfe7-45a6-a2db-13010db80036
ormalkai/AdvancedProgramming
Tournament.cpp
#include <string> #include <iostream> #include <thread> #include <cassert> #include <iomanip> #include "Tournament.h" #include "Game.h" #include "Debug.h" #include "PriorityQueue.h" ReturnCode Tournament::init(const string& directoryPath) { DBG(Debug::DBG_DEBUG, "init tournament"); vector<string> boardsFilesPaths; ...
TOOL
0.959633
4.093213
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2017-04-02T15: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": "2b577921...
516c7372-454a-459d-9fef-343a9e703949
ShisatoYano/KthLargestElementInaStream
main.cpp
#include <iostream> #include <queue> using namespace std; class KthLargest { private: int k; priority_queue <int, vector<int>, greater<int>> min_heap; public: KthLargest(int k, vector<int>& nums) { this->k = k; for (int num : nums) { this->min_heap.push(num); } while ...
ALGO
0.999897
6.282049
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-03-20T12:44: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": "973b441c247...
951d0aff-a2e0-4b20-a6d7-c0845505c664
Anshit01/Competitive-Programming
codeforces/640_div4/7.cpp
#include <bits/stdc++.h> #define ll long long #define f(i, x, n) for(int i = x; i < n; i++) #define dbg(x) cout << x << endl #define dbg2(x, y) cout << x << " " << y << endl #define dbg3(x, y, z) cout << x << " " << y << " " << z << endl #define mod 1000000007 using namespace std; int main(){ ios::sync_with_std...
ALGO
0.999631
4.109216
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2020-05-23T11:21:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6749301...
cc28ee5f-dc67-4579-995f-49ec35217ea9
rohanrajpal/IIITD-Fourth-Sem
ADA/Lab5/Q2.cpp
#include<bits/stdc++.h> #define ll long long #define ld long double #define vll vector<ll> #define vvll vector< vll > #define pll pair<ll ,ll > #define MOD 1000000007 #define rall(v) v.rbegin(),v.rend() #define fst first #define mp make_pair #define pb push_back #define fast ios_base::sync_with_stdio(false),cin.tie(NUL...
ALGO
0.999344
3.377701
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-03-19T05:14: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": "3ff3a02a68...
69da2649-c3ef-4f23-a964-c8575ea6b778
dlalsrn/Baekjoon
백준/Silver/29715. 비밀번호 찾기/비밀번호 찾기.cc
#include <iostream> using namespace std; using ll = long long; ll N, M, X, Y, a, b, cnt1 = 1, cnt2 = 1, t = 1, ans = 0; ll correct_num = 0, random_num = 0; int main(void) { cin.tie(0)->sync_with_stdio(false); cin >> N >> M >> X >> Y; for (ll i = 0; i < M; i++) { cin >> a >> b; if (a) correct_num++; els...
ALGO
0.99902
3.481796
{ "github_metadata": { "branch": "main", "commit_count": 845, "repo_created_at": "2022-10-18T11:21: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": "e2881a9a15...
380b2405-2cd5-4e57-bb40-65ee2422dccb
RUDRAKSHARMA18/FOCP-2
b9.cpp
#include <iostream> using namespace std; int main() { int r, c; cout << "Rows aur columns kitne hai: "; cin >> r >> c; int mat[r][c], trans[c][r]; cout << "Matrix ke elements :\n"; for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { cin >> mat[i][j]...
ALGO
0.999795
5.46734
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-01-26T09:21:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60ddfa1f662...
1cea5ffe-9cd3-4301-9b15-37cd57aac725
ishandutta2007/codeforces-l
lawrenceli/normal/452/A.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define px real() #define py imag() #define rep(i, n) for (int i=0, _##i=(n); i<_##i; ++i) #define repi(i, n) for (__typeof((n).begin()) i=(n).begin(), _##i=n.end(); i != _##i; ++i) #define sz(x) int((x).size()) #define print(x) cerr << ...
ALGO
0.998745
3.081089
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:17: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": "535c7f3bf262...
1d1ab4f4-4806-428e-b8f6-29b9e2233b14
raymondwusuper/cpptest
zetamac.cpp
#include <iostream> #include <random> #include <thread> #include <atomic> #include <chrono> #include <string> std::atomic<bool> time_up(false); void timer(int seconds) { for (int i = seconds; i > 0; i--) { std::this_thread::sleep_for(std::chrono::seconds(1)); } time_up = true; } int main() { std::random_devic...
ALGO
0.917414
4.615224
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-24T05:10: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": "cfe826057f67...
3004eb51-84e0-45a4-ae7e-013e06129691
sitianos/facial-cryption
src/facial_cryption.cpp
#include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/objdetect.hpp> #include <iostream> #include <fstream> #include <iomanip> #include <filesystem> #include "lsh.hpp" #include "cryption.hpp" static void visualize(cv::Mat& input, cv::Mat& faces, std::string text, int thickness = 2){ for ...
TOOL
0.941077
4.985646
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-11-24T01:31: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": "1cef83954fae...
f460fea7-4a16-4918-879d-b7211d9f5417
eduardoRubioG/NMR-Analyzer
spline.cpp
// // spline.cpp // nmr // // Created by <NAME> on 10/17/19. // Copyright © 2019 <NAME>. All rights reserved. // #include <stdio.h> /** * INPUT: * int n - Number of points * vector<double> x - all x points * vector<double> y - all y points (referred to as all a points in the book) */ void spline( const Da...
ALGO
0.99834
5.136975
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-12-21T03:47: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": "6c0fc0a05...
214452c1-8b5d-451e-892d-445f80f31f66
mohdsaquib93/Algorithms
Data Structures/ravula/test.cpp
#include <bits/stdc++.h> using namespace std; bool isValidBox(vector<string>& board, int row, int col) { for (int i = col; i >= 0; --i) if (board.at(row).at(i) == 'Q') return false; for (int i = row, j = col; i >= 0 && j >= 0; --i, --j) if (board.at(i).at(j) == 'Q') r...
ALGO
0.99962
4.436977
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-06-12T03:54: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": "d3e18f97e6...
6a12006e-4ac9-4196-8d0a-6b72a38ff6a1
csirac/triangle-interdiction
smallGraph.cpp
#include <string> #include "mygraph.cpp" #include <iostream> using namespace mygraph; int main(int argc, char ** argv) { tinyGraph G; string fname( argv[1] ); G.read_adj_list_bin( fname ); // G.logg(INFO, "Listing triangles..." ); // G.list_triangles(); G.logg(INFO, "Starting DAR...
ALGO
0.975821
3.724456
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2017-04-30T19:00: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": "af065f281...
44903234-e05b-413e-b590-65425fc9c34f
lilelr/POJ-solutions
chapter12_dp_1/HDU_1176_free_cookie.cpp
//bug http://acm.hdu.edu.cn/showproblem.php?pid=1176 #include <bits/stdc++.h> using namespace std; #define M(a, b) memset(a,b,sizeof(a)) // memset(a,0x3f,sizeof(a)) //memset(a,0xcf,sizeof(a)) typedef long long LL; //分析: //设a[i][j]为第i秒的j位置掉下的馅饼数量,f[i][j]为第i秒在j位置接馅饼最多可以接到的最多馅饼数量。由于每秒只能移动一个位置,因此这一状态可能由三种情况达到: // //f[i - ...
ALGO
0.999892
3.503623
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2018-08-04T10:25: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": "e7952da46...
0d5c6c08-2ca2-4980-9162-66adb43e26f7
wannabetolkien/LeetCode
ArrayProblems.cpp
/* <NAME> - Bismillah */ #include <bits/stdc++.h> using namespace std; #define endl "\n" #define lint long long int #define mod 1000000007 // Question No.1- Find the largest number in the array. lint largest(vector<lint> &arr){ lint largest=LLONG_MIN; for(int i=0;i<arr.size();i++){ largest=max(largest...
ALGO
0.999974
4.341432
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-06-24T10:37: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": "5fcb7165eab0...
ae9a4644-c997-4c8f-ad12-6734967e1de9
marynelv/hark-fd
hark-fd/src/CMConjEachElement.cc
/* * Copyright 2008 Kyoto University and Honda Motor Co.,Ltd. * All rights reserved. * HARK was developed by researchers in Okuno Laboratory * at the Kyoto University and Honda Research Institute Japan Co.,Ltd. */ #define NDEBUG #include <iostream> #include <BufferedNode.h> #include <Buffer.h> #include <Vector.h...
ALGO
0.971515
5.050151
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-03-22T15:59:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "53ee702d95...
6eabdaa5-f136-4b9a-85ee-9ff877112b30
KMS-TEAM/Training_Project
Matrix/main.cpp
#include <iostream> #include <vector> std::vector<std::vector<int>> drawMatrix(int level, int &number) { if (level == 1) { std::vector<std::vector<int>> matrix(level, std::vector<int>(level, 0)); matrix.at(0).at(0) = 1; number = 1; return matrix; } int new_number = 0; s...
ALGO
0.999803
3.560217
{ "github_metadata": { "branch": "master", "commit_count": 158, "repo_created_at": "2021-07-10T04:57:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d010ccdc...
6518e90d-a56a-4492-8036-0c7e2a1cedb2
jaehobang/drone_tragectory_display
joint_mapping-master-9f5a96103477f48c4abcca0a7157f4201f62c4cd/src/CRProcess.cpp
/* * @file CRProcess.cpp * @brief hypothesis prior by chinese restaurant process * @author <NAME> * @date Sep 18, 2014 */ #include <joint_mapping/CRProcess.h> #include <joint_mapping/Hypothesis.h> #include <numeric> using namespace std; using namespace gtsam; namespace comap { /* *****************************...
ALGO
0.9995
5.90739
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-07-18T20:19:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f83ce139d4...
20a9c244-4ed8-492d-9349-ffaebe487e8e
xiaobinf/algorithm
ch6/GetNumberOfK.cpp
#include <iostream> using namespace std; /** ** find the number of k in a sorted array **/ int GetFirstK(int* data,int length, int k,int start, int end) { if(end<start) { return -1; } int midIndex = (end - start)/2+start; int midNum = data[midIndex]; if( midNum == k) { if((d...
ALGO
0.999892
4.458564
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-08-08T06:26: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": "108c1f905...
6c9d28d8-4f33-45b2-9ac6-dc797abc1714
GaussGreen/old-code
JP/code/drlib/rng/src/SobolSequence.cpp
// ----------------------------------------------------------------------- // This proprietary software has been developed strictly for J.P. Morgan's // internal use. Any use or misuse, intentional or otherwise, which // contradicts or places this policy in jeopardy is strictly forbidden. // // Copyright 2001 <NAME> &...
ALGO
0.940959
4.741886
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-02-17T09:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9ffa4cc8e13...
0467b6bd-7e00-4228-ba53-7352a3175d8b
leo950413/Codeforces
CSES/Dynamic Programming/1637.cpp
#include<iostream> #include<climits> #include<string> using namespace std; int const SIZE = 1e6 + 1; int memo[SIZE] = {0}; void init(int n){ memo[0] = 0; for(int i=1; i<=n; i++){ int t = i; int digit = t %10; memo[i] = 1e9; while(t){ memo[i] = min(memo[i] , memo[i-dig...
ALGO
0.999871
4.071835
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2025-07-13T16:14: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": "47e11f1e3...
8707f68c-2122-4e14-85e2-97f64ef9930c
hahaschool/playground
Codeforces/CF380D.cpp
// // CF380D.cpp // playground // // Created by 張正昊 on 13/8/2016. // Copyright © 2016 <NAME>. All rights reserved. // #include <stdio.h> #include <iostream> #include <algorithm> #include <queue> #include <vector> #include <cstdlib> #include <string> #include <cstring> #include <ctime> #include <iomanip> #include <...
ALGO
0.999965
3.78449
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2016-02-15T17:56: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": "9b9c77a4c...
41957e00-c6da-4317-b4a9-0ed6ad300316
masayukisobe/atcoder
problems/bootcamp/hard/83/main.cpp
// #define _GLIBCXX_DEBUG // #pragma GCC optimize("O2,unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define uint unsigned int #define ii pair<int,int> #define iii tuple<int,int,int> #define endl '\n' #define debug(x) cout << #x << ": " << x << endl //...
ALGO
0.999892
4.271026
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2024-04-15T13:28: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": "fed9df072...
28d91b04-9e7c-4ceb-b6e0-b0e5def2b66c
XutongLi/Leetcode-Solution
546. Remove Boxes/solution_1.cpp
class Solution { private: int dfs(const vector<int> &boxes, int mem[100][100][100], int l, int r, int k) { if (l > r) return 0; if (mem[l][r][k] > 0) return mem[l][r][k]; while (r > l && boxes[r] == boxes[r - 1]) { -- r; ++ k; } mem[l][r][k] = dfs(boxes, mem,...
ALGO
0.999997
5.842165
{ "github_metadata": { "branch": "master", "commit_count": 573, "repo_created_at": "2018-07-21T09:08: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": "e849fd0d...
d4faa2ee-e96e-4cc3-bd44-3a90926da6d6
WeiYuChen0702/Data_structure
Heap_sort/Heap_sort/Heap_sort.cpp
//[演算法] 插入排序法(Heapsort) #include<stdio.h> #include<stdlib.h> //16 14 10 8 7 9 3 2 4 1 int input(int input1[], int cou) { int num = 0; printf("Input:(0結束)\n"); while (1) { scanf("%d", &num); if (num == 0) { break; } else { input1[cou] = num; cou++; } } return cou; } void output(int Heap[]...
ALGO
0.999853
3.582121
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-03-30T06:04:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5ab77017c...
8366f6ba-a3b4-4c81-9c25-7526fde90116
SUSHANTSINGH01/CP-AND-DSA
DSA/linked_list/flatten_a_multilevel_doubly_linked_list.cpp
vector<int>v; void childd(Node *head) { if(!head) return ; while(head) { v.push_back(head->val); if(head->child) childd(head->child); head=head->next; } } class Solution { public: Node* flatten(Node* head) { if(!head) return 0; ...
ALGO
0.999991
5.336766
{ "github_metadata": { "branch": "main", "commit_count": 1167, "repo_created_at": "2021-10-30T03:17: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": "dbf19afc1...
150aaa17-7098-4ea6-b226-e3661580249f
lfq0921/NJU-Problem-Solving
OJ/linked-list-plus.cpp
#include<stdio.h> #include<iostream> using namespace std; struct node { int val; node* next; }qia[3], ga[3]; int count = 0; node* input(int n) { node *head = &qia[++count], *tail = &ga[count]; head->next = tail; node *p = tail; for (int i = 1; i <= n; i++) { node *newnode = new node; int x; cin >> x; new...
ALGO
0.999931
3.145353
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-24T07:23:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b831547ba3b7...
4391f6c2-e6ab-4899-9d0e-088d23d64abd
gerardcanal/PPDDL_determinization
src/PPDDLParser/parser_main.cc
// TODO add licence // PARSER CODE BASED ON MDPSIM obtained from https://github.com/hlsyounes/mdpsim #include <iostream> #include <cstdio> #include <cstring> #include <cerrno> #include <cstdlib> #include "problems.h" using namespace ppddl_parser; /* The parse function. */ extern int ppddl_parse(); /* File to parse. ...
TOOL
0.96487
5.313542
{ "github_metadata": { "branch": "master", "commit_count": 112, "repo_created_at": "2018-03-07T17:30:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1279012f...
c8ee8d91-0589-4d8b-8423-46fb8ef4f6e6
v-diepttn147/DSA-HCMUT
Lab 1/1.2.cpp
#include<stdlib.h> #include<stdio.h> #include <limits.h> #include<iostream> #include<time.h> #include <cstdlib> using namespace std; #define Max 20 void mul2Matrix(int R1, int C1, int R2, int C2, int matrixA[][Max], int matrixB[][Max]){ int i, j, k; //Cap phat ma tran C trong bo nho Heap int **Matrix_C = ...
ALGO
0.997092
3.649048
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-04-09T06:41:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc5dda6b3b...
7cba4ea7-936d-4eeb-a1e7-2f078f843918
zhangkangbin/C_Study
chapter3_stack_queue/QueueLinkList.cpp
#include <stdio.h> #include <iostream> using namespace std; /* * @Author: zhangkangbin <EMAIL> * @Date: 2022-08-21 10:53:40 * @LastEditors: zhangkangbin * @LastEditTime: 2022-10-11 17:46:15 * @FilePath: \C_Study\chapter3_stack_queue\QueueLinkList.cpp *队列 *队列是一种特殊的线性表,特殊之处在于它只允许在表的前端(front)进行删除操作, 而在表的后端(rear)...
ALGO
0.993987
4.131954
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2022-08-18T07:57: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": "79926a5b...
e4d5806c-8083-49ae-8c1c-54c41017ef00
PerfectLifeG/Algorithm-Competition
HDU/24第七场/1008.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define all(x) x.begin(),x.end() #define no cout<<"No"<<endl #define yes cout<<"Yes"<<endl #define endl '\n' // #define x first // #define y second typedef pair<int,int> PII; const int N=110; const int mod=1e9+7; const int INF=0x3f3f3f3f3f3f3f3f; int n...
ALGO
0.999952
4.04514
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-08-27T07:51:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "459d29111495...
ff331eb6-2ba4-4875-b04f-994856b68d49
robdobsn/JewelryOS
evaluations/OlderFilterTests/TestFilter.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <cmath> class IIRFilter { public: // Constructor for 8th order filter IIRFilter(const std::vector<double>& a_coeffs, const std::vector<double>& b_coeffs, const std::vector<double>& zi_initial) { ...
ALGO
0.995106
5.920838
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2023-11-13T09:32:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f748916f235...
ffad47fc-f494-49bf-9cce-72ee11738db8
polarr/competitive-programming
USACO/Silver/2025Jan/2.cpp
/** * Solution by 1egend (polarity.sh) * Date: 2025-01-24 * Contest: USACO 2025 January Silver * Problem: 2 **/ #include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using ll = long long; using vi = vector<int>; using vl = vector<ll>; using pii = pair<int, int>; #define pb push_back #defin...
ALGO
0.999985
5.071766
{ "github_metadata": { "branch": "main", "commit_count": 241, "repo_created_at": "2020-12-16T18:38:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14787f5b9e...
af1f09bb-6dee-4dd2-8573-7ff169148e07
animesh363/java02
UniverdsalCPP/overloading02.cpp
// #include <iostream> // using namespace std; // class data{ // public: // int num1; // data(int n ){ // num1 = n; // } // data operator+(data d2); // void display(){ // cout<<"value of num1="<<num1; // } // data data:: operator+(data...
ALGO
0.901576
5.859758
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-03-03T14:05: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": "13e8568412...
6999de4a-abf0-4eb0-81bd-658e045328d3
IsabelRivadero/ingencompu-informatica
Soluciones10/Guia10E3.cpp
#include <iostream> #include <iomanip> using namespace std; // SOLUCIONARIO DE EJERCICIOS // // // <NAME> 10 N3 const int N=3; int maximo ( int [N][N], int& , int& ); int main() { int fila , columna , i , j , mayor; int mat[N][N]; cout << "Ingrese los valores enteros de la matriz 3x3: " << end...
ALGO
0.999575
3.991448
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-27T22:47: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": "9506579b5376...
0eb87fe5-ba0b-49f3-b475-d5263d8197ba
alvas/ms_interview_100
leetcode/SwapNodesInPairs.cpp
#include <iostream> #include "LinkList.h" using namespace std; /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* swapPairs(ListNode* head) { ListNode *dummy = ne...
ALGO
0.999947
5.662064
{ "github_metadata": { "branch": "master", "commit_count": 197, "repo_created_at": "2014-02-15T02:04:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bb0f62a...
5bec4f16-6685-4b26-9679-1e3c7f91d3f8
raincross7/code-similarity
codes/train_code/problem179/problem179_84.cpp
#include <bits/stdc++.h> using namespace std; #define dump(x) cout << (x) << '\n'; typedef int64_t Int; Int mod = 1e9+7; Int INF = 1e9+18; int main() { ios::sync_with_stdio(false); Int n, k; cin >> n >> k; vector<Int> a(n); vector<Int> b(n + 1, 0); vector<Int> c(n + 1, 0); Int sum = 0; ...
ALGO
0.99998
3.744883
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e807b344358...
6e5fd03a-33a3-471f-9098-ebd806b94455
sonomag13/algo-recursion
implement-queue-using-stacks/Solution.h
// LeetCode 232. Implement Queue using Stacks // Easy #include <stack> using namespace std; class MyQueue { public: /** Initialize your data structure here. */ MyQueue() { } /** Push element x to the back of queue. */ void push(int x) { while (!st2.empty()) { ...
ALGO
0.999614
6.180855
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2021-08-18T05:47:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f735b5c76...
45fdcb8f-bbb8-486c-9cfb-aecff3223401
aunagar/CSN212-DesignAndAnalysisOfAlgorithms
Assignment4/Graham_Scan.cpp
#include <iostream> #include <stack> #include <cstdlib> using namespace std; struct Point { int x, y; }; Point nextToTop(stack<Point> &); int swap(Point &, Point &); int distSq(Point, Point); int orientation(Point, Point, Point); int compare(const void *, const void *); void convexHull(Point [], int); // A globle p...
ALGO
0.99998
5.105681
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-01-23T08:55: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": "0f4cbe08a...
afa6a77a-63ff-469d-9cce-3b451555199f
espottesmith/somatics
swarms/swarm.cpp
#include <cmath> #include <random> #include <vector> #include <fstream> #include <stdio.h> #include <iostream> #include <functional> #include <omp.h> #include "swarm.h" #include "swarm_mpi.cpp" #include "../common.h" #include "../pes/pes.h" double compute_dist_sq(double* u, double* v) { double distance = 0.0; for ...
ALGO
0.999959
5.877641
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2020-04-23T19:37:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab75817b...
41666064-a875-4c98-a02c-d802b9c94530
realAYAYA/UnrealEngine-ToonLit
UnrealEngine/Engine/Source/Runtime/MovieScene/Private/Channels/MovieSceneCurveChannelImpl.cpp
// Copyright Epic Games, Inc. All Rights Reserved. #include "Channels/MovieSceneCurveChannelImpl.h" #include "Channels/MovieSceneDoubleChannel.h" #include "Channels/MovieSceneFloatChannel.h" #include "Channels/MovieSceneInterpolation.h" #include "HAL/ConsoleManager.h" #include "MovieSceneFrameMigration.h" #include "Cu...
TOOL
0.935571
4.958658
{ "github_metadata": { "branch": "5.4", "commit_count": 164, "repo_created_at": "2023-03-14T06:10:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 66, "forks": 9, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cac4c3f1ac...
a3b6d51e-db16-4626-8ea0-6a0356edcdf0
atomictheory/simplemente
position.cpp
#include "position.h" #include "simplemente.h" #include "xboard.h" #include "xxhash.h" #include <iostream> #include <fstream> #include <time.h> #include <string> using namespace std; int randh() { return rand() % RANDOM_BONUS; } bool quit_search; bool search_quitted=true; bool disable_search_quitted=false; bool ...
ALGO
0.994231
4.268734
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2015-03-07T10:25:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "658009336...
7579561b-2d4a-4634-ad65-d719ed24bd0c
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/ai_code/train/0_0_5481.cpp
#include <iostream> #include <string> int main() { int n; std::string sequenceA, sequenceB; std::cin >> n >> sequenceA >> sequenceB; int red_spots_Nikephoros = 0, red_spots_Polycarpus = 0; for(int i = 0; i < n; i++) { char a = sequenceA[i % sequenceA.size()]; char b = sequenceB[i ...
ALGO
0.999896
5.086917
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e7cec69433...
9a99aadb-ebba-470c-983d-44cb722ddb0b
European-XFEL/EXtra-foam
src/extra_foam/include/f_imageproc.hpp
/** * Distributed under the terms of the BSD 3-Clause License. * * The full license is in the file LICENSE, distributed with this software. * * Author: <NAME> <<EMAIL>> * Copyright (C) European X-Ray Free-Electron Laser Facility GmbH. * All rights reserved. */ #ifndef EXTRA_FOAM_IMAGE_PROC_H #define EXTRA_FOAM_...
ALGO
0.97903
7.208503
{ "github_metadata": { "branch": "dev", "commit_count": 2404, "repo_created_at": "2019-11-27T09:16:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 10, "issues": 32, "pull_requests": 17 }, "file_meta": { "content_id": "29aa38fb...
6fc464f1-9ab2-4a8c-9b00-8a366c71b20e
zdzhaoyong/GSLAM
GSLAM/core/Vocabulary.h
// GSLAM - A general SLAM framework and benchmark // Copyright 2018 PILAB Inc. All rights reserved. // https://github.com/zdzhaoyong/GSLAM // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of so...
CONFIG
0.96816
3.927079
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2016-08-10T13:14:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1043, "forks": 270, "issues": 21, "pull_requests": 0 }, "file_meta": { "content_id": "82b...
edeab428-d13e-432a-90bc-211ab57da1cf
razmikTovmas/BinarySearchTrees
src/AVLTree.cpp
#include "AVLTree.h" #include <algorithm> Node* AVLTree::Insert(int value) { Node* node = InsertHelper(root, new AVLNode(value)); if (node == nullptr) { return nullptr; } return BalanceHelper(node->GetParent()); } Node* AVLTree::Remove(int value) { Node* node = RemoveHelper(FindNode(root,...
ALGO
0.99313
5.78632
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2018-08-13T10:27:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9933b09f...
daca5878-23b8-4306-b264-01315d7e0c5e
GustavoPolicarpo/maratona
URI/BEGINNER/1045 - Triangle Types.cpp
// Author: <NAME> // Name: Triangle Types // Level: 4 // Category: BEGINNER // URL: https://www.beecrowd.com.br/judge/en/problems/view/1045 #include <iostream> #include <cmath> #include <iomanip> using namespace std; long double I1, I2, I3; long double A, B, C; int main() { cin >> I1 >> I2 >> I3; //colocando e...
ALGO
0.999865
4.17652
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-09-30T17:58:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef2573b80...
85bca5f7-9b5f-4563-887b-67607b569328
rusucosmin/cplusplus
Doipe/main.cpp
#include <fstream> #include <iostream> #include <vector> #include <bitset> #include <string.h> #include <algorithm> #include <iomanip> #include <math.h> #include <time.h> #include <stdlib.h> #include <set> #include <map> #include <string> #include <queue> #include <deque> using namespace std; const char infile[] = "d...
ALGO
0.999983
3.612313
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2014-02-06T08:06:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd20a0958...
92fb6c43-0a73-4381-8682-d54ea1e3b752
hacktheinterview/hacktheinterview
problems/26/solution.cpp
int getMax(const vector<int>& input) { int max = INT_MIN; for (int i = 0; i < input.size(); i++) { if (input[i] > max) max = input[i]; } return max; } int getSum(const vector<int>& input) { int total = 0; for (int i = 0; i < input.size(); i++) { total += input[i]; } return total; } int getRequiredStudents...
ALGO
0.999936
5.114919
{ "github_metadata": { "branch": "master", "commit_count": 274, "repo_created_at": "2016-02-22T13:42:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "076dcab04...
54aa94b6-d7ea-48da-8557-9f7a11c89776
xutengx/data-structure
leetcode/editor/cn/148-sort-list.cpp
//给你链表的头结点 head ,请将其按 升序 排列并返回 排序后的链表 。 // // // // // // // 示例 1: // // //输入:head = [4,2,1,3] //输出:[1,2,3,4] // // // 示例 2: // // //输入:head = [-1,5,3,4,0] //输出:[-1,0,3,4,5] // // // 示例 3: // // //输入:head = [] //输出:[] // // // // // 提示: // // // 链表中节点的数目在范围 [0, 5 * 10⁴] 内 // -10⁵ <= Node.val <= 10⁵ //...
ALGO
0.999998
5.858191
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2021-03-22T17:16: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": "38553c1903...
c3be98e0-90a5-45e6-806e-b94c0206f98f
hbbproc/heap
RedPacket.h
#pragma once //100w个数中找出最大的k个数,建最小堆 #include<assert.h> #include<iostream> using namespace std; void _AdjustDown(int* KOfArr,int k,int root) { int child = root * 2 + 1; while (child < k - 1) { if (child + 1 < k - 1 && KOfArr[child] > KOfArr[child + 1]) { ++child; } if (KOfArr[child] < KOfArr[root]) { ...
ALGO
0.999747
4.599488
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-06-14T12:16: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": "f785d4511d...
6a7a92c1-038a-4bc8-9eb6-923eaedb6a9a
dutta14/stanford-daa-coursera-part1
adjacency_list.cpp
/* A program to print the adjacency list of a graph. */ #include <iostream> using namespace std; class node { public: int value; node *link; node(int val) { value = val; link = NULL; } }; class list { public: node *head; }; class graph { public: int V; list *adjList; graph(int v) { V = v; adjList =...
ALGO
0.999852
5.396244
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-09-22T17:14: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": "00043bc027...
4f3cd625-9e8a-4b48-98de-27f2b401bd36
Bharatbardiya/my-leetcode-solutions
0863-sum-of-distances-in-tree/0863-sum-of-distances-in-tree.cpp
class Solution { public: pair<int,int>dfs(vector<vector<int>>&adj, int src, int pr, vector<pair<int,int>>&dp){ pair<int,int> ans = {0,1}; for(auto u : adj[src]){ if(u!=pr){ pair<int,int> pr = dfs(adj, u, src, dp); ans.first += (pr.first+pr.second)...
ALGO
0.99997
5.198282
{ "github_metadata": { "branch": "main", "commit_count": 1138, "repo_created_at": "2024-12-05T05:20: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": "d6ea8e0fc...
54c596b9-343a-4a2e-9db4-a82e5d4de03a
ymd45921/HUST-ACM-training
vjudge/2020七月暑假集训/HDU 多校 2020/Day 5/1002.cc
/** * */ #include <iostream> #include <cstdio> #include <cctype> #include <algorithm> #include <cstring> using namespace std; using longs = long long; using uint = unsigned; inline int nextInt() { int x = 0, f = 0, ch = getchar(); while (!isdigit(ch)) ch == '-' && (f = 1), ch = getchar(); while (isdigit...
ALGO
0.999069
3.665986
{ "github_metadata": { "branch": "master", "commit_count": 423, "repo_created_at": "2020-12-02T04:26: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": "4900f5b1...
db9d89b9-ef42-4191-9ca2-6b69aaf6d2ae
dtorber/LeetCode
Top Interview Questions/101. Symmetric Tree/Solution.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.999989
6.425059
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-04-24T18:36: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": "17cf8387e10...
748c3a40-3e03-4280-a377-8f0d2dc32b8a
ValentineRO/decision-tree
src/iteratingOTP.h
#pragma once #include "models.h" #include "gurobi_c++.h" #include <cmath> using namespace std; class solClust{ public: vector<Tree> T; int errorInProcess; time_t totTime, clTime; int nbIter, nbClInitial, nbClFinal; double pseudoGap; vector<time_t> solveTime, centeringTime; vector<double> gap, obj, valWS...
ALGO
0.999693
4.089022
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-06-03T10:29:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5170ab47761...
2ead2bd7-6053-4f4f-98d5-e2d126684e60
ParAlg/gbbs
benchmarks/Connectivity/ConnectIt/framework.h
#pragma once #include "benchmarks/Connectivity/LabelPropagation/Connectivity.h" #include "benchmarks/Connectivity/LiuTarjan/Connectivity.h" #include "benchmarks/Connectivity/ShiloachVishkin/Connectivity.h" #include "benchmarks/Connectivity/UnionFind/Connectivity.h" #include "benchmarks/Connectivity/common.h" #include...
ALGO
0.999652
7.160502
{ "github_metadata": { "branch": "master", "commit_count": 1527, "repo_created_at": "2018-05-16T23:43:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 211, "forks": 58, "issues": 8, "pull_requests": 6 }, "file_meta": { "content_id": "74da0...