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
c56190d2-e195-4ddc-972a-94ed2a9a14a7
WilliamX1/SJTU-SE
交大OJ/LG-P1719.cpp
#include <bits/stdc++.h> #include <stdio.h> using namespace std; int A[121][121]; int dp[121]; //dp[i][j]表示第i列第j行时最大值 int main() { int N; scanf("%d", &N); memset(A, 0, sizeof(A)); for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++) { scanf("%d", &A[i][j]); A...
ALGO
0.99994
3.11341
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-04-07T09:20:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "34f807a9ee...
d340e4cd-5cbf-43eb-9508-9b30b7b2b752
asharnadeem002/Huffman_Coding
main.cpp
#include<iostream> #include<vector> #include<fstream> #include<string> using namespace std; class Node { public: int frequency; Node* left; Node* right; char data; Node(){ data = 0; left = NULL; right = NULL; frequency = 0; } Node(int freq, Node* left, Node* right, char data){ frequency = freq; this->...
ALGO
0.999965
3.403024
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-06-02T13:04: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": "7ec149521d7b...
8fa9a7a1-3a21-4601-987e-ab3304125e02
crusior96/ALGORITHM_CODINGS
조세퍼스순열_백준(1158).cpp
#include<iostream> #include<queue> using namespace std; //1번부터 M번까지의 사람이 M번까지 번호가 적혀있는 원탁에 앉아있다. 1번부터 순서를 세어 N번쨰에 나오는 사람을 원탁에서 빼고 그 자리의 번호를 기억한다. //모든 사람이 원탁에서 나오게 된다면, 그때 사람들이 나오게 된 번호의 순서를 출력하라. int main() { queue<int> jo; //사람들이 앉아있는 원탁을 구현하기 위해 회전큐를 응용하기로 한다. int results[5001] = {}; //사람들이 자리에서 나오게 된 순서대로 좌석번호가...
ALGO
0.999995
3.346219
{ "github_metadata": { "branch": "master", "commit_count": 290, "repo_created_at": "2018-10-28T05:35: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": "5ffef580...
3847ad61-335c-4258-80a0-a3d01588333f
Tracker647/myprogramming
C/algorithm/week8_2021421/intDivideEx.cpp
#include<iostream> using namespace std; const int MAXN = 55; int dp1[MAXN][MAXN] = { 0 }; void init1(int maxn) { // DP状态设计,dp[n][k]表示数字n,被划分成k个数的组合情况数,初始化为0 // 定下了K个数,那么以这K个数中包不包括1分为两个情况,这样都能做状态转移 for (int n = 1; n <= maxn; n++) { for (int k = 1; k <= maxn; k++) { // 1. k=1时只有一种,{n} ...
ALGO
0.999716
4.015191
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-05-27T09: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": "692563f730...
ac51fe98-b5f5-42b1-9d6f-f4f6b10a57ab
zegabr/cp
math/catalan.h
#include "discrete.h" namespace Catalan { //========CATALAN NUMBERS========= /* -numero de Dyck words de tamanho 2n (strings com n X's e n Y's tal que nenhum prefixo tem mais X's do que Y's) -fazendo X==>'(' e Y==>')', catalan(n) é o numero de expressoes de parenteses válidas (com n pares de pare...
ALGO
0.998642
4.008849
{ "github_metadata": { "branch": "master", "commit_count": 539, "repo_created_at": "2018-03-29T16:16: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": "901d8b75...
54cb90c1-6037-4bbd-8708-4a96a0048d6a
nampham041297/Rep2022CPSLD_05CE
Lesson 15/shellsort.cpp
// thuật toán sắp xếp shell sort void shellSort(arr[]) { // arr: mảng đầu vào interval = 1; // khoảng cách giữa 2 phần tử bắt đầu từ 1 while(interval < arr.length/3) { // tìm khoảng cách lớn nhất giữa hai phần tử interval = interval * 3 + 1; // thỏa mãn } while (interval > 0) { // thực hiện c...
ALGO
0.999927
3.925784
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2022-02-08T04:21: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": "207f34c403...
ca31f7e1-dd0f-4e25-a89d-a879f67279d5
mZarifa/CSCI-2270
Exam 3/Q1/LinkedList.cpp
#include <iostream> #include "LinkedList.hpp" using namespace std; /* ---------------------------------------- TODO: Complete the method below. You may add helpers, headers (if necessary) Helper functions should not be part of the class. */ void LinkedList::moveEvens() { Node *end = head; Node *c...
ALGO
0.999253
4.919256
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-06-08T00:44: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": "e70ee32af1...
503b29e4-cedf-4a12-ad94-8e0867f398ce
1092772959/My-ACM-code
2018夏/8.22/J.cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; LL MW[1<<5],SW[1<<5]; LL ans = 0; LL x[10]; int main() { #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); #endif int T,N,M,K; scanf("%d",&T); while(T--){ ...
ALGO
0.99991
3.386453
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-10-04T14:43: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": "fde77ced0f...
1c8f576f-3387-49d5-a69f-97350a682a45
TsukiTiger/CHEM_281
HW_1/hw1_skeleton.cpp
#include <chrono> #include <unistd.h> #include <iostream> #include <queue> using namespace std; unsigned long get_current_time_in_secs() { auto now = chrono::steady_clock::now(); auto duration = chrono::duration_cast<chrono::seconds>(now.time_since_epoch()); return duration.count(); } class Dispatcher { ...
ALGO
0.951666
5.818405
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-10-15T05:15: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": "b730f58fa226...
9f83e9aa-938b-468d-8f76-a37e73ced693
errorcodexero/pickaxe
swerve_rotation_control.cpp
//Author: <NAME> *****Unfinished***** Function: Simulates wheel movement given current and target positions (the current units are radians). //Also determines the current wheel rotation given encoder output. #include <iostream> #include <cmath> #include <math.h> #ifndef M_PI//Defines a variable for pi if the variable ...
ALGO
0.999696
4.856442
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2015-06-19T02:39:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ad522010e...
4459fcc1-b63d-4dc1-b5cc-e54e377bec4a
Kaileshwaran13/CodeChef
1400 - 1600 difficulty rating/Dibs on Fibs.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long t = 1; cin >> t; while (t--) { int m, n; cin >> m >> n; long long a[m], b[m]; int maxi = max(2, n); long long fib[maxi]; fib[0] = fib[1] = 0; long long temp = 0; long lo...
ALGO
0.999995
3.939805
{ "github_metadata": { "branch": "main", "commit_count": 1621, "repo_created_at": "2024-10-29T04:25: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": "5fe6066de...
9d1a2de5-6828-4d4a-ad46-45b15a6dec52
PaddlePaddle/Paddle-Lite
lite/kernels/xpu/sequence_softmax_compute.cc
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required...
ALGO
0.976056
6.778597
{ "github_metadata": { "branch": "develop", "commit_count": 7526, "repo_created_at": "2017-09-20T11:41:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7124, "forks": 1620, "issues": 68, "pull_requests": 17 }, "file_meta": { "content_id": ...
306ddf75-43c6-4b34-94e8-8a932574ca38
WhiZTiM/coliru
Archive2/19/c578dfea62acb3/main.cpp
#include <iostream> #include <string> #include <vector> #include <functional> struct Data { int i; Data() : i(0) { std::cout << "Data();" << std::endl; } Data(const Data& data){ std::cout << "Data();" << std::endl; i = data.i; } ~Data() { std::cout << "~Data();" << std::endl; } Data(Data&& data) no...
TOOL
0.989486
5.297157
{ "github_metadata": { "branch": "master", "commit_count": 42630, "repo_created_at": "2016-04-21T16:34:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b48797...
5e4eda5f-ab3d-4479-9818-f22a7b76854a
iprashantkr1/Leetcode
Count even length - GFG/count-even-length.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int modInverse(int A, int M) { int m0 = M; int y = 0, x = 1; if (M == 1) return 0; while (A > 1) { int q = A / M; int ...
ALGO
0.999933
5.911681
{ "github_metadata": { "branch": "main", "commit_count": 753, "repo_created_at": "2022-08-31T18:19:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "813b0ddc80...
1f45738e-0666-4393-9028-922e5f0d76c0
ngminteck/DigipenGAM300GAM350
GAM300AndGAM350/AscendEngine/Engine/Physics/Collision.cpp
/******************************************************************************/ /*! \file Collision.cpp \author \par email: <EMAIL> \par Digipen login: username \date 02/02/2020 \brief Copyright (C) 2020 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the pri...
ALGO
0.995813
5.859175
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-10-07T08:16: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": "4a8b0ca7c7aa...
3e1ec8e4-3c76-4dcb-8316-d6abdc032023
verzhak/pattern_recognition_guide
src/pattern_recognition/supervised/main.cpp
#include "all.hpp" #include "captcha.hpp" #include "classifier.hpp" CClassifier * train(EClassifierType clt, CCaptcha * captcha, unsigned train_vec = 10000, unsigned test_num = 1000); unsigned test(CClassifier * cl, CCaptcha * captcha); int main(const int argc, const char * argv[]) { int ret = 0; unsigned u, v, tv...
ALGO
0.940715
4.654803
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2013-10-17T06:29:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b0b0aef1ab...
a26fbcef-9730-45c2-b4d1-2d0f52fd0122
krishna146/DSASheetAndSolution
15Backtracking/homeWork/5combinationSumII.cpp
// Problem Link - https://leetcode.com/problems/combination-sum-ii/ /* By <NAME> */ #include <iostream> #include <vector> #include<algorithm> using namespace std; void storeCombinationSum(vector<int> &candidates, int target, int index, vector<vector<int>> &ans, vector<int> &temp) { if (target == 0) { an...
ALGO
0.999945
5.675082
{ "github_metadata": { "branch": "master", "commit_count": 277, "repo_created_at": "2022-06-21T09:41: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": "b4bfbe73...
925e9e08-eecf-4ca3-b734-5c737420f61c
bizkut/warz-client
External/NaturalMotion/common/XMD/include/XMD/OrientConstraint.h
//---------------------------------------------------------------------------------------------------------------------- /// \file OrientConstraint.h /// \author <NAME> [http://robthebloke.org] /// \brief Defines a contraint to orient an object with another transform /// \note (C) Copyright 2003-2005 <NAME>. All r...
TOOL
0.900577
6.124343
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-12-20T14:48:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 17, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "26da137d...
54f01d98-6eca-49e8-81ac-7f55a347ed40
ishandutta2007/codeforces-a
antoine/normal/1176/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define DBG(v) cerr << #v << " = " << (v) << endl; int main() { ios::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr); int n; cin >> n; vector<int> a(n); for (int &x :a) cin >> x; { vector<int> ...
ALGO
0.999944
3.807763
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f18374b67e0...
81df0ba8-d56c-47e9-9ca7-a54d07639c98
guiteixeirapimentel/TRIM
src/main.cpp
#include <iostream> #include <vector> #include <fstream> #include "ElevatorFunction.h" #include "ftrim1.h" #include "ftrim2.h" #include "ftrim3.h" #include "ftrim4.h" #include "f1.h" #include "f2.h" #include "f3.h" #include "f4.h" #include "Math/Matriz.h" #include "Math/MathUtils.h" #define _DEBUG int main() { c...
ALGO
0.995592
3.67844
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2019-12-02T18:09: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": "ae08bd346...
615d6ba3-92bc-4bab-9fd4-5a3e6c296f6f
joros244/ProyEKFGEOS3
src/G_AccelHarmonic.cpp
#include "../include/G_AccelHarmonic.h" #include "../include/AccelHarmonic.h" void G_AccelHarmonic(double **r, double **U, int n_max, int m_max, double **G) { double d = 1.0; // Position increment [m] double **dr = new double *[3]; double **a1 = new double *[3]; double **a2 = new double *[3]; double **m1 = ...
ALGO
0.990089
4.032939
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2023-05-18T13:17:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "61afbb198...
c59058ac-0191-410e-a91c-44507a38098f
ArpanMaheshwari144/Stack-Data-Structure
minimum_element_in_stack_with_extra_space.c++
/*Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should return minimum element from the SpecialStack. All these operations of SpecialStack must be O(1). To implement SpecialStack, you should only use standard...
ALGO
0.996658
5.67375
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-09-29T12:22:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02c82ad2a4...
000e0007-f871-4273-a46d-a9cec4eb9391
shahed-shd/Online-Judge-Solutions
UVa-Online-Judge/125 - Numbering Paths.cpp
// Run time: 0.000 sec. #include <cstdio> #include <algorithm> using namespace std; const int MAXN = 30; int main() { //freopen("in", "r", stdin); int street, tc = 0; while(scanf("%d", &street) != EOF) { int u, v, n = 0, mat[MAXN][MAXN] = {0}; while(street--) { scanf("%d %d...
ALGO
0.999566
3.851888
{ "github_metadata": { "branch": "master", "commit_count": 1052, "repo_created_at": "2015-06-11T20:06:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 15, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "73ec0...
f7f2bb53-c8ba-4d90-aec4-f0fb76faeb7d
shskylee/academic-projects
mpi_mc_1d.cpp
// parallel monte carlo simulation for SIS model on 1D modular networks #include<iostream> #include<vector> #include<string> #include<cmath> #include<cstdlib> #include<numeric> #include<time.h> #include<fstream> #include<ctime> #include<queue> #include<iomanip> #include<algorithm> #include<mpi.h> using namespace std;...
ALGO
0.999655
4.999567
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2016-01-26T16:26: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": "6bbd02930...
93369ddf-f847-46f6-8986-03b786c8c34f
GaurangJotwani/LeetcodeForAll
0323-number-of-connected-components-in-an-undirected-graph/0323-number-of-connected-components-in-an-undirected-graph.cpp
class DSU { public: int comps; vector<int> parents; vector<int> ranks; DSU(int n) { comps = n; parents.resize(n); for (int i = 0; i < n; i++) parents[i] = i; ranks.resize(n, 1); } int find(int i) { if (parents[i] == i) return i; return parents[i] = find(pa...
ALGO
0.99996
6.354843
{ "github_metadata": { "branch": "main", "commit_count": 2867, "repo_created_at": "2023-08-08T19:48: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": "dbec9e6cf...
4fe616d7-48d1-46c6-8527-b9f618129bd2
whk-2005/Luogu
P4878-【USACO05DEC】布局/Main.cpp
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; template <...
ALGO
0.999969
3.496302
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-11-25T11: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": "a63f3063b...
2da7f154-4dca-40a5-a519-4550a4c154ca
allan7yin/DataStructures-Algorithms
src/archive/DailyLeetcode/April/April23.cc
#include <queue> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; class Solution { public: vector<int> findMinHeightTrees(int n, vector<vector<int>> &edges) { if (n == 1) { return {0}; } vector<int> result; vector<int> deg(n, 0); // degree vector<vect...
ALGO
0.99999
6.167571
{ "github_metadata": { "branch": "main", "commit_count": 306, "repo_created_at": "2023-12-22T16:25:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f4235bf46...
5d545311-24fa-45d7-85a1-298298f5133f
GrainRainy/Code-Repositories
[Top] Storage/Contests/2023.05.05 洛谷 模拟赛/Hnw. AT_arc057_b-高橋君ゲーム.cpp
#include <bits/stdc++.h> #define __DEBUG__ print(); using namespace std; using LL = long long; using PII = pair<int, int>; template <typename T> inline void input(T &x) { x = 0; char c = getchar(); bool f = false; for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 1...
ALGO
0.999915
3.58304
{ "github_metadata": { "branch": "main", "commit_count": 179, "repo_created_at": "2023-07-13T12:33: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": "30c4fe1e88...
d53fdf0c-59b4-4c1e-a620-bf5be57cd2a0
hskramer/CPlus
ProgramPP/Chapter17/Problem11/Problem11/list_gods.cpp
#include "link_list.h" Link* Link::insert(Link* n) { if (n == nullptr) return this; if (this == nullptr) return n; n->succ = this; // remember "this"->prev if (prev) prev->succ = n; n->prev = prev; prev = n; return n; } Link* Link::add(Link* n) { if (n == nullptr) return this; if (this == nullptr) retu...
ALGO
0.991809
4.128113
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2018-05-06T22: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": "02619abfa...
969806bf-1d13-45fc-9fb4-9d7b20f7adc1
BhaskarBVV/PenCode
Binary Tree/Reverse Level Order Traversal.cpp
// Input : // 1 // / \ // 3 2 // Output: 3 2 1 // Explanation: // Traversing level 1 : 3 2 // Traversing level 0 : 1 //<NAME> #include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nul...
ALGO
0.999993
4.737962
{ "github_metadata": { "branch": "main", "commit_count": 615, "repo_created_at": "2021-09-03T14:47:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f56f5123e2...
42011c6b-7fff-4dcd-9d64-fce2df3726ef
galletas1712/programming.in.th
00/0033.cpp
#include <stdio.h> #include <iostream> #include <vector> #include <algorithm> #define FORA(i, a) for(int i = 0; i < a; i++) #define FORI(i, a, b, c) for(int i = a; i < b; i += c) #define FOR(i, a, b) for(int i = a; i < b; i++) using namespace std; int main(){ std::ios_base::sync_with_stdio(false); int n; cin >> n;...
ALGO
0.999988
3.618554
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2016-02-02T09:28:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "761a62256...
b0413fd2-6d2d-4978-a063-ea74360a6b96
RezerdPrime/Random-Shrain
C++Shit/Priority_queue.cpp
#include <iostream> using namespace std; int RDVALUE_ = 1; #define RAND RD() int RD(void) { int A; RDVALUE_ = (RDVALUE_ + (int)(&A)) * 1103515245 + 12345; return RDVALUE_ / 31; } struct PQ_el { void* data; int priority; }; struct Priority_Queue { PQ_el* elements; int capacity; int s...
ALGO
0.999864
3.682863
{ "github_metadata": { "branch": "main", "commit_count": 185, "repo_created_at": "2022-06-27T06:42:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "798f6f1476...
702e4dc2-8455-4f8d-8021-21157e0cfffd
edamame8888/edamame-s_ABC
100-109/104/C/C-2.cpp
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() using namespace std; int main(){ int D,G; cin >> D >> G; int p[D], c[D]; rep(i,D) cin >> p[i] >> c[i]; //compleat pattern int ans = 10000; bool ...
ALGO
0.999562
3.463179
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-07-26T11: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": "78855cc9e...
73c1e091-46c9-4ca3-9a91-914acf3f6161
PravarAnu/Pre-Placement-Program-Ineuron
DSA/Linked List/Assignment 14/Question05.cpp
#include <iostream> using namespace std; class ListNode { public: int val; ListNode *next; ListNode() : val(0), next(NULL) {} ListNode(int x) : val(x) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; ListNode *oddEvenList(ListNode *head) { if (head == NULL || head->next == NULL)...
ALGO
0.999917
5.53764
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2023-05-25T12:17:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76f3e4619...
3585c402-7592-43e5-9bd2-2cefd002cdf8
ThapaVinay/LeetCode
0065-valid-number/0065-valid-number.cpp
class Solution { public: bool isNumber(string s) { int i = 0; int n = s.size(); // checking the sign if(s[i] == '+' || s[i] == '-') i++; if(i == n) return false; bool numbers = false; // checking for numbers ...
ALGO
0.998195
5.060707
{ "github_metadata": { "branch": "master", "commit_count": 1137, "repo_created_at": "2022-11-23T17:21: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": "a357f18...
ef65fed0-cb8f-4288-90da-9382d8854780
Ichigo27/lovebabbar-dsa-sheet
String/88_Isomorphic_Strings.cpp
// 88 Check if two given strings are isomorphic to each other // Given two strings 'str1' and 'str2', check if these two strings are isomorphic to each other. // Two strings str1 and str2 are called isomorphic if there is a one to one mapping possible for every character of str1 to every character of str2 while preser...
ALGO
0.999992
5.725428
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2022-12-14T08:39: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": "70c83ff32f3...
bc027dfc-03e1-403e-9577-682e9c70dd8a
SongHayoung/LeetCode
2732-find-a-good-subset-of-the-matrix/2732-find-a-good-subset-of-the-matrix.cpp
class Solution { bool bit(int x, int n) { return (x>>n) & 1; } bool ok(vector<int>& A, int ma) { return *max_element(begin(A), end(A)) <= ma; } bool helper(vector<pair<int,int>>& A, int pos, vector<int>& now, vector<int>& res) { if(res.size() and ok(now, res.size() / 2)) { ...
ALGO
0.999908
5.505833
{ "github_metadata": { "branch": "master", "commit_count": 13354, "repo_created_at": "2021-01-06T12:46:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3c4a8...
41235568-3f57-47a9-b51a-39abbc9a4cae
ozzing/boj
ALGO 가자 (스터디)/18주차/1504_특정한 최단 경로.cpp
#include <iostream> #include <queue> #include <functional> #include <cstring> using namespace std; #define MAX 805 #define INF 0xffffff int n, e, a, b, c, v1, v2; vector<pair<int,int>> node[MAX]; unsigned long long dist[MAX]; void solve(int start){ for (int i=0;i<=n;i++) dist[i] = INF; priority_queue<pair<int...
ALGO
0.999878
4.375391
{ "github_metadata": { "branch": "main", "commit_count": 153, "repo_created_at": "2021-12-10T07:58:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2878e9d405...
6aeab269-997f-4a3d-9304-d864f32f6415
useredsa/ICPCtrainning
codeforces/1239/d/d.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; using vii = vector<ii>; const int INF = 1e9+7; const ll MOD = 1e9+7; const int MAXN = 2000006; // Read :40 // Think :43 // Code :29 (6 minutes rest) int t, n, m, used[MAXN]; vi g[MAXN], gr[MAXN], ...
ALGO
0.999973
4.359583
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-12-02T12:56: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": "c953906b7...
a4304f59-a29e-4346-838a-0415e2827b14
alexandraback/datacollection
solutions_5644738749267968_1/C++/austrin/D.cc
#include <cassert> #include <cctype> #include <cmath> #include <cstdarg> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> using namespace std; bool debug = false; typedef long long ll; typedef pair<int, int> pii; typedef ve...
ALGO
0.999904
3.715261
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7abea2687...
20731845-7b5b-4c26-bdb2-55b8bb523625
RaduPelin/Tic-Tac-Toe
TicTacToe.ino
#include <SoftwareSerial.h> char gameboard[]={' ',' ',' ',' ',' ',' ',' ',' ',' '}; void setup() { Serial.begin(9600); } void loop() { Serial.println("Tic Tac Toe"); Serial.println("Let's play"); delay(500); Serial.println("This is the gameboard:"); delay(500); Serial.println("_________ _________ ____...
ALGO
0.98817
4.340673
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2017-03-13T20:20: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": "c1ccac5c3e...
40e88f89-d0d5-490d-a4e1-076c9b901cd8
jihyehann/PS
baekjoon/15684/15684.cpp
#include <iostream> #include <cstring> using namespace std; int hori[40][20]; //세로 높이, 세로선 int n, m, h; //세로선, 가로선, 높이 int ans = 100, maxCnt; bool check() { for(int i=1; i<=n; i++) { int x = 1, y = i; while(1) { if(x > h) break; if (hori[x][y] == 1) y++; else if (...
ALGO
0.999952
3.589431
{ "github_metadata": { "branch": "main", "commit_count": 159, "repo_created_at": "2021-08-01T07:17: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": "0c737f59de...
16988ed0-892c-4234-978f-0063f12a9259
martong/nng_competition_2015
containers/skip_matched/main.cpp
#include <cassert> #include <iostream> #include <fstream> #include <string> #include <vector> #define ASSERT(CONDITION) \ do \ if (!(CONDITION)) { ...
ALGO
0.999939
5.451365
{ "github_metadata": { "branch": "master", "commit_count": 215, "repo_created_at": "2015-10-29T18:57: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": "e4670c69...
0e397eb4-bb2c-447c-9563-5b36797bad35
AlanBui1/Competitive-Programming-Solutions
dmopc17c5p3.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long ll n; ll m; ll factor; ll GCD(ll a, ll b) {return (b == 0 ? a : GCD(b,a%b));} int main() { cin.sync_with_stdio(0); cin.tie(0); cin >> n; cin >> m; factor=m; n--; while (n--){ cin >> m; factor = GCD(factor, m); ...
ALGO
0.999988
3.677525
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-07-01T14:33: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": "fde5c5e31a59...
6d0866a7-4566-42d2-96b8-c19c288fd056
AkLegend26/Projects
C++/Project9/TrieNode.cpp
// File name: TrieNode.cpp // Author: <NAME> // userid: pathaa3 // Email: <EMAIL> // Class: CS2201 // Assignment Number: PA 9 // Honor Statement: "I have been abided by Vanderbilt honor code in completion of this assignment" // Description: This file implements the TrieNode class used to build the functions of Trie cl...
ALGO
0.918712
3.762649
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-08-30T21:01: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": "2439c7473d2...
a6067f86-c837-4f63-b303-02793b3cf34e
Chengganghu/LeetCode
AddTwoNumbers.cpp
// // Created by ChenggangHu on 17/12/8. // /* * You are given two non-empty linked lists representing two non-negative integers. * The digits are stored in reverse order and each of their nodes contain a single digit. * Add the two numbers and return it as a linked list. * You may assume the two numbers do not con...
ALGO
0.999141
6.226954
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2017-12-08T03:40: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": "a5a175cd3...
74ac986d-c989-493c-b3a8-ac7c50867d84
3000ye/ACMCode
LeetCode/438.找到字符串中所有字母异位词.cpp
#include <bits/stdc++.h> #include <vector> using namespace std; /* * @lc app=leetcode.cn id=438 lang=cpp * * [438] 找到字符串中所有字母异位词 */ // @castor solve=start // 滑动窗口,维护一个数组来存储每个字母的个数,每次滑动都和目标进行对比 // @castor solve=end // @lc code=start class Solution { public: vector<int> findAnagrams(string s, string p) { ...
ALGO
0.999964
6.683841
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2024-05-26T09:24: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": "de2a0658f6a...
a9d6f129-0da5-48c2-bf2a-43e96d8d0e1c
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/allpro_train/0_0_9458.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; if (4 * n * m - 2 * n - 2 * m < k) { cout << "NO" << endl; } else { cout << "YES" << endl; vector<pair<int, string>> steps; int moves = 0; while (k > 0) { ...
ALGO
0.999975
3.770613
{ "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": "aa569afe6fe...
17ce1c16-e82e-4ce9-a8fb-94c0cf49b3e5
alekseyzimin/PacBio
src_psa/psa.hpp
/****************************************** Copyright University of Maryland 2015 ******************************************/ #ifndef __PSA_H__ #define __PSA_H__ #include <memory> #include <thread> #include <boost/asio/coroutine.hpp> #include <boost/asio/yield.hpp> #include "compact_index.hpp" #include "48bit_index.h...
ALGO
0.992646
6.234684
{ "github_metadata": { "branch": "master", "commit_count": 1364, "repo_created_at": "2018-01-13T17:20:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "298dfea...
7ed64436-2d94-4860-8238-451b8912e386
tranquoctrung257/dev
C++ 28tech T7_2024/Day 4/1.Buoi_Chinh.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = double; // vong l while //while([điều kiện lặp true]){ // // các câu lệnh của vòng lặp //} //int main(){ // int x = 1; // while(x<4){ // cout << x << endl; // x++; // } // cout << x << endl; // //} //n = 5442324323423 //1.đếm n có...
ALGO
0.997611
3.262828
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2024-06-11T00: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": "7fffc9d2067...
b93d7a3d-df74-4e8d-8c1d-82123be80960
inglada/OTB
Utilities/ITK/Code/BasicFilters/itkVotingBinaryIterativeHoleFillingImageFilter.txx
/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkVotingBinaryIterativeHoleFillingImageFilter.txx,v $ Language: C++ Date: $Date: 2008-10-17 20:50:03 $ Version: $Revision: 1.7 $ Copyright (c) In...
ALGO
0.993327
5.23976
{ "github_metadata": { "branch": "master", "commit_count": 10982, "repo_created_at": "2011-07-01T06:29:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d16a25...
fa27e0aa-09b9-442b-bcf2-3dc619f6eef2
chmnchiang/bcw_codebook
Contest/XVIIOpenCupEurope/L.cpp
#pragma GCC optimize ("O2") #include<bits/stdc++.h> #include<unistd.h> using namespace std; #define FZ(n) memset((n),0,sizeof(n)) #define FMO(n) memset((n),-1,sizeof(n)) #define F first #define S second #define PB push_back #define ALL(x) begin(x),end(x) #define SZ(x) ((int)(x).size()) #define IOS ios_base::sync_with_s...
ALGO
0.999005
3.648833
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2014-06-03T11:38:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 111, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee28d...
a7971871-8bf5-4088-8a28-411daf7f6c21
abhirams2020/Leetcode-Tracker
19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* removeNthFr...
ALGO
0.99998
5.893646
{ "github_metadata": { "branch": "main", "commit_count": 1634, "repo_created_at": "2022-03-15T18:11: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": "7a7727533...
0e9f878d-1c97-4d26-a747-54e74625ee8a
abhishek18124/PPCPPJune2023
Lecture 42/007DP_WildcardMatching.cpp
/* https://leetcode.com/problems/wildcard-matching/ */ class Solution { public: // bool helper(const string& s, const string& p, int m, int n, int i, int j) { // // base case // if (i == m) { // bool flag = true; // assume p[j...n-1] contains only stars // for (int...
ALGO
0.999976
5.655234
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2023-07-15T07:39:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9021cfcf65d...
670214d5-8cdf-4673-bf20-17717913cc58
ishandutta2007/codeforces-k
krijgertje/normal/889/E.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <cstring> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <list> #include <cassert> #include <ctime> #include...
ALGO
0.999823
3.304833
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29165b2236f5...
d8bf54d2-6693-435b-a04b-a6ea779e3153
lucasgarcia2297/AED
Ejercicios de la Guía/Guía 03 - Árboles/Contar_Nodos y Contar_Hojas (AOO).cpp
#include <iostream> #include <tree.hpp> #include <lisp.hpp> #include <graphviz.hpp> #include <make_random.hpp> using namespace aed; using namespace std; //FUNCION AUXILIAR int contar_nodos(tree<int> &T, tree<int>::iterator nodo){ if(nodo == T.end()) return 0; tree<int>::iterator hijo_izq = nodo.lchild(); int c = 1;...
ALGO
0.998331
4.011459
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-16T15:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa1e421a0cf2...
8151aa40-3e15-4db1-bc9d-0786657c62f6
Mohamed-Saeed-Hussein/Competitive-Programming
combinatorics.cpp
int64_t mod = 1e9 + 7; vector<int64_t> fac, inv, finv; int64_t nCr(int64_t x, int64_t y) { if (x < 0 or y > x or y < 0) return 0; return (fac[x] * finv[y] % mod * finv[x - y] % mod); } int64_t nPr(int64_t x, int64_t y) { if (x < 0 or y > x or y < 0) return 0; return fac[x] * finv[x -...
ALGO
0.999934
4.266937
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2025-06-19T03: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": "62f7159f56a...
cc2cb1c8-4dfa-4615-895b-74e018b3209f
manav-agarwal1/CSES-Problem-Set
graph/giantPizza.cpp
#include <bits/stdc++.h> using namespace std; /** * @brief 2 SAT * 2 Satisfiability * If we want to enforce something to be true we add (p or p) equivalent to ~p->p in graph. * * 1) get all the strongly connected components of the graph * 2) check for all pi is ~pi is there in same SCC * 3) rev top order * ...
ALGO
0.999989
4.539244
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-09-21T19:51: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": "e0e79e0f0327...
03f120dc-fdc2-425a-aa15-d87f9c52ab12
Tanya19Singh/-CrackYourPlacement
reverseLLinkgroup.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <bits/stdc++.h> using namespace std; struct ListNode{ public: int data; ListNode* next; ListNode(int i) { data=i; next=NULL; } }; ListNode* reverse(ListNode* head,int k) { ListNode *prev=NULL,*fr; ...
ALGO
0.999991
4.33092
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-07-19T08:33:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c7451b33f...
c528af01-58e1-460f-9401-6c882ec6e025
Rearcher/OJcodes
codeforces/1010A.cpp
#include <bits/stdc++.h> using namespace std; int main() { // freopen("input", "r", stdin); int n, m; cin >> n >> m; vector<int> a(n), b(n); bool flag = false; for (int i = 0; i < n; ++i) { cin >> a[i]; if (a[i] == 1) flag = true; } for (int i = 0; i < n; ++i) { ...
ALGO
0.999978
3.209881
{ "github_metadata": { "branch": "master", "commit_count": 944, "repo_created_at": "2015-06-04T12:43:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be571912...
0ba60cbe-ab06-4c33-a578-0da5dcb84a9e
kisgyorgyzoltan/Graphs
L3/L03_kzim2149_1.cpp
// <NAME>, 512 #include <iostream> #include <fstream> using namespace std; class Graf { int n; int m; int** szmatrix; public: Graf(); Graf(const Graf&); Graf(int dbsor, int dbel, int **szomszedsagi_matrix); Graf(const char* filenev); void Feladat(); int koltseg(); }; Graf::Graf() ...
ALGO
0.999917
3.251531
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-14T13:54: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": "19c793b92aa5...
0c1550f6-6690-417b-a29f-436a5195566a
sknrk/75-Problem-Solution
1-12-Linked_List_Cycle.cpp
// Given head, the head of a linked list, determine if the linked list has a cycle in it. // There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is conn...
ALGO
0.999909
5.610285
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-06-07T22:11: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": "fa87a1a37cd...
73e81f5f-b36d-4412-acd9-0ca20df46c23
SufyaanKhateeb/DSA-problems
lec9 (array) and lec10/reversearray.cpp
#include <iostream> using namespace std; void reversearr(int arr[], int size) { int s = 0; int e = size - 1; while (s < e) { int temp = arr[s]; arr[s] = arr[e]; arr[e] = temp; s++; e--; } // for (int i = 0; i < (size) / 2; i++) // { // int temp =...
ALGO
0.999026
5.088809
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-02-22T09:17:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f7f09b2637...
5a6d0aa4-f66c-452e-9244-59ad0baa8c0f
suraj-iitb/algorithm-identification
BERT/Data_Dump/Merge/C++/Code/merge2708496.cpp
#include <iostream> #define INF 1000000005; using namespace std; int merge(long long int*, int, int, int); int mergeSort(long long int*, int, int); int main(){ int n; cin >> n; long long int a[n]; for(int i=0; i<n; i++) cin >> a[i]; int ans; ans = mergeSort(a, 0, n); for(int i=0; i<n; i++){ cout << ...
ALGO
0.999996
4.249769
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2020-05-24T06:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 10 }, "file_meta": { "content_id": "ba2b1dd90...
a8a15451-39ec-4331-9fec-0b4c770ecb71
timprepscius/GeometricTools
WildMagic5/SampleMathematics/NonlocalBlowup/NonlocalSolver2.cpp
// Geometric Tools, LLC // Copyright (c) 1998-2013 // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // // File Version: 5.3.1 (2012/07/07) #include "NonlocalSolver2.h" #include "FpuSupport.h" const GLch...
ALGO
0.999878
5.796714
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2013-04-04T19:48:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 35, "forks": 14, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "749f6a3e...
9e9a8750-7b84-4034-ba48-6482933bdf86
rogers140/leetcode-oj
Recover Binary Search Tree/Solution.cpp
#include <stdio.h> #include <iostream> #include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x): val(x), left(NULL), right(NULL) {} }; //morris traversal class Solution { public: void recoverTree(TreeNode *root) { if(root == NULL) { ret...
ALGO
1
5.532155
{ "github_metadata": { "branch": "master", "commit_count": 136, "repo_created_at": "2014-01-27T02:58: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": "5604b224...
f1612e20-ec88-4a79-9727-4bf16ff623a5
Pragnesh2208/LeetCode-Solution
Binary Tree/#1382 Balance a Binary Search Tree.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.999994
6.312086
{ "github_metadata": { "branch": "main", "commit_count": 572, "repo_created_at": "2021-08-25T12:49:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6da5bc36c...
db719b8d-f8d1-4941-8de9-26ac66f0b592
doomSDey/NDNSim
grid2.cc
// ndn-grid-topo-plugin.cpp #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/ndnSIM-module.h" #include "ns3/netanim-module.h" namespace ns3 { int main(int argc, char* argv[]) { CommandLine cmd; cmd.Parse(argc, argv); AnnotatedTopologyReader topologyReader("", 25); topologyReader.S...
TOOL
0.975033
5.724333
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-09-28T14:54:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd727faf3a...
472469c8-8b58-4503-94b2-1eeed97edf26
Yush1nk1m/Problem-Solving
BOJ/Random/14567_TopoSort.cpp
/** * @file 14567_TopoSort.cpp * @brief 00:15:53 * @date 2024-08-23 * * @copyright Copyright (c) 2024 * */ #include <bits/stdc++.h> using namespace std; int N, M, sem = 1; vector<vector<int>> graph; vector<int> indegree; vector<int> semester; queue<int> q; int main(int argc, char* argv[]) { ios_base::syn...
ALGO
0.999999
5.284519
{ "github_metadata": { "branch": "main", "commit_count": 461, "repo_created_at": "2023-02-16T17:54: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": "57ee98d5da...
d6a14b01-85e5-420b-88a1-36409da59281
Badal-Jha/Datastructure-Algorithms
Binary Trees/tree.cpp
#include<iostream> #include<queue> using namespace std; struct Node{ int key; Node *left,*right; Node(int x) { key=x; left=right=NULL; } }; //Node *root=NULL; Node *creatTree(Node *root) { queue<Node*>q; printf("ENter root data :")...
ALGO
0.999887
3.937729
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-11-21T13:11: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": "9a9cf259a...
0e176916-229c-40e6-9206-f3d5069ef56e
chuncl/solution-for-book-cracking-the-coding-interview
9.11ParentheseBoolExpression.cpp
// given an expression with 1, 0, |, &, ^, given a bool result, find number of the ways of parenthesising the epression such that the epression will be evaluate to the result #include <iostream> #include <string> #include <unordered_map> #include <cassert> using namespace std; /* 1. treat each operator as the first o...
ALGO
0.999989
5.178272
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2016-12-06T05: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": "0e1372580...
f36ccb05-5e01-4fa0-a70c-260961f031fb
Eddiebadeddie/TicTacToeMinMax
aBoard.cpp
#include "aBoard.h" //Constructor aBoard::aBoard(){ size = 3; //Creates a 3x3 matrix and initializes the cells to -1 board = new int*[size]; for(int i = 0; i < size; ++i){ board[i] = new int[size]; for(int j = 0; j < size; ++j){ board[i][j] = -1; } } cout<<"Board has been created"<<endl; } //Copy Cons...
ALGO
0.977024
3.56344
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-02-28T00:58: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": "7b0a6a50bc...
66ee64c1-c4e9-4054-bc2b-a6361fbbf664
czhang54/Optimization
src/Prior.cpp
#include <iostream> #include <random> #include <Eigen/Dense> #include "Prior.h" // using namespace std; namespace optimization{ using namespace Eigen; /* Gaussian definitions */ MatrixXd Gaussian::sample_IC(const int num_particles, std::default_random_engine &generator) { std::cout << "Generating Gaussian...
ALGO
0.999613
5.028819
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2017-02-03T04:26:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "31705f04b...
8a5d6449-5eb6-450d-9748-cc8d8efa0324
tushargarg2000/CodingBlocks-March22
sudoku.cpp
//Solve Sudoku #include<iostream> #include<bits/stdc++.h> using namespace std; bool isValidToKeep(int digit,int i,int j,vector<vector<int> > matrix){ //Check for that row for(int k=0;k<9;k++){ if(arr[i][k]==digit){ return false; } } //Check for a particular Column for(int k=0;k<9;k++){ if(arr[k][j]...
ALGO
0.999694
5.254502
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-03-12T12:48:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3033973f3640...
27e3ab13-991b-4ccd-94e8-cf24155a5bb8
yanlinlin82/leetcode
00240_search-a-2d-matrix-ii/200531-1.cpp
// https://leetcode-cn.com/problems/search-a-2d-matrix-ii/ #include <iostream> #include <vector> using namespace std; class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int n = matrix.size(); if (n <= 0) return false; int m = matrix[0].size(); if (m <= 0) return false; return ...
ALGO
0.999922
5.637787
{ "github_metadata": { "branch": "master", "commit_count": 336, "repo_created_at": "2019-09-30T13:21:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ccb335...
6393a2af-0af8-44ea-8413-325259093c27
shilx544/leetcode
链表/23. 合并K个升序链表.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: // 两两合并法 ListNode...
ALGO
0.999938
6.338738
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2020-06-09T12:34: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": "e6f1e373...
0239934b-8c18-4ba7-a0c9-5cd984f10da9
SaifHaiderMalik/OOP
Labs/Saif/Lab2/task4.cpp
#include <iostream> #include <math.h> #include <conio.h> using namespace std; double distance (int _x1,int _x2,int _y1,int _y2); double radius(int _X1, int _Y1, int _X2, int _Y2); double circumference(double radius); double area(double radius); int main(void){ int x1,x2,y1,y2; double _dis,_diameter,_circumfe...
ALGO
0.968188
3.768749
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-01-28T14:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04c8317df...
77f380a0-c9d2-4cab-befc-e1b7e6cb0d7d
samad-yar-khan/dsa-problemset
Trees/trees2.cpp
#include<iostream> #include <queue> #include "TreeNode.h" using namespace std; //bfs input //this is levelwise input TreeNode<int> * input(){ int data = 0 ; cout<<"Enter data \n"; cin>>data; TreeNode<int>* root = new TreeNode<int>(data); queue<TreeNode<int> *> nodeQueue; nodeQueue.push(root)...
ALGO
0.999567
4.276338
{ "github_metadata": { "branch": "master", "commit_count": 429, "repo_created_at": "2021-04-23T13:05:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "496b7378...
33cb3195-643a-4930-871e-06fbc339c089
noisg/noi-2024-final
attachment/stub.cpp
#include "toxic.h" #include <vector> #include <stdio.h> #include <algorithm> using namespace std; constexpr int maxn {1000}; constexpr int maxk {1000}; constexpr int maxq {2000}; int n; char ans[maxn + 5]; int queries=0; bool answered=false; void WA(const char* s) { printf("%s\n", s); fflush(stdout); exit(0); } ...
ALGO
0.999557
3.664793
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-20T02:17:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbc05440f258c...
55402f20-7963-44a2-9efc-3a678e68a642
kangkyunghyun/baekjoon-online-judge
code/02900~02999/2980.cpp
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0)->sync_with_stdio(0); int n, l; cin >> n >> l; vector<pair<int, pair<int, int>>> v(n); for (int i = 0; i < n; i++) { int d, r, g; cin >> d >> r >> g; v[i].first = d; v[i].se...
ALGO
0.999854
3.945735
{ "github_metadata": { "branch": "master", "commit_count": 1223, "repo_created_at": "2022-09-01T13:47: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": "dbe0623...
89a87874-1a45-4500-b2b1-b37536196ea1
ebastidasp/Exercises-Of-Book-Competitive-Programming-3
C++ STL Algorithm/uva10258.cpp
#include <bits/stdc++.h> using namespace std; void split(const string &s, char delim, vector<string> &elems) { stringstream ss(s); string item; while (getline(ss, item, delim)) { elems.push_back(item); } } vector<string> split(const string &s, char delim) { vector<string> elems; split(s, delim, elems...
ALGO
0.999157
3.407622
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2023-01-23T19:05: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": "c4cc726ce...
76044c2b-411e-4696-9cd4-ae1c4c4a18d5
daniel-elesbao/POO2025Q2
C++/126. AbaixoDaMedia/AbaixoDaMedia.cpp
#include <iostream> int abaixoDaMedia(float notas[][3], int N) { float soma1 = 0, soma2 = 0, soma3 = 0; int abaixo1 = 0, abaixo2 = 0, abaixo3 = 0; for (int i = 0; i < N; i++) { soma1 += notas[i][0]; soma2 += notas[i][1]; soma3 += notas[i][2]; } float media1 = soma1 / N, m...
ALGO
0.998719
4.421825
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2025-07-11T23: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": "5160de66dd5...
a0230fac-0bf8-45bb-bd73-e12e826971d4
m2osw/advgetopt
advgetopt/options.h
// Copyright (c) 2006-2025 Made to Order Software Corp. All Rights Reserved // // https://snapwebsites.org/project/advgetopt // <EMAIL> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; ei...
TOOL
0.940861
6.545089
{ "github_metadata": { "branch": "main", "commit_count": 298, "repo_created_at": "2017-10-15T04:27:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a377aed7d8...
b0c1b3f0-4e63-454d-9c86-8797208a75cd
KagonKhan/SpaceRanger
Thesis/Helpers.h
#pragma once #include <filesystem> class Spline; class Helpers { private: Helpers() = delete; Helpers(const Helpers&) = delete; Helpers& operator= (const Helpers&) = delete; public: ////// /// Initializes the window, uses values provided in a string /// if the string not provided, inits 1024x768 window /////...
TOOL
0.96539
5.607687
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2021-07-08T15:17: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": "33a982012...
e61d4833-be69-48f2-ada9-2495e3534744
phrock/acm
topcoder/sources/DeckRearranging.cpp
#include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstr...
ALGO
0.999801
4.269468
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2011-05-15T15:22:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e629de08...
f483268b-11e2-4954-a862-dbae1e168968
ishandutta2007/codeforces-r
redant/normal/1552/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define FOR(i,a,b) for(int _n(b),i(a);i<_n;i++) #define REP(i,n) FOR(i,0,n) void setIO() { ios_base::sync_with_stdio(0); cin.tie(0); } const LL mod = 998244353; const int MX = 200005; int x[MX], y[MX], s[MX]; LL t[MX], tsum[MX]; int n; i...
ALGO
0.999919
5.119827
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccb8df1666bf...
415172b9-67a4-4c0e-a86b-e2cc0b2f6923
aditya292002/SDESheet
Binary Tree/Preorder_Traversal.cpp
#include<bits/stdc++.h> using namespace std; #define vi vector<int> #define vvi vector<vector<int>> #define vvvi vector<vector<vector<int>>> #define vs vector<string> #define vvs vector<vs> #define pb push_back #define ppb pop_back #define pii pair<int,int> #define ff first #define ss second #define debug(a) cout<<#a<...
ALGO
0.999992
4.727375
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2022-05-02T14:58:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b64c47fed33...
1502524f-44d7-41d4-8fbe-861e13197de6
NandanaRaol/DataStructures
expression_evaluation.cpp
#include<bits/stdc++.h> using namespace std; int prio(char c) { if(c=='*' || c=='/') { return 2; } else if(c=='+' || c=='-') { return 1; } else { return -1; } } string infixtopostfix(string s) { string res=""; stack<char> st; for(int i=0;i<s.size()...
ALGO
0.999955
3.94706
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2023-08-12T12:04: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": "447a2252175...
057691e8-bda0-4cef-9d1b-d942684e4dc8
memo735/e-olymp
2000-2999/2523 - Fibonacci Strings - Строки Фибоначчи - Fibonaççi sətirləri - Рядки Фібоначчі.cpp
#include <iostream> using namespace std; #define MAX 41 int n, m, l, fib[MAX] = { 0, 1 }; string solve(int n, int Left, int Right) { if (n == 1) return "b"; if (n == 2) return "a"; if (Right <= fib[n - 1]) return solve(n - 1, Left, Right); if (Left > fib[n - 1]) return solve(n - 2, Left - fib[n - 1], Right - fi...
ALGO
0.999504
3.133898
{ "github_metadata": { "branch": "master", "commit_count": 4186, "repo_created_at": "2015-06-14T13:00:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 112, "forks": 70, "issues": 1, "pull_requests": 4 }, "file_meta": { "content_id": "f4bf...
a4255a5b-bdf8-4bda-8751-7363cd5fb679
facebookresearch/faiss
faiss/IndexNSG.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // -*- c++ -*- #pragma once #include <vector> #include <faiss/IndexFlat.h> #include <faiss/IndexNNDescent.h> #include <faiss/I...
ALGO
0.995636
7.086356
{ "github_metadata": { "branch": "main", "commit_count": 1500, "repo_created_at": "2017-02-07T16:07:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36174, "forks": 3965, "issues": 228, "pull_requests": 47 }, "file_meta": { "content_id": "...
cf1c7e9c-2b48-4c7d-b0ed-b589f96b89ae
Openroads/AiSD
kolejka_priorytet_kopiec.cpp
#include <iostream> using namespace std; const int R = 5; int N=R; int rozmiarKolejki = 0; int kopiec[R]={0}; void zatapianie(int i); void wynurzanie(int i ); void insert(int i); int extract(); void wyswietl(); int main(){ //po każdej operacji należy wyświetlić stan kolejki insert(12);insert(15);insert(10);in...
ALGO
0.999811
4.24505
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-01-12T20:15: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": "4c9cd635f1...
efb1c839-17b7-42c8-a1aa-c69cf96b4be2
HamiltonCollege/cs102-spring2021
lectures/strash/lecture26/search.cpp
/** * Illustrate the running time of linear vs. binary search * @file search.cpp * @author <NAME> * @collaborators CS 102-02 * @date April 29, 2021 */ #include <iostream> #include <iomanip> #include <chrono> #include <cstring> #include <vector> using namespace std; long linear_search(const vector<int> & the_in...
ALGO
0.997658
5.944093
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2021-01-25T19:56:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b8f0dfb97c0...
455c0ab5-3fe7-427f-8b9d-3ba49929d562
alexandraback/datacollection
solutions_5670465267826688_1/C++/Cruchoide/main.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class quaternion { public: quaternion(char q = '1', bool neg = false) : neg(neg), c(q) {} ostream& print(ostream& out) const { if(neg) out << "-"; out << c; return out; } quaternion operator*(const quaternion& rhs) c...
ALGO
0.999859
4.099103
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bad1992c0...
cb5ff05f-ea25-443a-b461-1fc00f771a64
jose-dom/bitcoin_forecasting
env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/prim/mat/prob/ordered_logistic_lpmf.hpp
#ifndef STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LPMF_HPP #define STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LPMF_HPP #include <stan/math/prim/mat/fun/value_of.hpp> #include <stan/math/prim/mat/fun/size.hpp> #include <stan/math/prim/mat/meta/vector_seq_view.hpp> #include <stan/math/prim/mat/meta/length_mvt.hpp> #include...
ALGO
0.9995
7.193236
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-01-04T01:45:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 12, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "200f03d3...
ca9ee29a-8d8f-4f96-9e55-55149b09b1dd
cs1102-lab1-09-2019-2/oop1_structure_control_template
ejercicio5.cpp
/* Dado una funcion cuadratica, donde los parametros a, b, y c son leidos por la consola. Calcular las soluciones basado en las siguientes reglas: Leer del usuario a, b, y c separados por espacio: cin>>a>>b>>c; 1.- Si a y b son cero, entonces: No tiene solucion: a==0, b ==0.. 2.- Si a es cero, entonces: Tiene u...
ALGO
0.999474
4.134119
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-08-21T05:11:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3dcb3cb191...
965075f4-131b-44ae-8751-8592a8dd834b
Hanbrown/CS163B
CS 163B/Eulerian.h
#pragma once #ifndef EULERIAN_H #define EULERIAN_H #include <stack> #include <algorithm> template <class GRAPH> class Eulerian { public: typedef typename GRAPH::Vertex Vertex; typedef typename GRAPH::Path Path; struct node { Vertex a; Vertex b; }; typedef typename std::vector<no...
ALGO
0.986101
5.729402
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2022-01-03T21:43: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": "795c31545...
d96d10a6-e222-4166-8935-9cd9b3cc544a
LeoChenL/Miscellaneous
edu/Patterns for Coding Questions/Knapsack Dynamic Programming (DP)/Problem Challenge 1/main (2).cpp
/* Time and Space complexity # The above solution has the time and space complexity of O(N*S), where ‘N’ represents total numbers and ‘S’ is the desired sum. */ using namespace std; #include <iostream> #include <vector> class SubsetSum { public: virtual int countSubsets(const vector<int> &num, int sum) { int ...
ALGO
0.999996
5.891448
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2019-07-09T14:26: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": "28bc504e7...
8f038624-09c7-4342-a0ba-8948ac879319
alaswell/CS253-FA17
PA7/main.cpp
/*! \file main.cpp: main function for CS253 Histogram (HW1) */ #include <Cluster.h> #include <Histogram.h> #include <Porter.h> #include <ColemanLiau.h> #include <iostream> using std::cout; using std::cerr; using std::endl; #include <fstream> using std::ifstream; /// Print the correct usage in case of user syntax error...
TOOL
0.960921
5.200328
{ "github_metadata": { "branch": "master", "commit_count": 172, "repo_created_at": "2017-08-30T05:36: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": "fe5c514e...
96621cb9-d859-4482-b98e-cc3537eff3b6
Fecsio/Esercizi-algoritmi
Lab5/source/utils.cpp
#include <cmath> #include <utility> #include "city.h" #include "utils.h" #include <algorithm> // std::partial_sort_copy double convertRadians(double x) { int deg1 = int(x); double min1 = x - deg1; return PI * (deg1 + 5.0 * min1 / 3.0) / 180.0; } double geoDistance(double dLat1, double dLong1, double dLat2, d...
ALGO
0.999933
5.7975
{ "github_metadata": { "branch": "master", "commit_count": 196, "repo_created_at": "2019-03-06T18:44: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": "4221fddc...
6662b543-d18f-41a2-9916-abb624eb4a0f
bobbaluba/PTG
include/ptg/RidgedMultiFractal.hpp
/** * @file HybridMultiFractal.hpp * @date 12. nov. 2012 * @author <NAME> Helsing */ #ifndef RIDGEDMULTIFRACTAL_HPP #define RIDGEDMULTIFRACTAL_HPP #include <ptg/Continuous2DSignal.hpp> #include <vector> namespace ptg { /** @brief Fractal noise generated using ridged multi fractal as described by * Musgrave *...
ALGO
0.946471
6.489276
{ "github_metadata": { "branch": "master", "commit_count": 202, "repo_created_at": "2012-10-22T09:20:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "cd96a3e...