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 |
|---|---|---|---|---|---|---|---|
abac7593-65c4-4e62-8f84-86b8e06389b7 | sendoru/ps-cpp-new | source/boj/20505.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll MOD9 = 998244353;
const ll MOD1 = (ll)1e9 + 7;
ll modpow(ll b, ll e, ll m) {
if (e == 0)
return 1;
if (e % 2)
return b * modpow(b, e - 1, m... | ALGO | 0.999979 | 4.817688 | {
"github_metadata": {
"branch": "main",
"commit_count": 130,
"repo_created_at": "2024-04-17T08:42: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": "1986a029e3... |
873ca36c-91a8-470a-afd2-a8343330017e | vrinda22/DS-ALGO | TREES/expression_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
string data;
struct node *left;
struct node *right;
node(string x) {
data = x;
left = NULL;
right = NULL;
}
};
bool isExpression(string &s) {
if (s == "+" or s == "-" or s == "*" or s == "/") return true;
... | ALGO | 0.999967 | 4.382428 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-06-09T18:02:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4697e7a10... |
d74fbf84-88e9-4d8a-8280-b3c4d17dc4f3 | kazuhayase/study | c++/pro-con/ch3/3.7-GCJ/WateringPlants.cpp | #include <cstdio>
#include <cmath>
#include <vector>
using namespace std;
typedef long long ll;
const int MAX_N = 40;
//INPUT
int N;
int X[MAX_N], Y[MAX_N], R[MAX_N];
// the set of circles which are covered by a circle centered (x,y) and radius r
ll cover(double x, double y, double r){
ll S=0;
for(int i=0; i<N;... | ALGO | 0.999503 | 3.801171 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2013-02-05T15:08: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": "096f802d... |
a198bfc5-d99e-4aa6-a647-78bfefc3de84 | ekkai/kocoafabLib | examples/스마트모빌리티키트/9. 코코캠(얼굴인식)/sm_faceTracker/sm_faceTracker.ino | #include <COCOCAM.h>
#include <Kocoafab_SmartMobility.h>
#include <SoftwareSerial.h>
COCOCAM cococam;
Kocoafab_SmartMobility sm = Kocoafab_SmartMobility();
SoftwareSerial BTSerial(4, 5);
void printResult(cococamResult result);
cococamResult result;
void setup() {
// 블루투스 통신과 시리얼 통신 속도 설정 9600bps
Serial.begin(96... | ALGO | 0.939661 | 5.387066 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-03-04T00: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": "993237c4030... |
5656624e-9b5a-470b-924e-174c6eacc03a | ishandutta2007/codeforces-y | yuma_/normal/1380/A.cpp | #include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#include<memory>
#pragma GCC optimize("Ofast")
#pragma GCC ... | ALGO | 0.999921 | 3.896782 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "a103dce5b29e... |
de66ba20-37c3-44f4-b936-d595e010adce | yigitcankzl/cses | Introductory Problems/24-Grid Path Description.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
int result = 0;
vector<pair<char, pair<int, int>>> directions = {{'U', {-1, 0}},{'D', {1, 0}},{'L', {0, -1}},{'R', {0, 1}}};
bool visited[7][7];
bool isValid(int x, int y) {
return x >= 0 && x < 7 && y >= 0 && y < 7;
}
void dfs(int x, int y, int ... | ALGO | 0.999917 | 4.153752 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2025-07-08T22:31: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": "8efaaae54f0... |
d942a9f5-365d-4b26-8ead-040ac3f75b74 | itsMadesh/CPP-programs | Lab-exercies/Exercise-5/1a.stack.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
int arr[10], itop, max;
public:
Stack()
{
itop = -1;
max = 10;
}
void push(int data)
{
if (itop == max - 1)
{
cout << "Stack is full";
}
else
{
itop +=... | ALGO | 0.995159 | 4.000904 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-31T18:10: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": "a752cd35d865... |
53be6f97-14c7-45da-a719-625d8320818b | diazona/SOLO | src/utils/utils.cpp | /*
* Part of oneloopcalc
*
* Copyright 2012 <NAME>
*
* 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, either version 3 of the License, or
* (at your option) any later version.
* This ... | TOOL | 0.943037 | 6.390517 | {
"github_metadata": {
"branch": "master",
"commit_count": 454,
"repo_created_at": "2013-09-09T08:25:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a1a676f... |
b6bd26c2-1b82-43eb-9420-67165b2684f0 | naveen-ku/Competitive-Programming | geeksforgeeks/majority_element.cpp | // Boyer moore voting algorithm
/*
https://practice.geeksforgeeks.org/problems/majority-element-1587115620/1/?problemStatus=unsolved&difficulty[]=-1&page=1&sortBy=submissions&query=problemStatusunsolveddifficulty[]-1page1sortBysubmissions#
*/
#include <bits/stdc++.h>
using namespace std;
int majorityElement(int a[], ... | ALGO | 0.999815 | 5.524049 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-20T03:02: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": "0dd07273184a... |
a727c943-d514-40c4-9d82-d4d8ed23f547 | diohabara/competitive_programming | ac/prev/abc067_b.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <functional>
using namespace std;
void bubbleSort(int A[], int N)
{
bool flag = 1;
for (int i = 0; flag; i++) {
flag = 0;
for (int j = N-1; j >= i + 1; j--) {
... | ALGO | 0.999973 | 3.992643 | {
"github_metadata": {
"branch": "master",
"commit_count": 407,
"repo_created_at": "2019-01-21T06:09: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": "5d837df1... |
ffb41b01-22f9-4fed-80df-6db3cd4454b7 | ahmadfajarprasetiyo/Online-Judge | Online Judge/UVA/Book 1/1. Introduction/10528.cpp | //
// 10528.cpp
// Online Judge
//
// Created by <NAME> on 28/08/18.
// Copyright © 2018 ITB. All rights reserved.
//
#include <iostream>
#include <set>
#include <map>
#include <string>
using namespace std;
string keys[14] = {"A", "B", "C", "D", "E", "F", "G", "A#", "B#", "C#", "D#", "E#", "F#", "G#"};
string ma... | ALGO | 0.998713 | 4.815958 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-08-23T06:47: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": "54d720b00... |
4d5e06b9-9bac-4082-b89c-d78666c0902c | noammirjani/Leetcode | cpp/other/shuffle.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999296 | 5.311881 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-09-02T10:41:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "545df590f66... |
d4be0b4f-f1ce-4881-9bcb-59295116bbcd | DeepkumarSingh/c_plus_plus-Concepts_plus_DSA- | Arrays /leetcode problem - duplicate.cpp | # You are given an array ‘ARR’ of size “N' containing each number betweer 1 and 'N’ - 1 at least
once. There is a single integer value that is present in the array twice. Your task is to find the
duplicate integer value present in the array.
For example:
Consider ARR = [1, 2, 3, 4, 4], the duplicate integer value pre... | ALGO | 0.999631 | 5.512901 | {
"github_metadata": {
"branch": "main",
"commit_count": 259,
"repo_created_at": "2023-08-07T18:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "600b20d231... |
798fc754-ead3-4f55-82e4-14105560f3e1 | cms-sw/cmssw | HLTrigger/JetMET/plugins/HLTJetHbbFilter.cc | /** \class HLTJetHbbFilter
*
* See header file for documentation
*
* \author <NAME>
*
*/
#include <cmath>
#include <string>
#include <vector>
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/MessageLogger/int... | ALGO | 0.956187 | 5.172662 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
3826d7bf-ca57-4753-8ca5-04c759bdb306 | buiquangvinh9a4/programming-techniques | Backup/KTLT/Chuong 3/Bai tap ve nha 1/bai3-4.cpp | #include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <iomanip>
#include <conio.h>
#include <iomanip>
using namespace std;
#define size 100
//-------------------- Ham in ra duong ke line
void line() {
cout << "-----------------------\n";
}
//--------------------- Ham tao khoang ran... | TOOL | 0.966572 | 3.808698 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-16T16:04:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "461e2efecba8... |
9132599f-d938-4675-bd77-f0f50bbcdedc | Hanjun-Dai/graph_comb_opt | code/s2v_scp/setcover_lib/src/setcover_lib.cpp | #include "config.h"
#include "setcover_lib.h"
#include "graph.h"
#include "nn_api.h"
#include "qnet.h"
#include "nstep_replay_mem.h"
#include "simulator.h"
#include "setcover_env.h"
#include <random>
#include <algorithm>
#include <cstdlib>
#include <signal.h>
using namespace gnn;
void intHandler(int dummy) {
exit... | ALGO | 0.983596 | 4.488959 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-05-27T02:14:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 507,
"forks": 137,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "14f1... |
5c2a759d-5f9e-4fea-9c7b-5899e14a2efa | TaoSama/ICPC-Code-Library | ACM - Onsite Contests/2016 Regional/Dalian Online/HDU 5876.cpp | //
// Created by TaoSama on 2016-09-10
// Copyright (c) 2016 TaoSama. All rights reserved.
//
#pragma comment(linker, "/STACK:102400000,102400000")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#i... | ALGO | 0.999965 | 3.638159 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2016-03-24T05:56:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60f409cf... |
929f69b2-5775-49f9-89b9-240f44e22abf | mohitkadwe19/geeksforgeeks-solution | satisfy-the-equation.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<int> satisfyEqn(int A[], int N)
{
vector<int> ans;
// equation A + B = C + D
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
for (int k = 0; k < N; k++)
{
for (int l = 0; ... | ALGO | 0.999889 | 4.004889 | {
"github_metadata": {
"branch": "main",
"commit_count": 411,
"repo_created_at": "2022-10-16T16:14:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "470795f75c... |
e1c27e40-275a-4969-b182-ce0b61114869 | nahmedwias/MyMooNMD | include/ReducedOrderModels/POD.h | /** ****************************************************************************
*
* @name POD
* @brief Computation/manipulation of POD basis
* independently of problem dimension
*
* @author <NAME> & <NAME>
* @date 08.03.2017 (start of implementation), 15.1.2019 (restart)
*
***********... | TOOL | 0.964044 | 5.857697 | {
"github_metadata": {
"branch": "master",
"commit_count": 2296,
"repo_created_at": "2019-03-06T06:55:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07a2545... |
e89586e8-2b7d-4f1a-bda7-b4ad5e0f52fd | NexuaX/jipp2 | lab2/zad3.cpp | #include <iostream>
#include <cstring>
using namespace std;
void mySwap(int&, int*);
int main(int argc, char const *argv[]) {
if (argc == 2 && strcmp(argv[1], "--help") == 0) {
cout << "Usage: zad3" << endl;
cout << "Swaps int numbers if the second one is smaller" << endl;
cout << "(... | ALGO | 0.995081 | 4.947653 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-10-18T20:08: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": "9224a671f... |
b8fc0290-8dac-4959-a2d0-59e7b93000ff | hossamsalah22/DataStructure-Labs | D02/ShiftQuoue/main.cpp | #include <iostream>
using namespace std;
class ShiftQueue
{
int *data;
int size;
int back;
int elementCount;
public:
ShiftQueue(int _size)
{
if(_size < 0)
{
_size = 5;
}
size = _size;
data = new int[size];
back = -1;
elementCo... | ALGO | 0.978535 | 3.937468 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-07T16:59: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": "0b44bc8698a2... |
7f22c8de-51b3-4490-82a3-7c2a54541304 | stellaseahll/DS-Algo-Practice | UVa-Solutions/10880.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <stdio.h>
#include <iomanip>
#include <string>
#include <map>
#include <string.h>
#include <utility>
#include <cstdlib> // for atoi
#include <sstream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int n;
long C, R;
... | ALGO | 0.999738 | 3.138883 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-11-20T08:26: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": "a16ee0872... |
589fb1ae-55e3-4d8d-ac43-07ffb85f60d4 | nprestine/hw4 | avlbst.h | #ifndef RBBST_H
#define RBBST_H
#include <iostream>
#include <exception>
#include <cstdlib>
#include <cstdint>
#include <algorithm>
#include "bst.h"
struct KeyError { };
/**
* A special kind of node for an AVL tree, which adds the balance as a data member, plus
* other additional helper functions. You do NOT need to... | ALGO | 0.9776 | 6.598375 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-11-03T20:24: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": "f142744d334e... |
ef2d2417-4444-465c-aa2f-a0c94ee98042 | Eduard953/CPP | cp09/ex01/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | ALGO | 0.993555 | 5.101965 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-04-11T16:30:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8370c387b1d... |
eb0c1c5c-a522-45b0-a2b9-3d9bac9ef71c | isopropylcyanide/Competitive-Programming | code-cpp/linear_sort.cpp | #include <bits/stdc++.h>
using namespace std;
#define bit(x,i) (x&(1<<i)) //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max3(a,b,c) (a,max(b,c))
#define... | ALGO | 0.999585 | 3.927088 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2015-12-31T07:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ec887... |
34a9fc83-e396-44d8-bc72-a75ef9ac96b3 | Nitinkumar3399/Operating-System-Programs | FCFS_Scheduling.cpp | // C++ implementaion of FCFS CPU Scheduling Algorithm.
#include <iostream>
#include<vector>
#include <algorithm>
#include <iomanip>
using namespace std;
struct process {
int pid;
int arrival_time;
int burst_time;
int start_time; // Time at which process gets CPU first Time.
int completion_time;... | ALGO | 0.999796 | 5.906784 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-07-20T10:21:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cd51a56142c... |
64aca10d-52bf-4206-9de5-e2a325c50e92 | NirbhaySirsikar/MyPrograms | Binary Tree/LargestBSTinBT.cpp | #include <bits/stdc++.h>
#include "binaryTree.cpp"
using namespace std;
struct Info
{
int size;
int min;
int max;
int ans;
bool isBST;
};
Info LargestBST(node *root)
{
if (root == NULL)
{
return {0, INT_MAX, INT_MIN, 0, true};
}
if (root->right == NULL && root->left == NULL)... | ALGO | 0.999895 | 4.489221 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-07-08T11:43:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abb895c5f042... |
b6987653-5c3b-49ae-9fd9-25aa77a6812a | AlexanderKruk/Think-Like-a-Programmer | 4/src/tasks/4_3.cpp | #include <iostream>
using namespace std;
#include <cstring>
char const * replaceString(char const * source, char const * target, char const * replaceText);
void testReplaceString();
void resize(char* &arr, int size, int increase);
int main() {
testReplaceString();
}
char const * replaceString(char const * source... | ALGO | 0.900051 | 3.62314 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2019-04-05T06:25:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "730db7b3e... |
e9c7da15-cb7e-48ef-85fe-a7025a706408 | hereismari/Programming | online_judges/Spoj/KGSS/code.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
#define MAXN 100100
#define INF 1000001000
int n, a[MAXN];
int b, c, d , i, m, x;
char op;
struct data {
int greater, greater2, ans;
};
data t[2000000];
data combine (data l, data r) {
data res;
res.gre... | ALGO | 0.999898 | 5.047647 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2015-05-20T19:54:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ae640b... |
334c9b88-4774-4d44-8ac8-aee0f053eefe | applied-systems-biology/misa-framework | src/misaxx-imaging/include/misaxx/imaging/utils/misc.h | /**
* Copyright by <NAME>
* Research Group Applied Systems Biology - Head: Prof. Dr. <NAME>
* https://www.leibniz-hki.de/en/applied-systems-biology.html
* HKI-Center for Systems Biology of Infection
* Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Insitute (HKI)
* Adolf-Reichwei... | TOOL | 0.964609 | 6.050362 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2019-04-15T15:27:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "015a0ed0... |
7f6c3872-5160-48a0-9797-0536967d2617 | EnnSou/ooss-paddle2.3 | paddle/fluid/operators/lstsq_op.cc | // Copyright (c) 2021 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... | CONFIG | 0.934117 | 6.973252 | {
"github_metadata": {
"branch": "air",
"commit_count": 35433,
"repo_created_at": "2022-07-29T08:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9df8590d5... |
5357757e-2e41-44fd-8d23-344e50513f04 | Biditmangal/CompetitiveProgramming | CodeForces/CodeForces Contests/Codeforces 701/1485A.cpp | #include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <... | ALGO | 0.999821 | 4.17697 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2020-01-07T08:23:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa376ac6... |
1ac01497-677e-403f-9d20-c59e45bca694 | ishandutta2007/codeforces-m | mnaeraxr/normal/1229/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int64;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef bitset<120> mask;
// typedef int64 mask;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const int mod = 1000000007;
int to[120][120];
map<vector<int>,int> perm_ix... | ALGO | 0.999881 | 3.528122 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "81117c113080... |
a330005f-7b58-4ab0-b8b7-f895c75c3dec | trongtn2110/NMLT_IT001 | thuattoan2/thuattoan2.cpp | // thuattoan2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include<ctime>
using namespace std;
void Nhap(int a[], int& n)
{
srand(time(NULL));
cout << "n?";
cin >> n;
for (int i = 0; i < n; i++)
{
a[i] = rand() % 50 + 1;
}
}
void Xuat(int a[], ... | ALGO | 0.999124 | 3.977766 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-09-27T08:55: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": "e6b2a034e... |
a5c2170d-9551-4494-8a4d-933ffeb4dda2 | nabobery/PROJECT-MADS | LeetCode/1601 - 1700/1630.cpp | // 1630. Arithmetic Subarrays
// Solution 1 using Priority queue
// Time complexity: O(m*nlogn)
// Space complexity: O(n)
class Solution {
public:
bool helper(priority_queue <int, vector<int>, greater<int>> pq){
if(pq.size() < 3) return true;
bool b = true;
int p = pq.top();
pq.pop(... | ALGO | 0.999962 | 6.508324 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2022-03-04T16:30: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": "6b3e6f3480... |
53870a6c-427c-4a96-a6f0-9464c5f09976 | Corsage/interview-ready | leetcode/Two Sum IV/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.646815 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2020-11-13T18:01: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": "8b0f14d6fd8... |
6d7f0a93-bb45-4e32-97e5-c5a76c28c01e | nehcoah/algorithm-template | atcoder/abc/351/d.cpp | //#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
const int dirs[4][2] = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
int h, w;
cin ... | ALGO | 0.999955 | 4.425903 | {
"github_metadata": {
"branch": "main",
"commit_count": 591,
"repo_created_at": "2023-09-11T02:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afc7466e31... |
8da32706-55e8-4785-bd02-13d9c817e043 | fnalacceleratormodeling/synergia2 | examples/normal_form/normal_form.cc |
#include "synergia/lattice/madx_reader.h"
#include "synergia/simulation/independent_stepper_elements.h"
#include "synergia/simulation/lattice_simulator.h"
#include "synergia/simulation/propagator.h"
#include "synergia/utils/utils.h"
#include <iostream>
static constexpr int order =
3; // higher orders use more memo... | ALGO | 0.99007 | 4.615892 | {
"github_metadata": {
"branch": "devel3",
"commit_count": 6703,
"repo_created_at": "2022-02-02T20:12:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 17,
"pull_requests": 9
},
"file_meta": {
"content_id": "b13dea... |
d4066891-ca99-4435-9424-9e9739753da2 | MinumCoklatPanas/CF-Repo | atcoder/dp/I.cpp | #include <bits/stdc++.h>
using namespace std;
double DP[2][3010][3010];
double val[2][3010];
int n;
double rec(int state,int index,int nyala,int mati)
{
// cout << state << " " << index << " " << nyala << " " << mati << endl;
if (DP[state][index][nyala] != -1.0) return DP[state][index][nyala];
if (index == n)
{
... | ALGO | 0.999833 | 3.705302 | {
"github_metadata": {
"branch": "master",
"commit_count": 1426,
"repo_created_at": "2020-12-20T23:27:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "798eabf... |
0a41c9cf-8830-4dbe-a956-bb45f349fa5d | pleasemarkdarkly/iomega_hipzip | pogo/player/main/util/datastructures/current/include/SortList.h | //
// SortList.h
//
// Copyright (c) 1998 - 2001 Fullplay Media Systems (TM). All rights reserved
//
// This file was distributed as part of the Dadio (TM) Software Development Kit
// under the Dadio (TM) Software Development Kit license. Please see the file
// "Dadio Software Development Kit license agreement.... | ALGO | 0.994477 | 6.77022 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-07T06:25:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "785b1241fd... |
b50f1fcc-fe2a-44a7-b337-9e64b0ba73fd | TINABJan254/DSA_CodePTIT | QuyHoachDong/DSA05014_CatalanNumber.cpp | #include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORD(i, a, b) for(int i = a; i >= b; i--)
#define F(i, a, b) for(int i = a; i < b; ++i)
#define FD(i... | ALGO | 0.99995 | 4.643809 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2024-01-16T14:47: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": "7adaf8856... |
bb5eef09-20e6-4b48-991b-874b9a465f8e | UtkarshTrivedi2934/LoveBabbar450 | Game with String.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int minValue(string s, int k){
// code here
int n = s.size();
int freq[26] = {0};
priority_queue<int> pq;
... | ALGO | 0.999879 | 5.662846 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-03-16T05:16:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0e6e44144ff... |
8e5f2ed7-40ca-459b-a044-a4cf1401b736 | KatarinaBakic/Projektivna-geometrija | src/main.cpp | #include <iostream>
#include <GL/glut.h>
#include <cmath>
#include <Eigen/Dense>
#include <Eigen/Geometry>
using Eigen::MatrixXf;
MatrixXf p1(1, 3), p2(1, 3), q1(1, 3), q2(1, 3);
static int window_width, window_height;
static int timer_active = 0 ;
static float timer = 0;
double parametar_max = 50;
static void ... | ALGO | 0.96454 | 4.202721 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-12-22T22:32: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": "b3685aa695... |
80099902-25e2-4079-abac-7f2db641a003 | study84/mdpu | Курс_1/C++/Семестр-2/C1S2_Lesson_17_STL_list.cpp | #include <windows.h>
#include <iostream>
#include <list>
#include <string>
#include <algorithm> // fro sort
#include <numeric> // accumulate
using namespace std;
int main()
{
SetConsoleOutputCP(1251);
list<string> names;
list<string> sayings(20, "AAA");
cout << names.size() << endl;
cout <... | TOOL | 0.952764 | 3.620486 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-12-10T15:08: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": "c55f6864021... |
57eda22f-5b7e-4776-aabe-f103569ed043 | kranthikumar786/leetcode-dsa | 1421-find-numbers-with-even-number-of-digits/1421-find-numbers-with-even-number-of-digits.cpp | class SegmentTree {
vector<int> tree;
int n;
int isEvenDigit(int num) {
int count = 0;
while (num) {
count++;
num /= 10;
}
return count % 2 == 0;
}
void build(const vector<int>& nums, int node, int start, int end) {
if (start == end) ... | ALGO | 0.999936 | 5.82233 | {
"github_metadata": {
"branch": "main",
"commit_count": 2930,
"repo_created_at": "2022-12-01T07: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": "fc039eada... |
772e5318-6ec5-4f63-a3ea-2143aeddd850 | ak8415129/leetcode-GFG | Difficulty: Easy/Missing in Array/missing-in-array.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
// Note that the size of the array is n-1
int missingNumber(int n, vector<int>& arr) {
// Your code goes here
... | ALGO | 0.999677 | 5.129841 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2023-04-09T15:13: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": "1669a947b2... |
0252ee76-cbbe-4896-8b96-4dbab8731b72 | srushti-03/AU2140117_SRUSHTI_THAKAR_DSA | Lab2-Arrays&lists/ques10.cpp | // AU2140117 <NAME> DATA STRUCTURES AND ALGORITHMS
// LAB 2
//ques -10: to replace an element at a given position in a linked list.
#include<iostream>
using namespace std;
class node{
public:
int data;
node*next;
node(int value){
this->data=value;
this->next=NULL;
}
};
void ins... | ALGO | 0.999875 | 5.049469 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-08-19T10:48: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": "a33c33ee43c... |
6b36952a-4b8e-4e3a-9900-d859b7edafe5 | rushiu/CVprojects | Project1/o.cpp | //Run by entering 2 commands: g++ -o name name.cpp then, ./name
/*
--------PLANNING--------
points cases:
1. (x1<x2) & (y1<y2)
2. (x1<x2) & (y1>y2)
3. (x1>x2) & (y1<y2)
4. (x1>x2) & (y1>y2)
2&3 1&4 same
https://www.easycalculation.com/analytical/learn-triangle-incenter.php
1) get lines to work-> get triangle to wo... | ALGO | 0.998915 | 4.631485 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-09-04T04:09: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": "5347f334f... |
4ffbc936-d879-404b-a00b-54d771e22ff9 | Varlamov-AM/Code_of_future_2022_2023_cplusplus | Term_1/Lesson_04_21_11_2022/Class_work/Class-4.5.cpp | #include <iostream>
int main(){
int n;
std::cin >> n;
int num[n];
for (int i = 0; i < n; ++i){
std::cin >> num[i];
}
int new_num[n];
int count = 0;
for (int j = 0; j < n; ++j){
if (num[j] % 3 == 0){
new_num[count] = num[j];
count++;
... | ALGO | 0.999643 | 3.99651 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-11-08T19:16: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": "bda4a4c20eb... |
78a4c086-ba43-40d8-8ccd-db0f84563203 | victordamatta/Maratona | uVA/electricity.cpp | #include <iostream>
#define all(x) x.begin(), x.end()
using namespace std;
typedef int num;
//REMEMBER TO DECLARE GLOBAL VARIABLES
int n, e, ans, ans2;
int m[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int mb[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
long long int d1, d2;
struct date{
int da... | ALGO | 0.999906 | 3.546508 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2015-07-12T16:17: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": "7a0be524... |
d6975261-3b6b-4e02-9469-9e56e1d85fdf | rainbow-auto/rainbow-codes | Luogu/P1269.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize(2)
using i64 = long long;
using f64 = long double;
#define fastread std::ios::sync_with_stdio (false); std::cin.tie(nullptr);
#define rep(QWQ, qwq, qaq) for (i64 QWQ = (qwq); (QWQ) <= (qaq); QWQ++)
#define per(QWQ, qwq, qaq) for (i64 QWQ = (qwq); (QWQ) >= (qaq); QWQ--... | ALGO | 0.999949 | 4.049141 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2024-09-07T02:10:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f451042f... |
bebdc206-e3cf-449f-8ed7-4a600d56127d | Akash2172/Competitive-Programming | HackerRank/Problem-Solving/CavityMap.cpp | /*<NAME> LPU */
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vc = vector<char>;
using vs = vector<string>;
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
#define fob(i,a,n) for(int i=a;i<n;i++)
#define invec(v,n) vll v(n);for(in... | ALGO | 0.999947 | 3.860935 | {
"github_metadata": {
"branch": "main",
"commit_count": 211,
"repo_created_at": "2020-11-12T15:30:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51bf9c2986... |
307c327a-0fa8-44f0-8cf3-d43e333c7207 | abtinahmdi/olympiad-codes | not shading.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define f first
#define s second
#define pll pair<ll, ll>
using namespace std;
const int N = 1e5 + 5;
const ll mod = 1e9 + 7;
ll t, n, m, r, c, res;
char s;
bool b = false;
void in(){
}
void solve(){
cin >> n >> m >> r >> c;
res = 2;
for(int i = 1;i <... | ALGO | 0.999303 | 3.725931 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-08-13T15:48: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": "cc20f817ea65... |
ab40cf97-811c-4052-8c65-ba10df04a571 | dmaman86/algo-solutions | problems/graphs/detect_arbitrage/cpp/detect_arbitrage.cpp | #include "detect_arbitrage.h"
#include <cmath>
#include <limits>
bool detectArbitrage(const std::vector<std::vector<double>> &exchangeRates) {
int n = exchangeRates.size();
std::vector<std::vector<double>> logExchangeRates(n, std::vector<double>(n));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j... | ALGO | 0.992842 | 5.871072 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-12-23T09:21:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "054f59e7611... |
b842dd52-5a72-4732-9798-7dd7580c1977 | GANES2/01_Pengenalan_CCP_Bagian_1 | Unguided.cpp | #include <iostream>
using namespace std;
/*int main() {
// Deklarasi variabel
float a, b;
// Input dari user
cout << "Masukkan angka pertama: ";
cin >> a;
cout << "Masukkan angka kedua: ";
cin >> b;
// Operasi matematika
cout << "Hasil penjumlahan: " << a + b << endl;
cout << ... | ALGO | 0.986486 | 3.733127 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-30T14:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84277283e740... |
63a22024-8db5-4180-97e0-63e749333492 | denis-sumin/DV-to-MOV-converter | bin/deinterlacers/mvtools-v2.5.11.3/Sources/MVAnalyse.cpp | // MVTools
// 2004 Manao
// Copyright(c)2006-2009 <NAME> Fizick - true motion, overlap, YUY2, pelclip, divide, super
// General classe for motion based filters
// See legal notice in Copying.txt for more information
// This program is free software; you can redistribute it and/or modify
// it under the terms of the G... | TOOL | 0.920362 | 4.215921 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-01-07T19:19:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fb57b955... |
9e4fd14b-292f-44bc-b574-a9f11dbdd8b4 | jhu-cisst/cisst | cisstStereoVision/code/trackers/cisst/svlTrackerCisstWSSD.h | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
/*
Author(s): <NAME> (?)
Created on: 2007
(C) Copyright 2006-2007 Johns Hopkins University (JHU), All Rights
Reserved.
--- begin cisst licen... | ALGO | 0.998447 | 5.441084 | {
"github_metadata": {
"branch": "main",
"commit_count": 4711,
"repo_created_at": "2014-03-12T21:45:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 69,
"forks": 45,
"issues": 22,
"pull_requests": 1
},
"file_meta": {
"content_id": "27c483f... |
0c0fbfad-a31b-4236-9cf4-54058415bd1d | shivanshsanoria1/LeetcodeSolutions | CPP [1001-1500]/1260.shift_2D_grid [3].cpp | class Solution {
public:
void shiftKTimes(vector<int>& arr, int k){
// reverse the entire array
reverse(arr.begin(), arr.end());
// reverse the array from 0 to k-1
reverse(arr.begin(), arr.begin() + k);
// reverse the array from k to n-1
reverse(arr.begin() + k, arr.e... | ALGO | 0.999924 | 6.294661 | {
"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": "c0bac3355e... |
fe764e38-7ab9-4cd6-ad98-2079eac4530e | XDKaren/FMPH291_SP23_F00_k7hu | homeworks/Rcpp/threeVectors.cpp | #include <Rcpp.h>
using namespace Rcpp;
// Demonstrate how to `Vectorize' 2 arguments.
// Print the indexes and the element indexed.
// `void' type needs no `return' statement
// Rprintf is described in Writing R Extensions Section 6.5 Printing
void print2Values( int i, int ix, int iy, double xelt, double yelt) {
Rpr... | TOOL | 0.931969 | 6.368103 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-04-06T21:14: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": "d9eef009529... |
42fa7195-4625-4749-8184-3ee1d1eba604 | ahmadia/elemental | tests/core/AxpyInterface.cpp | /*
Copyright (c) 2009-2012, <NAME>
Copyright (c) 2011, The University of Texas at Austin
All rights reserved.
This file is part of Elemental.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistri... | TOOL | 0.939732 | 5.810672 | {
"github_metadata": {
"branch": "master",
"commit_count": 564,
"repo_created_at": "2012-05-06T08:22:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2abce2c... |
69bac09c-2a64-4ee3-a9f5-03e399fffd5b | dtarb/TauDEM | src/PeukerDouglasmn.cpp | /* PeukerDouglas main program for function that operates on an elevation grid and outputs an
indicator (1,0) grid of upward curved grid cells according to the Peuker and
Douglas algorithm.
<NAME>
Utah State University
May 23, 2010
*/
/* Copyright (C) 2010 <NAME>, Utah State University
This pr... | ALGO | 0.993892 | 3.907103 | {
"github_metadata": {
"branch": "Develop",
"commit_count": 325,
"repo_created_at": "2013-03-12T18:47:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 255,
"forks": 119,
"issues": 80,
"pull_requests": 10
},
"file_meta": {
"content_id": "e... |
160b8338-90ea-4b87-abfd-e153ea717d33 | devesh-tewari/2Dmatching | interface.cpp | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <stdlib.h>
#include <time.h>
#include "2D-matching-algos.h"
#include "test.h"
using namespace std;
int* dimensions = new int[2];
vector< vector<matrixType> > text;
vector< vector<matrixType> > pattern;
vector< pair<int,int> > matches;... | ALGO | 0.961781 | 3.252668 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-10-25T12:08: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": "67a1b3ec6... |
9ae3db30-feb7-4514-89a7-0cca88b3111d | Juanseco199/UMNG | 04-20-21/Ejercicio 3.cpp | /*
Se tienen tres arreglos M, N y Z de 10 elementos cada uno. Guardar en Z la suma de los
elementos correspondientes de los arreglos M y N
Autor: <NAME>
Fecha: 20/04/2021
*/
#include <iostream>
#include <time.h>
#include <locale>
using namespace std;
int main()
{
system("color a");
setlocale(LC_ALL, "");
... | ALGO | 0.978611 | 4.785537 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-06T00:43: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": "591b54194c8e... |
6f14039d-9b4a-4244-9d93-4499da49877c | gumaonelove/software-engineering | programming_kai/5_laba/33/myfuncs.cpp | //
// Created by <NAME> on 16.05.2022.
//
#include <iostream>
#include <string>
#include <vector>
#include <limits>
#include <fstream>
#include "myfuncs.h"
std::string to_binary_string(unsigned long long n)
{
if (n < 0)
n *= -1;
std::string buffer; // символы ответа в обратном порядке
// выделим ... | ALGO | 0.99638 | 3.948397 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-08-12T15:53:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a612e36636ac... |
b24e0486-e8cb-4600-9ecf-d0c442d513e6 | zhenkewu/slamR | src/slamR.cpp | // [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
using namespace arma;
//' get ideal response for DINA
//'
//' replace Z by 1-Z and 1- the resultant matrix gives the
//' ideal response matrix for DINO
//'
//' @param Q Q matrix of size J by K
//' @param Z latent att... | ALGO | 0.949515 | 5.934345 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-02-14T06:11: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": "d38705a1f... |
3df9532f-4cfc-44e3-9928-ba2c5e74997d | mrsac7/CSES-Solutions | src/1677 - Network Breakdown.cpp | /*
Problem Name: Network Breakdown
Problem Link: https://cses.fi/problemset/task/1677
Author: <NAME> (mrsac7)
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const int mxN = 200005;
int len[mxN], par[mxN];
void init() {
for (int i = 1; i < mxN; i++)
len[i] = 1, par[... | ALGO | 0.999997 | 4.141547 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-05-06T08:18:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 394,
"forks": 157,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "19bfe... |
74473d29-70a9-46f2-b15a-af0b0657eeac | lucasxia01/Competitive-Programming-Problems | Codeforces/Ed CF 156/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define F0R(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = ... | ALGO | 0.999999 | 3.427437 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2018-10-14T07:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bcdb0c3... |
05f7d89c-5f80-4325-90ab-6a2e51ec5fa0 | tgautam03/earthquake.cpp | src/Wave3D.cpp | #include "../include/Wave3D.hpp"
Wave3D::Wave3D(float xs_, float xe_, unsigned long nx_,
float ys_, float ye_, unsigned long ny_,
float zs_, float ze_, unsigned long nz_,
float ts_, float te_, float nt_): xs(xs_), xe(xe_), nx(nx_),
ys(ys_), ye(ye_), ny(ny_),
zs(zs_), ze(ze_)... | ALGO | 0.999143 | 3.784057 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2025-03-24T22:16:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d38843e376... |
c4d6c1e3-afa2-45e7-8ccc-44b94e33595e | Sakshi19Naruka/-CrackYourInternship | BFS of graph - GFG/bfs-of-graph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return Breadth First Traversal of given graph.
vector<int> bfsOfGraph(int V, vector<int> adj[]) {
// Code here
vector<int> bfs;
vector<int> vis(V+1, 0);... | ALGO | 0.999923 | 6.556391 | {
"github_metadata": {
"branch": "main",
"commit_count": 504,
"repo_created_at": "2022-05-20T04:37: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": "a366e99149... |
7811950b-cb81-485f-9a65-56de94687ac1 | KanZhang23/Tmass | src/npstat-4.9.0/npstat/stat/LOrPEMarginalSmoother.hh | #ifndef NPSTAT_LORPEMARGINALSMOOTHER_HH_
#define NPSTAT_LORPEMARGINALSMOOTHER_HH_
/*!
// \file LOrPEMarginalSmoother.hh
//
// \brief LOrPE adapter for automatic smoothing of 1-d marginals
//
// Author: <NAME>
//
// March 2013
*/
#include "npstat/stat/AbsMarginalSmootherBase.hh"
#include "npstat/stat/BoundaryHandling.... | ALGO | 0.987772 | 6.41909 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-04T20:52: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": "68f604bc1b... |
6ae01271-c820-43b5-8129-6fddfb91855a | RamazanFIT/algorithms | 7/t4.cpp | /*
Bismillah
لا إله إلا الله محمد رسول الله
Al'-Phatixa
بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ
ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
مَٰلِكِ يَوْمِ ٱلدِّينِ
إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ
ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ
صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱ... | ALGO | 0.999987 | 4.786636 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-12-29T18:05: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": "b7bb57c33b1... |
194a15d3-51b6-4b0d-962b-c02f069ad0aa | milesfromhere/OAIP_2_sem | лаб 7/dop7_10/main.cpp | #include <iostream>
#include "stack.h"
#include <windows.h>
int main() {
setlocale(LC_ALL, "rus");
SetConsoleOutputCP(1251);
SetConsoleCP(1251);
Stack stack;
int choice;
int data;
int start, end;
const char* fileName = "stack_data.txt";
do {
std::cout << "\n1. Добавить элем... | TOOL | 0.977859 | 5.074784 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-03T12:41: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": "d520f767474a... |
86dfff8b-03ec-49e2-a114-9c94db2d9e0a | ishandutta2007/codeforces-k | karuna/normal/1556/C.cpp | #include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef long long lint;
typedef pair<int, int> pint;
const int M = 1e3 + 10;
lint n, A[M];
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> A[i];
if (i % 2... | ALGO | 0.999885 | 3.73856 | {
"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": "219761d6c0b6... |
7fb72070-72e2-4d39-92d2-7a49366a4346 | BryceLoski21/MarkDown | 077500/code/BinarySearchTree/AVLBST.cpp | #include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <assert.h>
#include <stdbool.h>
//typedef int ElemType;
typedef int KeyType;
typedef int Status;
#define OK 1
//#define TRUE 1
//#define FALSE 0
typedef enum {TRUE=1, FALSE=0}Boolean;
#define OVERFLOW -2
#define MAXSIZE 100
#define LT(a, b) ((a) < (b... | ALGO | 0.999966 | 4.221784 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2021-11-19T06:14: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": "4b0bed36ad... |
91359282-21e7-453a-b130-a383f74e5fdd | michal367/Algorithms-and-Data-Structures | algorithms/strings/large numbers/multiplying/multiplying_large_numbers2.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
string add(string a, string b)
{
string result;
int zeros;
for(zeros=0; a[zeros] == '0'; ++zeros);
a.erase(0,zeros);
for(zeros=0; b[zeros] == '0'; ++zeros);
b.erase(0,zeros);
while(a.size() > b.size())
b = '0' + b;
... | ALGO | 0.999706 | 3.992898 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-10-27T23:35:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a00bfbc159... |
797832bd-4384-450b-aed9-3a1bcbdae65e | miyamotononno/atcoder | DP_Contest/EDPC/j.cpp | #include <cstring>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
typedef long long ll;
using namespace std;
const... | ALGO | 0.999106 | 3.881451 | {
"github_metadata": {
"branch": "master",
"commit_count": 327,
"repo_created_at": "2019-05-17T08:11: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": "4d153a85... |
efb25629-7c54-4e5a-889e-8f597291eb4f | jzijin/target_to_offer | 重建二叉树.cpp | /**
* * Definition for binary tree
* * struct TreeNode {
* * int val;
* * TreeNode *left;
* * TreeNode *right;
* * TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* * };
* */
class Solution {
public:
TreeNode* reConstructBinaryTree(vector<int> pre,v... | ALGO | 0.999985 | 5.989954 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-25T13:38: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": "e3055133d9... |
7007f1b1-7d3c-4ad0-83ee-8e243d75e88c | raincross7/code-similarity | codes/train_code/problem304/problem304_212.cpp | #include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64... | ALGO | 0.999974 | 3.885437 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bfc15ec5c35... |
b4ab9b76-f360-469b-8a75-2b34fbf9cbc4 | GaussGreen/old-code | arm/Credit/ICMKernel/pricer/icm_pricer_analytic_cdo2_smile.cpp | #include "firsttoinc.h"
//#include "ARMKernel\glob\armglob.h"
#include "ICMKernel\pricer\ICM_Pricer_analytic_cdo2_smile.h"
//#include "ICMKernel\pricer\ICM_Pricer_homogeneous_smile.h"
//#include "ICMKernel\glob\icm_smile_correlation.h"
#include "ICMKernel\inst\icm_nthtd.h"
#include "ICMKernel\inst\icm_cdo2.h"
#include ... | ALGO | 0.967571 | 4.799388 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-17T09:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3423bb964f0d... |
33a1f1de-2a59-43d1-b814-d39c37538ff8 | junes7/python_algorithm | 백준/Silver/2910. 빈도 정렬/빈도 정렬.cc | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
bool cmp(pair<int, pair<int, int>> &a, pair<int, pair<int, int>> &b) {
if (a.second.first == b.second.first) return a.second.second < b.second.second;
return a.second.first > b.second.first;
}
int main(void) {
int... | ALGO | 0.999993 | 3.20125 | {
"github_metadata": {
"branch": "master",
"commit_count": 5511,
"repo_created_at": "2021-01-25T13:46:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6610240... |
a5cb16ec-0db7-44a9-9191-cf3f34859d0e | czhang2718/cp-templates | segtree/add_max.cpp | struct segtree{
vector<ll> op, mx;
int n;
segtree(int n){
this->n=n;
op.resize(4*n);
mx.resize(4*n);
}
void push(int x, int lx, int rx){
if(rx-lx==1 || !op[x]) return;
op[2*x+1]+=op[x];
mx[2*x+1]+=op[x];
op[2*x+2]+=op[x];
mx[2*x+2]+=op[x];
op[x]=0;
}
void add(int l, ... | ALGO | 0.999728 | 4.388801 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-11T19:11:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63696f950019... |
0eefcea3-3c96-4a07-9e25-9a052df277a7 | Aryan-Madaan/CodeforcesCompetetions | Spoj/PT07Y.cpp | // Created by <NAME>.
//---------------------------------------------------------------------------------------------------
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define Expresso std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define m... | ALGO | 0.999996 | 3.794273 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-08-07T19:50: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": "048ac1341aa... |
c319ea60-ab78-4876-89a9-ed3ad7f13988 | 94prathampatil/DSA-Program | Lecture 100_Kosaraju's Algorithm/KosarajuAlgo.cpp | #include <bits/stdc++.h>
#define pb(x) push_back(x)
#define ll long long
#define llv long long v
using namespace std;
class Kosaraju
{
public:
void dfs(int node, unordered_map<int, list<int>> &adj, unordered_map<int, bool> &visited, stack<int> &topo)
{
visited[node] = true;
for (auto nbr : adj... | ALGO | 0.999844 | 5.19182 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2024-02-19T14:31: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": "7fc77e175... |
9d55f48d-1215-4671-8526-09c8fb336cce | Dhjeia/MarkDown | 算法/背包问题_广度搜索(限界剪枝法).cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
// 定义结构体来保存每个物品的信息(重量和价值)
struct Item {
long long weight;
long long value;
double unitValue; // 单位价值
};
// 定义分支节点结构体,包含当前的层数、总重量、总价值、上界和父节点
struct Node {
int level; // 当前节点的层数
long long weight;... | ALGO | 0.999998 | 5.03125 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-07-01T16:07:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5018661d902... |
c18e9dcb-e447-44c2-9a5c-a199928dd5bd | abhiabhi2306/LeetCodeChallenges- | implement stackusingqueue.cpp | class Node {
public:
int data;
Node *next;
};
class MyStack {
public:
Node *front=NULL;
Node *rear=NULL;
/** Push element x onto stack. */
void push(int x) {
if (front==NULL && rear==NULL)
{
Node *node1 = new Node();
front=node1;
... | ALGO | 0.998725 | 5.030509 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-08-27T06:29: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": "26739bc01... |
12437118-de16-4eda-a40c-f5f2da47901b | fargol/CodeRevolution | InsertinaSortedList.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* next;
};
void sortedInsert(struct node** head_ref, int data);
struct node *newNode(int new_data)
{
struct node* new_node = (struct node*) malloc(sizeof(struct node));
new_node->data = new_data;
new_node->next = NU... | ALGO | 0.999864 | 4.758589 | {
"github_metadata": {
"branch": "master",
"commit_count": 455,
"repo_created_at": "2019-06-28T18:07: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": "1c46dd5f... |
4ac484c8-a050-4aff-ad68-bce4fac580e0 | Koyama-Tsubasa/LeetCode | Problems/No.1382_Balance_a_Binary_Search_Tree/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.999995 | 6.636543 | {
"github_metadata": {
"branch": "main",
"commit_count": 1093,
"repo_created_at": "2022-06-14T14:59:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb5124691... |
0796992f-c6f2-4b66-a1c8-8d275fba0084 | ksainte/webserv_new | srcs/Trie.cpp | #include "../inc/Trie.hpp"
#include "../inc/Logger.hpp"
#include <sstream>
/**
* @brief (C++98) Inserts a LocationBlock into the Trie based on its prefix path.
* @details Traverses the Trie character by character according to the prefix.
* Creates intermediate TrieNodes if the path doesn't exist. Replaces and delet... | ALGO | 0.997138 | 5.712687 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-05-19T13:15: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": "de42d18dc1f... |
1eb51893-a4ed-4211-a122-07df3aa2e92f | vcheese/Path-Finding-Algorithms | path_finding/Algorithm.cpp | #include "Algorithm.h"
alg::A_Star::A_Star()
{
}
void alg::A_Star::Run(const gui::GridStartNode& StartNode, const gui::GridEndNode& EndNode,
std::vector<gui::Grid*>& Grid, bool& VisualiseFlag, bool& RestartFlag)
{
if (m_Flag)
{
VisualiseFlag = true;
RestartFlag = true;
m_Flag = false;
std::cout << "St... | ALGO | 0.99952 | 3.199791 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2022-09-13T13:19: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": "4ac228b70... |
4afc6676-17c6-44c9-9ad9-a1d49135f00f | danijar/console-game | entities.cpp | #pragma once
bool Near(int one, int two, int distance = 1)
{
bool result = false;
for(int i = -distance; i <= distance; ++i)
{
if(one == two + i)
{
result = true;
break;
}
}
return result;
}
bool Near(Position one, Position two, int distance = 1)
{
return (Near(one.x, two.x, distance) && Near(one.y, ... | ALGO | 0.975562 | 5.028624 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2012-12-17T05:57:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2511e66... |
97dca559-86a2-434d-8ac6-d4c18acff66d | lovy003/First-PR | cpp/linkedLists/doubly_list/insertion_at_end.cpp | #include <iostream>
using namespace std;
struct yogesh
{
int value;
yogesh *next;
yogesh *previous;
};
void traverse_list(yogesh *head)
{
yogesh *f = head;
while (f != NULL)
{
cout << f->value;
f = f->next;
}
}
void insertEnd(yogesh *last, int data)
{
yogesh *a = new yo... | ALGO | 0.999684 | 4.681786 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2021-10-02T19:23:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 59,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "b4c3f1e8... |
f368ac0a-dfe1-4130-8023-f6c1ffb1b48a | brown0394/university_hw_projects | Codeblock/pract/stkseq.cpp | #include <iostream>
#include <algorithm>
#include <iterator>
typedef int DataType;
class Node
{
friend class Stack;
public:
Node():next(NULL), data(0){}
Node(DataType p_data)
{
data = p_data;
}
private:
DataType data;
Node *next;
};
class Stack
{
private:
Node *top;
public:... | ALGO | 0.999421 | 3.691774 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-02T12:30: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": "83e8c9e319c7... |
2fffb7b8-84b6-43e8-95e4-7b156a158523 | yyaihh/Cpp | 2019-10-17(字符串相加)/2019-10-17(字符串相加)/main.cpp | #include<iostream>
#include<string>
using namespace std;
class Solution {
public:
string addStrings(string num1, string num2) {
string t;
auto i = num1.rbegin();
auto j = num2.rbegin();
auto iend = num1.rend();
auto jend = num2.rend();
char c1 = '0';
int tmp;
for (; i != iend && j != jend; ++i, ++j) {
... | ALGO | 0.999959 | 4.65108 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2019-11-30T06:13: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": "3d31fba7d... |
bcca39c8-bac9-4e67-8f7b-b9c6c21e094e | andrey-komarov/labs | 1-discrete-math/09-lab-linear-data-structures/src/H.3/quack.cpp | #include <cstdio>
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
template <typename T> struct vector {
T *a;
int l, cnt;
static const int init_len = 8;
vector() {
a = new T[init_len];
l = init_len;
cnt = 0;
}
void push(T val) {
if (l == cnt) {
T *b = new T[l * 2];
... | ALGO | 0.998017 | 3.538622 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2012-04-14T12:49:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c0695638... |
96e83551-cc4c-46a8-8c34-28f3a8e19470 | Saharochekl/FSR_Math-mod | ex6/analyseTLE/exp_atmosphere.cpp | #include "exp_atmosphere.h"
exp_atmosphere::exp_atmosphere() : atmosphere()
{
scaleHeight=NULL;
refHeight=NULL;
refDensity=NULL;
altitudeBands=28;
smoothDensity=false;
SetConstants();
}
bool exp_atmosphere::getDensity(double *pos, double *d, double t, int count)
{
if (!refDensity || !refHei... | ALGO | 0.936384 | 4.694939 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-03-26T02:05: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": "094e5d13cf1... |
b8de5687-f096-494e-a51f-f44f1ef9a7e9 | Charbel-11/Competitive-Programming | Contests/IEEEXtreme/IEEEXtreme 17.0/War Games.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void getVecFromString(deque<int>& p1, string& p1S){
for(int i = 0; i < p1S.size(); i+=2){
if (p1S[i] == 'T') { p1.push_back(10); }
else if (p1S[i] == 'J') { p1.push_back(11); }
else if (p1S[i] == 'Q') { p1.push_back(12); }
... | ALGO | 0.999866 | 3.932766 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2021-02-23T22:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a5c5b47d... |
6ae9e004-7cb9-4ee7-bf88-003f36553152 | Hasti200/Cpp.uni | roshan zamir.cpp | #include <iostream>
#include <cmath>
#include <string>
class Calculator {
public:
int floor(double number) {
return static_cast<int>(std::floor(number));
}
int add(int num1, int num2) {
return num1 + num2;
}
double max1(double num1, double num2) {
return std::max(num1, num... | ALGO | 0.992282 | 4.889019 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-08T19:37: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": "6295e80d6947... |
702bdb35-9708-4b79-9ed4-a2daf7b91273 | root-project/root | roofit/roostats/src/MCMCInterval.cxx | // @(#)root/roostats:$Id$
// Authors: <NAME> 17/06/2009
// Authors: <NAME> 17/06/2009
/*************************************************************************
* Copyright (C) 1995-2008, <NAME> and <NAME>. *
* All rights reserved. *
* ... | ALGO | 0.914105 | 6.571532 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
72a80add-39c2-48d3-adad-55ba8b2fcbbb | GuanJms/thread-101 | AsynchronousProgramming/AsyncFunctions/async_result.cc | // How to get a result from a task executed by std::async()
// Yet another bad Fibonacci implementation!
#include <iostream>
#include <future>
#include <chrono>
#include <unordered_map>
std::unordered_map<unsigned long long, unsigned long long> memo;
// Task which returns a value
unsigned long long fibonacci(unsigned... | TOOL | 0.958873 | 6.784661 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-29T17:33:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44d4b5c758f1... |
a391bc84-04e2-4167-a32e-01193a10cdba | Vitor-Git15/TPs-Estruturas-de-Dados | TP3/TP/include/BinaryTree.hpp | #ifndef TREE
#define TREE
#include "Email.hpp"
#include <string>
// definição da estrutura nó da árvore
struct node{
Email email;
int InBox;
node* right;
node* left;
node(std::string &m, int ID, int IB, node* r, node* l){
email.message = m;
email.ID = ID;
InBox = IB;
right = r;
left ... | ALGO | 0.998336 | 3.577323 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-07-15T22:13: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": "4c559116d5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.