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 |
|---|---|---|---|---|---|---|---|
49550ffd-40e6-4d50-9536-0e4ffd45322d | GonzaloPereira/CompetitiveProgramming | UVA/541.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[105][105];
int main() {
int n;
while(cin>>n,n>0){
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n ;j ++){
cin >> a[i][j];
}
}
int ir, ic, nr = 0,nc=0;
for(int i = 0 ; i < n ; i++){
int s = 0;
for(int j = 0 ; j < n ;j... | ALGO | 0.999157 | 3.718359 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2019-06-03T22:10:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3013f4f4e74... |
c052f6a0-5994-4906-89aa-33ab38e45dee | BoChenYS/satellite-pose-estimation | pose_refinement/SA-LMPE/ba/openMVG/sfm/pipelines/relative_pose_engine.cpp | // This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2018 <NAME>.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include... | ALGO | 0.995217 | 5.880022 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-07-09T14:39:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 13,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "456eaa6... |
efb17ea5-a35a-4f7f-b35c-4f31576e288e | Fengdalu/acm-icpc | Hdu/5348.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define PII pair<int, int>
#define MP(a, b) make_pair(a, b)
#define AA first
#define BB second
namespace G
{
const int MAXN = 200010, MAXM = 700000 * 2;
int ind[MAXN], in[MAXN], fa[MAXN];
int nt[MAXM], chose[... | ALGO | 0.999955 | 3.553883 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2014-12-24T15:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e85b8198... |
1cccb294-6039-4a68-931d-0e96b9130615 | yongheng1991/multiple_object_tracking_in_RGB-D_camera_network | detection/include/open_ptrack/kfebt/trackers/tcbt.cpp | #include "tcbt.h"
tCBT::tCBT(float dist_adj, float conf_adj)
{
this->dist_adj = dist_adj;
this->conf_adj = conf_adj;
}
void tCBT::init(cv::Mat &image, cv::Rect region){
cbt.init(image, region, true);
ratio = (float)region.height/(float)region.width;
updateModel = false;
state.clear();
stat... | ALGO | 0.990653 | 5.075709 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-01-31T13:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "677d16c829... |
3be1f831-9135-4e77-86ec-4c3ad3c355f3 | Kunal-2417/Leetcode_POTD | 725_Split_Linked_List_in_Parts.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
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:
vector<ListNode *> ... | ALGO | 0.999937 | 4.65799 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-03-16T12:58: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": "a86f3e3f58... |
fa5d75c3-c64c-4aae-a05a-c10f0ebc017b | fguiotte/RTShot | src/Math/Line2D.h | #ifndef _Math_Line2D_H
#define _Math_Line2D_H
#include <math.h>
#include <Math/Vector2.h>
#include <Math/Line.h>
namespace Math
{
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \class Line2D
///
/// \brief Line in 2D.
///
/// \author <NAME>, University... | ALGO | 0.951203 | 5.542406 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2016-01-04T08:29: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": "dbee99fee... |
4afdccb1-2454-4969-9f7e-912db44b2dbb | ishandutta2007/codeforces-i | isaf27/normal/1092/C.cpp | /*
Author: isaf27 (<NAME>)
*/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
//permanent constants
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, ... | ALGO | 0.99941 | 3.647209 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15a1f0c4bbca... |
dba43208-7454-4b85-a59e-571d20904602 | mtortora/chiralDFT | src/BHierarchy.cpp | // ===================================================================
/**
* Bounding volume hierarchy class.
*/
// ===================================================================
/*
* BHierarchy.cpp: Version 1.0
* Created 31/06/2017 by <NAME>
*/
// =============================================================... | ALGO | 0.960207 | 4.721869 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-03-03T15:20:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ed6d1234... |
581efcec-cf96-46dd-b0b2-0cb4f3656a80 | tanntnny/como | posn2023/bsearch/ap_bush.cpp | #include <bits/stdc++.h>
using namespace std;
int A[1111];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int q;
cin >> q;
while(q--){
long long n, k, nn = 0;
cin >> n >> k;
for(int i=0; i<n; i++) cin >> A[i];
sort(A, A + n);
for(int i=0; i<n; i++){
int j = i;
... | ALGO | 0.99993 | 3.878621 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-28T06:05:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a21b34d5a85... |
4d1bc4d0-3954-4ab8-b052-fc65080da92e | agorodetskiy/technopark | algo/module_1/algo_5/main.cpp | #include <cstdio>
#include <cstring>
#define STACK_INIT_SIZE 256
#define REALLOC_FACTOR 2
#define BUFFERSIZE 20000
class Stack_t
{
public:
Stack_t();
~Stack_t();
void push(char elem);
char pop();
char peek();
int getSize();
private:
char *data;
size_t size;
size_t capacity;
voi... | ALGO | 0.999984 | 3.905785 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-04-22T00:22:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce153f3eb9... |
2fea42da-8be2-4923-9880-fbb56bbb6636 | the-code-innovator/prime-check | utilprimes.cpp | #include <iostream>
void convertParams(char *argv[], int &startValue, int &endValue){
startValue = atoi(argv[1]);
endValue = atoi(argv[2]);
}
bool isPrime(int n){
if(n == 1) return false;
if(n == 2) return true;
else if(n == 3) return true;
else if(n % 2 == 0) return false;
else if(n % 3 == 0) return false;
e... | ALGO | 0.995354 | 4.279811 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-03-03T10:04: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": "c52e1e1967... |
1a472aae-a6b4-4e55-8597-3e62ead3e9a1 | yuyan1991/WhiteChapel | whiteChapelGameFlow.h | #include"handler.h"
using namespace std;
void stuffForJack(int turn) {
switch (turn) {
case 1:
numCarriage = 3;
numLight = 2;
break;
case 2:
numCarriage = 2;
numLight = 2;
break;
case 3:
numCarriage = 2;
... | ALGO | 0.997072 | 3.398278 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-01-12T07:40: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": "1406a229e... |
a465752c-ad80-4a0b-9964-1856d81464a2 | mysh212/Coding | Zerojudge-g733.cpp | // Author : ysh
// 10/03/2022 Mon 15:00:39.37
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a,b,c;cin>>a>>b>>c;
vector<vector<pair<int,int>>>f(a),g(a);
for(int i = 0;i<b;i++) {
int aa,bb,cc;cin>>aa>>bb>>cc;
f.at(aa).push_back(... | ALGO | 0.99999 | 3.828661 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2022-02-05T12:21:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8522aed... |
41538c4d-cb57-42ff-b6a1-7f3befb86e14 | thanh2811/cpp | LCM_GCD3.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[100];
int mod = 1e9 + 7;
int hx(){
ll mul = 1;
for(int i=1;i<=n;i++){
mul *= a[i];
mul %= mod;
}
return mul;
}
int gx(){
int tmp = a[1];
for(int i=2;i<=n;i++) tmp = __gcd(tmp,a[i]);
return ... | ALGO | 0.999984 | 4.640877 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-09-30T08:47: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": "6898e9b611... |
23db0346-8f17-47b6-8eb4-298f05353372 | minombreesjeff/darwin_env | DSNSLPlugins/slpd/mslpd_stack.cpp | /*
* Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in... | TOOL | 0.909602 | 6.605972 | {
"github_metadata": {
"branch": "opensource.apple.com",
"commit_count": 4790,
"repo_created_at": "2018-04-07T16:34:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"conten... |
3256c7a2-a93e-439b-bf74-42d748729a48 | brian030128/hw2 | Sort.h | //
// Created by gomil on 2022/11/12.
//
#include "iostream"
using namespace std;
#ifndef SCHOOLHW_SORT_H
#define SCHOOLHW_SORT_H
class Sort{
public:
virtual void sort(int* arr,int size) = 0;
virtual string name() = 0;
void test(){
int arr1[13] = {1,0,0,1,2,0,2,0,2,1,1,2,2};
sort(arr1,13... | ALGO | 0.996648 | 5.504716 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-11-12T20:52: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": "27d186b1babf... |
1fa3a1e2-15a5-4e1e-9bb9-57edb83cc2b6 | douglasichen/CP | C++Code/2018s3_2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<int,int> pi;
typedef vector<vector<int>> vvi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(x,n) for(int x = 0; x < n; +... | ALGO | 0.999866 | 4.193722 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-01-19T18:18:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "37764a2feb43... |
59a1ffae-09ba-48e2-8dcb-7073c3d0be00 | esthedebeste/fylang | src/asts/asts/binop.cpp | #include "binop.h"
#include "bool.h"
LLVMValueRef gen_num_num_binop(int op, LLVMValueRef L, LLVMValueRef R,
NumType *lhs_nt, NumType *rhs_nt) {
if (lhs_nt->neq(rhs_nt))
R = gen_num_cast(R, rhs_nt, lhs_nt);
bool floating = lhs_nt->is_floating && rhs_nt->is_floating;
if (floating... | TOOL | 0.981937 | 7.064574 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-02-23T23:17:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50d8f0d415a... |
cec8cdc0-f651-4083-9682-e63abe1b0822 | kalsasdf/HiNA-DCN_INET | common/INETUtils.h | //
// Copyright (C) 2005 OpenSim Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
#ifndef __INET_INETUTILS_H
#define __INET_INETUTILS_H
#include <string>
#include "inet/common/INETDefs.h"
namespace inet {
namespace utils {
/**
* Converts an integer to string.
*/
INET_API std::string ltostr(long i); //... | TOOL | 0.911624 | 6.221462 | {
"github_metadata": {
"branch": "main",
"commit_count": 187,
"repo_created_at": "2022-11-23T06:05:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e853c9aca... |
dec11653-e73f-46b5-9c64-acc4c9770a34 | 1tygoime/a | codeforces/1579E2.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N], b[N];
int st[10 * N];
int n;
int compress(int x){
return lower_bound(b + 1, b + 1 + n, x) - b;
}
int get(int id, int L, int R, int u, int v){
if(v < L || R < u) return 0;
if(u <= L && R <= v) return st[id];
int M = (L + R) / 2;
... | ALGO | 0.999496 | 4.404992 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-10-12T16:31:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20aa5f1dca7... |
3899db29-ecd6-4617-bf60-bf8726cc9f1c | MyungHyun-Ahn/Algorithm | 백준/Silver/2503. 숫자 야구/숫자 야구.cc | #include <stdio.h>
#include <map>
using namespace std;
map<int, bool> m;
void RemoveNum(int n1, int n2, int n3, int s, int b)
{
// 숫자 넣기
int num1[3] = { n1, n2, n3 };
for (auto &num : m)
{
int stCount = 0;
int ballCount = 0;
int num2[3] = { num.first / 100, (num.first % 100) / 10, num.first % 10 };
fo... | ALGO | 0.999889 | 4.657809 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2023-08-09T17:30: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": "e8fc551643d... |
684f06e1-3cdc-4a11-bc4c-b7f8fa7976e3 | Time1ess/MyCodes | LintCode/64-Merge Sorted Array/solution.cpp | class Solution {
public:
/*
* @param A: sorted integer array A which has m elements, but size of A is m+n
* @param m: An integer
* @param B: sorted integer array B which has n elements
* @param n: An integer
* @return: nothing
*/
void mergeSortedArray(int A[], int m, int B[], int n... | ALGO | 0.999994 | 5.119877 | {
"github_metadata": {
"branch": "master",
"commit_count": 1837,
"repo_created_at": "2014-10-23T02:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52787a8... |
d966babd-0b0e-4423-a5b0-1e7826e76603 | ZhaoShupengTUM/AutomaticEmergencyBrakeSystem-AEB- | nba/ros/src/driver_cmds/tod_helper/include/tod_helper/geometry/Helpers.h | // Copyright 2020 Hoffmann
#pragma once
#include <cmath>
#include "geometry_msgs/Point.h"
#include <tf/transform_datatypes.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2/utils.h>
namespace tod_helper::Geometry {
inline double calc_horizontal_distance(const geometry_msgs::Point &pt0, const geometry_m... | TOOL | 0.991148 | 6.503035 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-08-29T21:36: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": "0648cef870f8... |
2611888e-eb65-4f52-93c1-d78371152f8d | sexyseunghwan/ForAlgorithm | cplus/21736/main_bfs.cpp | #include <iostream>
#include <string>
#include <queue>
using namespace std;
int N,M;
char map[600][600];
bool visited[600][600];
int meet_cnt;
int my_r;
int my_c;
int dr[4] = {0,0,1,-1};
int dc[4] = {1,-1,0,0};
void bfs(int r, int c)
{
queue<pair<int, int>> que;
que.push({r,c});
while(!que.empty())
... | ALGO | 0.999902 | 4.19355 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-06-02T08:25: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": "b7a41d93731... |
7f111195-1eba-4827-b506-3c692574e677 | liuyubobobo/Play-Leetcode | 0001-0500/0119-Pascals-Triangle-II/cpp-0119/main3.cpp | /// Source : https://leetcode.com/problems/pascals-triangle-ii/description/
/// Author : liuyubobobo
/// Time : 2018-08-10
#include <iostream>
#include <vector>
using namespace std;
/// Using Binomial Coefficients
///
/// Time Complexity: O(rowIndex^2)
/// Space Complexity: O(rowIndex)
class Solution {
public:
... | ALGO | 0.999908 | 6.058472 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "20... |
3b752ea7-eeea-46a6-b6b4-1395053bba42 | Rhoban/IKWalk | Example/example.cpp | #include <iostream>
#include "IKWalk.hpp"
/**
* Run the walk for given among of time and update
* phase and time state
*/
static void runWalk(
const Rhoban::IKWalkParameters& params,
double timeLength,
double& phase,
double& time)
{
//Leg motor computed positions
struct Rhoban::IKWalkOutp... | ALGO | 0.977341 | 4.892365 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-10-04T10:47:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 39,
"forks": 17,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fee8b581c... |
4b22f0ab-edf9-4708-b2b3-e1a7a9e9fecc | yipcubed/leet-reverse-string | main.cpp | #include <cstring>
#include <climits>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
ostream& operator<<(ostream& os, const vector<char>& v) {
os << "[";
for (char i : v) {
os << i << " ";
}
os << "]";
return os;
}
// Live cod... | ALGO | 0.999608 | 4.497608 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-06-27T20:12: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": "26eae3cd15... |
3a1f31a4-8009-41e3-99d0-9d0a83f68291 | kkisic/Procon | CPP/Codeforces/1138/b.cpp | #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>
#define int long long int
#define rep(i, n) for(int i = 0; i < (n);... | ALGO | 0.999927 | 3.248539 | {
"github_metadata": {
"branch": "master",
"commit_count": 1105,
"repo_created_at": "2017-11-28T11:11:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b96f5c9... |
5e412506-80b6-4a47-92d5-b74d02fd3ace | azharnian/COMPUTERIGS2425 | OLIM/20241123/quick.cpp | #include <iostream>
#include <vector>
void quicksort(std::vector<int>& arr, int low, int high);
int partition(std::vector<int>& arr, int low, int high);
void swap(int& a, int& b);
void quicksort(std::vector<int>& arr, int low, int high) {
if (low < high) {
int pivot_index = partition(arr, low, high);
... | ALGO | 0.999972 | 6.012178 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-10-03T14:12:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "0592247ff67... |
1759e497-b263-427f-b5af-728cca3dc470 | S2E/s2e | klee/include/klee/SolverImpl.h | //===-- SolverImpl.h --------------------------------------------*- C++ -*-===//
//
// The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------... | ALGO | 0.998546 | 7.874965 | {
"github_metadata": {
"branch": "master",
"commit_count": 1751,
"repo_created_at": "2020-01-07T21:32:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 480,
"forks": 95,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "c9e26... |
aec58f45-fc56-4791-8e11-11fc82dad54e | erleben/OpenTissue | OpenTissue/dynamics/mbd/simulators/mbd_semi_implicit_fixed_step_simulator.h | #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_SIMULATORS_MBD_SEMI_IMPLICIT_FIXED_STEP_SIMULATOR_H
#define OPENTISSUE_DYNAMICS_MBD_UTIL_SIMULATORS_MBD_SEMI_IMPLICIT_FIXED_STEP_SIMULATOR_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Comput... | ALGO | 0.995635 | 5.827218 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2018-02-11T18:06:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 101,
"forks": 28,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4d8... |
897d4bfb-1be5-43c5-9f92-81818941f1fd | damenhanter/Dragon3D | DragonEngine/BSPTree.h | #pragma once
#include "BitmapFile.h"
#include "BitmapImage.h"
#include "Vector4.h"
#include "COBModel.h"
typedef struct PolyF4DV1_TYP
{
int state;
int attr;
int color; //多边形颜色
int litColor[4]; //用于存储光照后的颜色
CBitmapImage* ptrTexture;
int mati;
float nlength;
CVector4 n;
float avgZ;
VERTEX vlist[4]; //四边形... | ALGO | 0.994203 | 3.080202 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-31T15:40: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": "84ff8d687e... |
e8a50af3-b81f-484d-a0fd-8162a5d53d1b | gengar-maker/EHC-LABS | LABS/SR1/integral.cpp | #include <iostream>
#include <cmath>
#include <string>
#include <chrono>
class Solver {
private:
double(*m_func)(float);
void kahan_sum(double func_ret, double& sum, double& corr) {
const double y = func_ret - corr;
const double t = sum + y;
corr = (t - sum) - y;
sum = t;
}
double mid_rectangles(fl... | ALGO | 0.99979 | 5.741964 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-09-28T15:12:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec4b37af05e... |
9a2610be-1bdb-426f-86f3-a567ae5aa0fb | MengeCrowdSim/Menge | src/Menge/MengeCore/resources/PortalPath.h | /*
Menge Crowd Simulation Framework
Copyright and trademark 2012-17 University of North Carolina at Chapel Hill
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/licen... | ALGO | 0.99666 | 5.950279 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2014-10-19T00:01:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 148,
"forks": 66,
"issues": 68,
"pull_requests": 2
},
"file_meta": {
"content_id": "8bac6... |
43825970-a3c1-4675-bda4-7ec977cfd45d | Hannsel101/ECE141L-Computational-Algorithms-Lab | HW3/HCamacho_ECE141_HW3/graphType.cpp | #include "graphType.h"
bool graphType::isEmpty() const {
return (gSize == 0);
}
//------------------------------------------------------------------------------
void graphType::createGraph() {
ifstream infile;
char fileName[50];
int vertex;
int adjacentVertex;
if (gSize != 0) //if the graph is ... | ALGO | 0.993409 | 3.816962 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-01-27T17:51:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "106cd17e133... |
da0d59c3-2db6-4c47-ab17-367315d3314a | ishandutta2007/codeforces-j | juve45/normal/1244/E.cpp | #include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prn... | ALGO | 0.999971 | 3.030136 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7a65df789a5... |
fe8647dd-3fc5-4664-b395-de87104622b5 | srinivasnks/coursera-alogs_ds_specialization | course1_algos_toolbox/week_5/my_sols/primitive_calculator.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
using namespace std;
void make_sequence(uint32_t n, vector<pair<uint32_t, uint32_t>> &sequence)
{
sequence[1] = std::make_pair(0, 1);
for (int i = 2; i <= n; i++) {
if (i % 3) {
if (i % 2) {
sequence[i] = st... | ALGO | 0.999965 | 3.727495 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-07-14T06:21: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": "db08f7437... |
3e530f39-b85e-48a1-869c-7a3dc08ec5d8 | developerHet/CAndCppPrograms | Apna College Cpp/stackQueue2.cpp | #include <iostream>
#include <queue>
using namespace std;
class stack{
queue<int> q1;
queue<int> q2;
int N;
public:
stack() {
N=0;
}
void push(int val) {
q1.push(val);
N++;
}
void pop() {
if(q1.empty()) {
return;
}
while... | ALGO | 0.998878 | 4.586463 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-01-21T10:31: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": "4017c050e... |
f7e0e999-736f-4e8f-9c43-515df58933fb | shivanshsanoria1/LeetcodeSolutions | CPP [2501-3000]/2812.find_the_safest_path_in_a_grid [TLE 1031 of 1036] [1].cpp | class Solution {
private:
void multiSourceBFS(vector<vector<int>>& grid, vector<vector<int>>& dist, vector<vector<bool>>& visited, queue<pair<int, int>>& q){
int n=grid.size();
// up, down, left, right directions
vector<pair<int, int>> dirs = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int... | ALGO | 0.999993 | 5.943405 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2024-02-21T17:59: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": "2ea3f22f31... |
a6ead8d0-cbca-4249-940d-641a7f3627c5 | deSigntheClutch/competitive-programming-code-repository | Codeforces/Codeforces Round #411 (Div. 1)/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, q;
int fa[N], f1[N], f2[N], f3[N], fi[N];
int diameter[N];
vector<int> G[N];
map<pair<int, int>, double> ans;
void init() {
for (int i = 1; i <= n; i++) {
fa[i] = i;
}
}
int find(int u) {
if (fa[u] != u) return fa[u] = find(fa... | ALGO | 0.999932 | 4.429922 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-01-01T00:15: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": "4571a89b9e04... |
7a6a7993-1e7d-477d-ae9d-5ee2a9c84c00 | miiitomi/atcoder | ABC/abc386/g.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
const ll INF = 2e+18;
const ll MOD = 998244353;
vector<mint> F(501, 1);
vector<vector<mint>> C(501, vector<mint>(501, 0));
vector<mint> POW_M(500*500 + 1, 1);
void solve() ... | ALGO | 0.999963 | 5.087995 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2021-03-02T13:45: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": "17febae602... |
3e9d015a-e57b-4312-afba-60db40e65edf | overIsAC/contest | cf/600/678/b.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
#define lson (k << 1)
#define rson (k << 1 | 1)
#if LEMON
#define db(x) cout << "function " << __FUNCTION__ << ", line " << __LINE__ << " : " << #x << " " << x << endl;
#define dbf(func) func();
#else
#define db(x)
#define ... | ALGO | 0.999914 | 3.590711 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2022-10-30T18:24:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfb6c1e6bf... |
787afa35-b03d-49f9-93af-a1704334bc5f | todrepus/BaekjoonSolvedAlgorithm | 백준/Gold/11404. 플로이드/플로이드.cc | // CppForStudy.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <queue>
struct Edge
{
int start;
int end;
int dist;
Edge() { start = end = dist = 0; }
Edge(int _start, int _end, int _dist) { start = _start; end = _end; dist ... | ALGO | 0.999992 | 5.146301 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-22T11:00: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": "f70b5d760a60... |
fdee69a0-6f83-44c7-88e1-b466cddc3e0e | janvybiral32/GMU-HistogramAcceleration | cpu.cpp | #include "cpu.h"
#define MIN_BRIGHTNESS 0
#define MAX_BRIGHTNESS 255
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
void histogram(cl_uchar4* inputImage, cl_uint* histogram, int width, int height)
{
for (int i = 0; i < HISTOGRAM_SIZE; i++)
{
histogram[i] = 0;
}
f... | ALGO | 0.99723 | 4.023928 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-01-18T03:04:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c89c4453... |
6ccedcbe-9b36-4346-b11b-e1aa1f638cff | johannesgerer/jburkardt-cpp | laguerre_test_int/laguerre_test_int.hpp | void laguerre_compute ( int order, double xtab[], double weight[],
double alpha );
void laguerre_recur ( double *p2, double *dp2, double *p1, double x,
int order, double alpha, double b[], double c[] );
void laguerre_root ( double *x, int order, double alpha, double *dp2,
double *p1, double b[], double c[] );
... | ALGO | 0.998671 | 4.536718 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2012-12-02T14:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac796f62... |
eb164052-1e22-40b5-ae13-49b3c65818bd | rdua3561/Problem-Solving | 2-add-two-numbers/2-add-two-numbers.cpp | #include<bits/stdc++.h>
/**
* 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:
... | ALGO | 0.999964 | 5.980325 | {
"github_metadata": {
"branch": "main",
"commit_count": 1776,
"repo_created_at": "2022-02-01T09:27:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5ef90a7d... |
4863c9fe-d6a9-4d01-aaab-40f40761a6d9 | SimonHanYANG/AR_Microscopy_UI_MFC | RoboticBiopsy-LaserSpermImmobilization_0615_341/SingleSpermTracker.cpp | #include "SingleSpermTracker.h"
#define PDAF_Process_Noise_Cov 20.0 //20 //10
#define PDAF_Measure_Noise_Cov 10.0 //10 //200
#define PDAF_Mahalanobis_Gate_Probability 0.99 //the probability of a measurement is gated as valid measurement
using namespace Methods;
SingleSpermTracker::SingleSpermTracker(void)
... | ALGO | 0.996933 | 4.569124 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-27T06:08:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2ebb8180040... |
fbbe53db-2b7a-42f6-9883-af9c0c7344ef | bokusunny/atcoder-archive | atcoder.jp/abc154/abc154_e/Main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string N;
cin >> N;
int K;
cin >> K;
// dp[i][is_less][0_cnt]
vector<vector<vector<long long>>> dp((int)N.size() + 1, vector<vector<long long>>(2, vector<long long>(K + 1)));
dp[0][0][0] = 1;
for (int i = 0; i < (int)N.size(); i++) {
for ... | ALGO | 0.999854 | 4.549 | {
"github_metadata": {
"branch": "master",
"commit_count": 931,
"repo_created_at": "2021-04-08T04:28: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": "8825b268... |
f4b8fea7-7eb4-4773-9b6c-4b2954e9ff18 | Pomi44/AnDS-lab3 | AnDS-lab3/AnDS-lab3/main.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <limits>
#include <algorithm>
template<typename Vertex, typename Distance = double>
class Graph {
public:
struct Edge {
Vertex from;
Vertex to;
Distance distanc... | ALGO | 0.999971 | 5.636502 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-06-06T09:31: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": "7772bb109d... |
eb6b07fb-ff95-4aff-8d95-1176a1669526 | saayan007s/Programming | CSES/Tree Algorithms/08DistanceQueries.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define fr first
#define sc second
#define eb emplace_back
#define nl "\n"
const int N = 2e5L + 5;
const int logn = 20;
int n, q;
vector<int> adj[N];
int depth[N];
int par[N][logn];
void dfs(int x, int p) {
depth[x] = depth[p] + 1;
par[x][0]... | ALGO | 0.999897 | 4.225368 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2022-12-19T08:04: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": "9ba0f138aa... |
94f2c3c1-44a3-4c52-a464-a9e5b1626e74 | Sanjay-1311/DS-lab | Codes/lab-9/c1956 (1).cpp | //Codeforces q 1956
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
//A vector class to store the vector with the sequence
class vectors{
private:
vector<int> v1;
public:
vector<int> findnum();
};
int main(){
class vectors v;
vector<int> v4;
int test;
... | ALGO | 0.999834 | 3.592778 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-26T16:42:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dec71cb89e9... |
e8152eea-b572-43d2-bd64-70cdbb1ce46e | ACM-TOMS/CALGO | 0909/Original-Submission/Src/nomad.3.4.2/examples/advanced/multi_start/multi.cpp | // This program is not intended to be linked with the MPI NOMAD library.
#include "nomad.hpp"
using namespace std;
using namespace NOMAD;
const double LB = 0.0; // lower bounds
const double UB = 4.5; // upper bounds
// LH search used to generate a list of starting points:
void LH_x0 ( int n , int p , vector<Point ... | ALGO | 0.999919 | 4.483381 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-11-17T18:24:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "46daa104cca... |
1180f906-337c-471d-b0ce-27f04ebdb957 | idfortytwo/numerical_methods | old2/matrix.h | #include "vector.h"
#ifndef MATRIX_H
#define MATRIX_H
using namespace std;
template<int N, int M>
class Matrix : array<Vector<N>, M> {
public:
Matrix<N, M>() = default;
Matrix<N, M>(array<Vector<N>, M> a) : array<Vector<N>, M> (a) {}
using array<Vector<N>, M>::operator[];
void swapRows(int a, int b)... | TOOL | 0.956286 | 5.088913 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-15T10:55: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": "7a7f3a223c... |
6b4d54dd-06c0-4b23-99d9-38b5bd91a8cf | AdrianPrice/Domain-Independent-Deception | centroids-minimun_covering/landmark-downward/src/search/merge_and_shrink/merge_and_shrink_heuristic.cc | #include "merge_and_shrink_heuristic.h"
#include "distances.h"
#include "factored_transition_system.h"
#include "merge_and_shrink_algorithm.h"
#include "merge_and_shrink_representation.h"
#include "transition_system.h"
#include "types.h"
#include "../option_parser.h"
#include "../plugin.h"
#include "../task_utils/ta... | ALGO | 0.998986 | 5.442367 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2022-07-31T03:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f45e413de1... |
f0791ac2-dcff-4826-800c-62eefd7a3031 | FGDES/libFAUDES | plugins/multitasking/src/mtc_redundantcolors.h | /** @file mtc_redundantcolors.h
Methods for removing redundant colors for the supervisor synthesis from MtcSystems
*/
/* FAU Discrete Event Systems Library (libfaudes)
Copyright (C) 2008 <NAME>
Copyright (C) 2006 <NAME>
Exclusive copyright is granted to <NAME>
This library is free software; you can r... | ALGO | 0.984299 | 6.615466 | {
"github_metadata": {
"branch": "main",
"commit_count": 281,
"repo_created_at": "2024-02-15T13:50:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d5f662e730... |
ac77627a-cde2-4c15-9f17-f1ce9fba4dd7 | FaizanCod/Compiler-Design | programs/Mealy.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
vector< vector<pair<int, string> > > mealy;
int initial_state;
int convertToInt(string s) {
int num = 0;
for (int i=0; i<s.size(); i++) {
num = num*10 + (s[i]-'0');
}
return ... | ALGO | 0.999833 | 4.400421 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-03-28T18:54:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60df308e7... |
d7e0c7a5-a613-4499-b9e3-4287123a22c4 | zghh/rsa | core/main.cpp | #include "integer.h"
#include "rsa.h"
#include "prime.h"
#include "common.h"
#include "const.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
using namespace std;
const int COUNT = 100;
const int BITS[] = {256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, ... | ALGO | 0.997826 | 4.461869 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-15T05:19:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9e31014d1... |
1db6bba7-c394-4411-a363-3f1e69d2515d | JacobianDet/CompeteUp | ABC150/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF (1LL<<57)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz siz... | ALGO | 0.999993 | 3.65921 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-04T16:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "b687b25f0e... |
e3d34bcf-0c22-4eec-8afc-71f49e481d7c | hkalra0001/CompetitiveCodeVault | CodeForces/Round970/C_Longest_Good_Array.cpp | /*
solved by - <NAME>
please do check - https://github.com/kalrah0001/CompetitiveCodeVault
cc - @kalracoder
cf - @hkalra0001
lc - @hkalra0001
at - @hkalra0001
code by
_ _ _____ _____ _ _ _____ _______ _ __ ... | ALGO | 0.999921 | 4.262843 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-01-11T19:01:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b926d8b799... |
7d0bb5fd-3542-4b0d-a633-b9e69eb3a9ba | ishandutta2007/codeforces-k | kal013/normal/1364/D.cpp | /*/ Author: kal013 /*/
// #pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace std;
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update> ... | ALGO | 0.999979 | 3.8537 | {
"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": "12e554a7eba5... |
3f4f233f-d480-4054-823e-efe826733faa | 99sparsh/CodeforcesSolutions | 665/A.cpp | #include <bits/stdc++.h>
#define mod 1000000007
#define FOR(i, a, b) for (i = a; i < b; i++)
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef priority_q... | ALGO | 0.999992 | 3.875253 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-06-22T14:17: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": "15694a759... |
48a307b1-398b-405b-b3ec-652abf2f5c89 | aaryam253/Competitive-Programming-Questions-and-Cheatsheets | KattisPractices/wilson/beatspread.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <algorithm>
#include <tuple>
#include <string.h>
#include <sstream>
#define MAX 2147483646
using namespa... | ALGO | 0.999473 | 3.924417 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2018-10-24T13:53: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": "c0e69e465... |
c34674ef-2caa-4c80-a490-a9adfee2bb0a | charlie-zhang-code/practice-language | leetcode-practice/cpp/plugin/leetcode/editor/cn/[28]找出字符串中第一个匹配项的下标.cpp | //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
private:
// 函数:getNext
// 作用:计算KMP算法中的next数组,用于在匹配失败时快速跳过不必要的比较
// 参数:
// next: 存储next数组的指针
// s: 需要计算next数组的字符串
void getNext(int *next, const string &s) {
int j = 0; // j表示当前匹配的前缀长度
next[0] ... | ALGO | 0.999955 | 5.949132 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-08T01: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": "ac819df90b4a... |
d9bf62d3-3eed-4e41-a75d-85c831742bd2 | tanmayarya29/gfg_dsa_self_paced | Linkedlist/problems/__mergeSortDLL.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *next, *prev;
Node (int x){
data = x;
next = NULL;
prev = NULL;
}
};
// } Driver Code Ends
/*
Structure of the node of the list is as
struct Node
{
int data;
struct Node *next, *prev;
No... | ALGO | 0.999933 | 5.633548 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2021-05-30T03:21:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99b5e2418a... |
45b8995e-415e-426c-9d18-a05b20c2991a | Wang-zuozheng/sudoku | 第三版_数独/第三版_数独/sudoku.cpp | #include <cstdio>
#include <stdlib.h>
#include <string>
#include<algorithm>
#include<iostream>
#include"Function.h"
#include<fstream>
using namespace std;
//--------------------------parameters for make sudoku--------------------------
int n;
char ans[200000000];
int cnt;
string get_path() {
string input;
cin >> inp... | ALGO | 0.988122 | 3.599293 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-12-11T09:08: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": "3ee4ca8b1... |
0b34008e-b95b-487b-a3ed-682a2e2a21f3 | Jumaruba/LeetCode | 092.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* reverseBetw... | ALGO | 0.999992 | 5.847692 | {
"github_metadata": {
"branch": "master",
"commit_count": 342,
"repo_created_at": "2019-09-18T20:38: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": "495655e4... |
8d083062-331a-4622-aba9-195f5a1513ee | AnvitT/SonicRover | main.ino | /*
* Author: <NAME>
* Date: 28/11/23 [Last Modified]
* Description: [Code to control the car and scan and analyze obstacles in front of it.]
*/
#include <AFMotor.h>
#include <Servo.h>
#include <math.h>
AF_DCMotor motor1(1); // top right motor
AF_DCMotor motor2(2); // top left motor
AF_DCMotor motor3(3); // botto... | TOOL | 0.94675 | 4.773928 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-10-26T18:53: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": "42fe7372481... |
ec4a6a8d-d246-4e49-8abc-8a088d6ac9a6 | rijeet/CP_PROBLEMSET | e.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int num;
void printCombinationsWithRepetition(const std::vector<ll> &elements, ll k, std::vector<ll> &combination)
{
ll lowest = INT_MAX;
if (k == 0)
{
ll temp = std::accumulate(combination.begin(), combination.end(), 0);
... | ALGO | 0.999962 | 4.691239 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-05T04:16: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": "544c2f57fe3... |
9d53dda6-ddfc-4c27-83f5-b8edd142b7d6 | R3BRootGroup/NeuLAND_DNN | Translator/R3BNeuLANDTranslator.h | // FairTask that translates the NeuLAND digis into general signals.
// Each detector should have its own translator, so that the DNN
// software can be applied to general signals.
// Written by <NAME>.
#ifndef R3BNEULANDTRANSLATOR_H
#define R3BNEULANDTRANSLATOR_H
// Inclusion of C++ headers:
#include <iostream>
#incl... | ALGO | 0.935531 | 5.579656 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-03-19T19:05:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05bf3aeefb... |
b440e0fa-5b0a-4224-9a00-6be8f50e89d1 | xxcxu/SchoolCode | FZSDF160_1.cpp | #pragma region
#include <bits/stdc++.h>
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using i128 = __int128_t;
using u32 = uint32_t;
using u64 = uint64_t;
#define ep emplace
#define eb emplace_back
#define all(x) x.begin(), x.end()
FILE *fin, *fout, *ferr;
i32 read() {
i32 t = 0, f = 0;
char ch = f... | ALGO | 0.999673 | 4.266006 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-09-20T11:11: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": "7bdcaff7d... |
5fd84f00-88a1-4c75-9d9f-383c441f2628 | ehdgus3130/Baekjoon | 백준/28278(스택2).cpp | #include<iostream>
#include<stack>
using namespace std;
stack<int> arr;
int n, k, a;
int main() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> k;
switch (k)
{
case 1:
cin >> a;
arr.push(a);
break;
case 2:
if (arr.empty()) {
cout <<... | ALGO | 0.999924 | 3.927327 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2023-05-28T08:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1c6f10f5... |
9881e257-27e3-4f3f-afa1-c6679cc8aad1 | sudhee-udel/C_plus_plus | phase_6/fig07_14.cpp | #include <iostream>
using std::cout;
using std::endl;
#include <iomanip>
using std::setw;
void modifyArray(int [], int);
void modifyElement(int);
int main() {
const int arraySize = 5;
int a[arraySize] = {0, 1, 2, 3, 4};
cout << "Effects of passing entire array by reference:"
<< endl << endl << "The values of t... | ALGO | 0.982063 | 5.424491 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-12-04T00:24: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": "8257834913... |
065c7ee4-5031-4793-92fd-3619ffff70f7 | ahbeheshti/cses-problemset-solutions | BookShop.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int , int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define Loop(i,n) for (int i = 0; i < n; i++)
#define SQ(a) (a)*(a)
#defin... | ALGO | 0.999819 | 3.915533 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-07-29T06:59:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07a5d225d... |
bd09dd51-ad81-412c-a7fb-bbdc4e7c90e6 | kanhaiyabaranwal/my-programs-old | Jitendra_ALGO/ALGO/072_SpecialPrimeNumbers.cpp | /*
http://www.geeksforgeeks.org/special-prime-numbers/
Special prime numbers
----------------------
Given two numbers n and k, find whether there exist at least
k special prime numbers or not from 2 to n inclusively.
A prime number is said to be Special prime number if
it can be expressed as the sum of three integer... | ALGO | 0.999952 | 4.160177 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-26T08:57: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": "c21ea8ee23... |
e27e7c7f-236b-4e16-a17e-cf5320333c14 | 5qol255/XDU | XDOJ/xdoj/301.cpp | #include <bits/stdc++.h>
#define mian main
#define ll long long
#define elif else if
using namespace std;
struct
{
int x, y;
int num1 = 0, num2 = 0;
char s[5];
void f()
{
int s1 = 0, s2 = 0;
for (int i = 1; i < x; ++i)
if (x % i == 0)
{
s1 +=... | ALGO | 0.999176 | 3.927955 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-06-21T12:38: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": "84529c33b30e... |
a9311fd4-ec80-475e-86e6-48ec3a20c434 | fengrenchang86/PKU | 1454/1887265_PE.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int a[1000];
int c = 0;
int n;
int i;
int j;
while ( cin>>n && n !=0 )
{
c = 0;
int g[11] = {0};
for ( i = 0; i < 1000; i++ )
a[i] = 0;
a[0] = 1;
for ( i = 2; i <= n; i++ )
{
for ( j = 0; j <= c; j++ )
a[j] *= i;
f... | ALGO | 0.998545 | 3.752448 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-03-07T13:40:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c0a73664e... |
ddcd4ef5-4f8a-4993-bbd7-bef270e4cf80 | tsimafeip/master-course | SpecialDataStructures/CW_archive.cpp | #include <iostream>
#include <algorithm>
#include <random>
#include <vector>
#include <iterator>
#include <numeric>
#define ll unsigned long long
const ll MAX_N = 300001;
using namespace std;
struct Node {
ll prior, index, data;
Node *left, *right;
Node() {
prior = index = data = 0;
left... | ALGO | 0.999981 | 4.400196 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-12-29T21: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": "00aa3336e1... |
e3c22a8a-d054-42b0-b680-5c7b98617ccc | HarshShah1997/GraphicsLab | matrix.h | #include <cmath>
#include <vector>
class Matrix {
public:
int rows;
int cols;
std::vector< std::vector<double> > elementAt;
Matrix(int r, int c) {
rows = r;
cols = c;
elementAt.resize(rows, std::vector<double> (cols, 0));
}
};
Matrix* add... | ALGO | 0.984489 | 4.589417 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2016-08-29T08:30: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": "b7c6704a0... |
3c0d7ea7-7faf-4217-a0e1-3f72368993d1 | adityasinghhh/coding | interviewstreet/challenges/stringReduction.cpp |
#include<algorithm>
#include<assert.h>
#include<bitset>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<deque>
#include<iostream>
#include<map>
#include<memory.h>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<utility>
#include<... | ALGO | 0.999876 | 3.338491 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-05-26T14:49: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": "2270c7a14a... |
34f4a892-aefd-4313-b2a8-c1315acbac9f | VastoLorde95/Competitive-Programming | Codeforces/369 Division 2/Problem B/B.cc | #include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define meta __FUNCTION__,__LINE__
... | ALGO | 0.999911 | 3.570934 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d7042... |
b71f1588-828a-4c3b-b3cd-22d90d0dd77d | irrtoolset/irrtoolset | src/dataset/SymbolConjunctPtr.SplayNode.h | // This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1988, 1982 Free Software Foundation
written by <NAME> (<EMAIL>)
This file is part of the GNU C++ Library. This library is free
software; you can redistribute it and/or modify it under the terms of
the GNU Library General Public License a... | ALGO | 0.953158 | 6.424217 | {
"github_metadata": {
"branch": "master",
"commit_count": 235,
"repo_created_at": "2014-11-06T14:08:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 136,
"forks": 36,
"issues": 10,
"pull_requests": 0
},
"file_meta": {
"content_id": "86e57... |
1831f525-5030-41ac-a59b-20b0466d9342 | Aryan-kamal/Leetcode-submissions | 1402-count-square-submatrices-with-all-ones/1402-count-square-submatrices-with-all-ones.cpp | class Solution {
public:
int countSquares(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
int sum = 0;
vector<vector<int>> dp(n, vector<int>(m, 0));
// Initialize first column
for (int i = 0; i < n; i++) {
dp[i][0] = matrix... | ALGO | 0.999768 | 6.244258 | {
"github_metadata": {
"branch": "main",
"commit_count": 989,
"repo_created_at": "2024-09-16T20:10: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": "0909b13e36... |
8f10db65-b99c-4a0c-93ba-6b81576afc53 | SeaWar741/ITC | 3er_Semestre/EstructuraDeDatosYAlgoritmos/BinarySearchTree/BinarySearchTree.h | //<NAME>, A01652138
#include <iostream>
#include "Node.h"
using namespace std;
//clase Binary search tree
template<class T>
class BinarySearchTree{
private:
Node<T> *root; //nodo raiz
//int children;
//int height;
public:
BinarySearchTree();
bool find(T data);
bool isEmpty(){return root == NULL;};
void inser... | ALGO | 0.999503 | 3.695559 | {
"github_metadata": {
"branch": "master",
"commit_count": 357,
"repo_created_at": "2019-08-28T20:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "2a960ad... |
2ceb6012-4347-4906-a3ce-ec118fdca404 | Minhan93/Computational_methods | Strassen_openMP/matrix.cpp | //
// matrix.cpp
// HW4_1
//
// Created by <NAME> on 11/1/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <stdio.h>
#include "matrix.h"
Matrix::Matrix(
const int numCols,
const int numRows,
const bool initRandom
):row(numRows) ,col(numCol... | ALGO | 0.998434 | 3.454889 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-27T04:38:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fba25f192... |
55689b51-b196-4e49-b0da-8c3371a4e718 | makoto-nishimure/icpc | pra/1192/tax.cpp | #include <iostream>
using namespace std;
int main()
{
while (true) {
int x, y, s;
cin >> x >> y >> s;
if (x == 0 && y == 0) break;
//double t = x * 0.01;
//double t2 = y * 0.01;
int max = 0;
for (int i = 1; i < s; i++) {
for (int j = 1; j < s; j++) {
int a = i*(x*0.01);
int b = j... | ALGO | 0.999696 | 3.063003 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2017-05-30T10:36: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": "89e7ee79f... |
fb3fcf5b-d43d-4c18-a3be-cd6e880c64e4 | choijihyun/algorithms | icpc/MATCHORDER.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#pragma warning(disable: 4996)
using namespace std;
int n;
int team1[101];
int team2[101];
int rrank[101];
int win = 0;
void check() {
int idx2 = 0;
for (int i = 0; i < n; i++) { // team2
for (int j = idx2; j < n; j++) {
sort(team1, team1 + n);
if ... | ALGO | 0.999972 | 3.654705 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-01-08T09:25:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5e2508c58... |
ebb22695-7cbb-4111-a7c4-032851dc79fa | FedeGuastadisegni/Paso_2015 | Lista.cpp | /* TDA Lista
* Implementación Simplemente Enlazada
* Archivo : Lista.cpp
* Versión : 1.1
*/
#include "Lista.h"
/******************************************************************************/
/* Definición de Tipos de Datos para manejo interno */
/*--------------------------------------------------*/
/********... | ALGO | 0.996118 | 5.688659 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-18T19:28: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": "41eb6ac0a9... |
d7db6ed0-0d43-45b3-ac3d-04d13a675ae3 | envyaims/Programming-Contests | CALICO/2022/09.cpp | #include <bits/stdc++.h>
#ifndef LOCAL
#define debug(...) 0
#else
#include "C:\programmingfunnyxd\debug.cpp"
#endif
using namespace std;
using ll = long long;
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
const int MO... | ALGO | 0.999714 | 4.07072 | {
"github_metadata": {
"branch": "main",
"commit_count": 130,
"repo_created_at": "2022-05-07T23:58:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cacd04d5d... |
9e18f693-4601-4c9a-bd88-7f04dc33d255 | ReinaKousaka/Competitive-Programming-Starter | LeetCode/2538/2538.cpp | #include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
class Solution {
public:
long long maxOutput(int n, vector<vector<int>>& edges, vector<int>& price) {
// the end points of the path must be a leaf node or the root
vector<vector<int>> neighbors(n, vector<int>());
... | ALGO | 0.99992 | 5.249523 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2022-10-13T05:59:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11ec562dd7... |
221fd61b-67dd-4d4d-a8ff-4f015185429f | ingeniousname/3-SAT-solver | 3-SAT-solver/output.cpp | #include "output.hpp"
#include <iostream>
#include <fstream>
#include <filesystem>
void printOutput(const Output3SAT& output)
{
if (output.satisfied)
{
std::cout << "Clauses can be satisfied:\n";
for (int i = 0; i < output.valuation.size(); i++)
{
std::cout << i + 1 << " - " << (output.valuation[i] == VarSt... | TOOL | 0.930716 | 5.714181 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2025-03-04T14:21:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a4d70c37... |
d9eade45-2d66-49df-9b07-c4d82880a662 | eduardgagite/simple-navigator | src/functions/algorithms/s21_get_least_spanning_tree.cc | #include "../../s21_graph_algorithms.h"
#include <limits>
// https://www.youtube.com/watch?v=vPHUm874EoA
// https://ru.algorithmica.org/cs/spanning-trees/prim/
// http://e-maxx.ru/algo/mst_prim
namespace s21 {
Matrix GraphAlgorithms::GetLeastSpanningTree(Graph& graph) {
Matrix adjacency_matrix = graph.GetMatrix()... | ALGO | 0.999588 | 6.171148 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-29T16:25:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93d9bf94f20e... |
14cd75e0-5d45-443a-8847-f8fa447a321a | FastFilter/fastfilter_cpp | src/morton/compressed_cuckoo_config.h | /*
Copyright (c) 2019 Advanced Micro Devices, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | CONFIG | 0.934366 | 4.474799 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2018-11-07T20:48:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 280,
"forks": 30,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "b09db3... |
1246f5e0-8633-4df6-b0c8-a969b5d04675 | dew0209/Algor | acwing/course/high/4/239.cpp | //并查集
/*
L~R奇偶性相同,可以简化为 [1~R] 和 [1~L-1] 奇偶性相同。因为:奇数 - 奇数 = 偶数,偶数 - 偶数 = 偶数
L~R奇偶性不同,可以简化为 [1~R] 和 [1~L-1] 奇偶性相同。因为:奇数 - 偶数 = 奇数,偶数 - 奇数 = 奇数
设相同为0 不同为1.
那么:
d[x]表示x点,到连通块跟(p[u] = u)的路径异或值,也就是x和u的奇偶性。
为什么可以这样表示:
考虑所有可能性:
x y 相同 y z相同 那么x z相同 也就是 1 ^ 1,x z相同
... | ALGO | 0.999983 | 4.126238 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2021-09-20T11:43: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": "e99f9fb5... |
e07a2929-4ae7-4b4b-939f-7a2e709c5374 | dtcxzyw/OI-Source | Source/Competition/FCS2019/Day7/island.cpp | #include <cstdio>
#include <map>
const int size = 100005, mod = 998244353,
inv2 = (mod + 1) / 2, inv6 = (mod + 1) / 6;
typedef long long Int64;
Int64 sum1(Int64 x) {
return (x * (x + 1) / 2) % mod;
}
Int64 sum2(Int64 x) {
return x * (x + 1) % mod * (2 * x + 1) % mod *
inv6 % mod;
}
int dis(int... | ALGO | 0.999927 | 4.189385 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2018-07-11T09:33:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8497e9... |
b892050b-2bab-44f0-be31-5a79236f4612 | seri/topcoder | D1L1/Underprimes.cpp | #include <vector>
using namespace std;
int howMany(int A, int B) {
// a[i] is the number of prime factors of i
// if a[i] = 0, i is a prime
vector<int> a(B + 1, 0);
a[0] = a[1] = 1;
for (int i = 2; i <= B; ++i) {
if (a[i] == 0) {
for (int j = i + i; j <= B; j += i) {
... | ALGO | 0.999843 | 4.682332 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2011-08-21T02:39:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0e1307... |
071e63d1-7a12-4118-aabf-3f745ad89aa0 | misteraddy/Leetcode-Solutions | Trees/653-two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst.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.999997 | 6.92451 | {
"github_metadata": {
"branch": "main",
"commit_count": 923,
"repo_created_at": "2023-09-17T17:37: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": "0ff33880fc... |
9dea5f5c-a367-42b9-a5de-e20efaeb6cf4 | abhibansal530/Codes | codechef/amr14c.cpp | //<NAME>
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define TR(v,it) for( LET(it,v.begin()) ; it != v.end() ; it++)
#define loop(i,a,b) for(int i=a;i<b;i++)
#def... | ALGO | 0.999874 | 3.19802 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-03-22T19:52: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": "99c5f6f4e... |
3b54e1c6-69fb-4523-be30-d3649e61a94c | BornToDeath/cpp | algorithms/jzoffer2/JZ025_链表中的两数相加.cpp | //
// Created by lixiaoqing on 2023/4/21.
//
#include <iostream>
#include <vector>
#include <stack>
#include "ListNode.h"
class Solution {
public:
ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
/*
* 方法1: 先反转链表再相加
* 时间复杂度 O(m + n) , 空间复杂度 O(1)
*/
// l1 = reverseList... | ALGO | 0.99998 | 6.35729 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2021-10-28T03:47:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f987d81882... |
04493ecd-d14e-4513-9820-fd79f30fbf3a | MrSingh710/Programs | C++/Data_Structures_(College)/Week11/11_1.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this -> data = data;
left = NULL;
right = NULL;
}
};
// Function to calculate the height of a tree
int height(Node* root) {
if (root == nullptr)
... | ALGO | 0.999777 | 6.343315 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-12-13T14:11: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": "5d41150ea9d... |
2ce94352-3d65-4bc1-ab30-b73c596333c4 | RoboticExplorationLab/ALTRO | src/altro/altro_solver.cpp | //
// Created by <NAME> on 9/12/22.
// Copyright (c) 2022 Robotic Exploration Lab. All rights reserved.
//
#include "altro_solver.hpp"
#include "Eigen/Dense"
#include "altrocpp_interface/altrocpp_interface.hpp"
#include "solver/solver.hpp"
#include "utils/formatting.hpp"
namespace altro {
altro::ALTROSolver::ALTROS... | ALGO | 0.98722 | 6.794089 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-03-24T21:16:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 75,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "54ea0e9065... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.