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 |
|---|---|---|---|---|---|---|---|
aa3d7312-0eb3-409d-89a9-b200ed007948 | vinayak9-ux/sorting_algorithms | 11_delete_from_bst.cpp | /*
Topic : Deleting node of a BST
Date : 08/11/2021
Time : 11.00am
*/
#include<stdio.h>
#include<stdlib.h>
struct node
{
int key;
struct node *left;
struct node *right;
};
typedef struct node node;
node* insertNode(node *root, int d);
node* deleteNode(node *root, int d);
void inorderTraversal(node *root);
int m... | ALGO | 0.999951 | 3.873357 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-11T17:34: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": "cb056e5ad5... |
2add83d5-3296-42a2-92cd-988da12aa914 | Tagore22/algorithmSolve | algorithmSolve/백준/2456.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
// 풀이.
// 정렬의 조건을 구현하는 함수였다. 문제에서 주어지듯
// 첫째로 점수를 비교하고 그 이후 3점을 받은 횟수, 2점을 받은 횟수를 비교하면 된다.
// 만약 2점을 받은 횟수까지 동일하다면 문제에서도 주어진듯 필연적으로 1점을 받은 횟수도 동일하기 때문에
// 그냥 무시하면 된다. 후술할 마지막 부분을 까먹어서 헤맸다. ㅠㅠ
// 자세한 설명은 주석으로 남긴다.
pair<int, int> point[3... | ALGO | 0.999978 | 4.203656 | {
"github_metadata": {
"branch": "master",
"commit_count": 1452,
"repo_created_at": "2022-04-27T10:40: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": "b260dd3... |
79555f71-cca4-4a6d-9299-97c64d286741 | jackhfernandez/unprg_fp_ciclo_I | problemas_propuestos_parte_1/53_numero_a_binario.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// Funcion para convertir un numero decimal a binario
string convertABinario(int numDecimal) {
if (numDecimal == 0) return "0";
string binario = "";
while (numDecimal > 0) {
binario = to_string(numDecimal % 2) + binario;
... | ALGO | 0.998417 | 5.568086 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-12-02T21:36:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c53258ef34... |
cde57e55-5b3e-4000-b38f-5cfd3843adba | msalaciak/COMP_371-Project | Source/vertices.h | // COMP-371 Group Project Team 15
// Procedural World Generation
// <NAME> 29644490
// <NAME> 40045224
// <NAME> 26857655
#include <iostream>
#include <list>
#define GLEW_STATIC 1
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/common.hpp>
us... | TOOL | 0.974101 | 4.02625 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2020-04-04T22:58:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60f36568e... |
0019b358-3495-40e5-bb92-98ba15b18aee | CARLOSARQU/Triangulacion | main.cpp | #include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <stdio.h>
#include "resource.h"
#include <vector>
#include <algorithm>
using namespace std;
HINSTANCE hInst;
struct Punto
{
double x, y;
};
struct Triangulo
{
Punto puntos[3];
};
vector<Punto> puntos;
vector<Triangulo> triangulos;
b... | ALGO | 0.998072 | 4.454607 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-10T05:14: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": "0ea01e994438... |
e9931305-f2b0-4d67-84ba-3cf267e5aab2 | qinq-net/HiRACsICalibrations | 13KinematicCorrectionWithBeamShift/CsIKinematicPointsCorrection.cpp | #include "Nuclear_Masses/nuclear_masses.h"
#include "include/RelativisticKinematics.h"
#include "include/HiRACsICalibration.h"
const int Z_target = 1;
const int A_target = 1;
const double target_thickness =116.19; //um (9.8 mg/cm2)
const int Z_beam = 20;
/*
//---- For Run2013 - Run 2037
const int A_beam = 40;
const ... | DATA | 0.964771 | 3.534249 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-10-30T02:21: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": "9571bfb5f... |
f030e4ed-6334-4b2d-90e1-b689d3c11e61 | deinega/patternizer | src/series.cpp | #include <math.h>
#include <stdlib.h>
#include "series.h"
vector<double> generateMarkovProces(int sz, double start, const double mu, const double sigma){
vector<double> vals;
double prev = start;
for(int i=0; i<sz; i++){
double next = prev + normal(mu, sigma);
vals.push_back(next);
... | ALGO | 0.999797 | 4.139324 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2016-06-17T23:43: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": "a1d19c0e1... |
b8c4826f-a50d-48d9-bca0-17034754cc53 | MiRoboticsLab/cyberdog_locomotion | common/src/dynamics/quadruped.cpp | #include "dynamics/quadruped.hpp"
#include "dynamics/spatial.hpp"
#include "math/orientation_tools.hpp"
using namespace ori;
using namespace spatial;
/**
* @brief Build a FloatingBaseModel of the quadruped.
*
* @param model FloatingBaseModel of the quadruped
* @return true if success
* @return false if fail
*/
... | TOOL | 0.944925 | 4.635344 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-08-30T02:00:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 42,
"forks": 14,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "49ef87161... |
f1567049-2d98-4589-b06e-b849a0d2a1b1 | PiotMac/Algorithmic-Computer-Science | VI-semester/JPP/L3/cpp/finite_field.cpp | #include <stdbool.h>
#include <math.h>
#include <vector>
#include <unordered_set>
#include <iostream>
#include <random>
#include <stdexcept>
#include <assert.h>
using namespace std;
class FiniteFieldElement {
private:
long value;
long characteristic;
bool isPrime(long number) const {
... | ALGO | 0.998475 | 5.517612 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2023-04-25T22:31: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": "6b37e17eb6... |
008443bd-495c-4e18-a7c5-a701056b7cc2 | fedeoliv/HackerRank | insertion_sort_1.cpp | #include <iostream>
#include <vector>
using namespace std;
void outputSteps(vector<int> ar) {
int N = ar.size();
int el = ar[N - 1];
for (int i = N - 1; i >= 0; i--) {
if (i > 0 && ar[i - 1] > el)
ar[i] = ar[i - 1];
else
ar[i] = el;
for (int j = 0; j < N; ... | ALGO | 0.999985 | 4.784179 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2013-12-28T18:04:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac178e... |
4a9e711c-1f21-447f-bd01-5fb7d443e389 | jasserbenjemaa/competitive_programing | SPOJ/BFS/Tic_Tac_Toe_I.cpp | #include <bits/stdc++.h>
#include <utility>
using namespace std;
void PLAY() {
#ifndef ONLINE_JUDGE
freopen("../input.txt", "r", stdin);
freopen("../output.txt", "w", stdout);
#endif
cout << fixed << setprecision(2);
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
bool isWin(string s) {
// Row check
... | ALGO | 0.999981 | 5.048458 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2024-01-19T21:26: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": "185350a45ab... |
82702153-f080-44b7-9d0b-f212670f3f30 | TaehunKim0/baekjoon | src/data_structure/9012.h | #include <iostream>
#include <string>
using namespace std;
/*
0011011 == 121010-1
0000101101 == 1234343232
001011000111 == 121210123210
010101010010101101 == 101010101212121010
()()))(( == 01011100 == 1010-1
*/
class Problem {
public:
void Solve() {
int inputCount = 0;
cin >> inputCount;
fo... | ALGO | 0.999887 | 4.892179 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-10-05T07:18: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": "88accb8acb5b... |
9f2a2408-c7c0-492d-87b1-d34d828ac3d7 | KhawajaAbdulMoiz/Basics-Practice-in-C- | Data Structures And Algorithms/Sorting Algorithms/bubble_sort.cpp | #include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = te... | ALGO | 0.999641 | 5.357157 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-04-15T16:52: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": "89c2ac599ef... |
db712dac-52c4-42d9-9383-0299f5fee535 | armyants531/baejoon | 백준/Gold/23295. 스터디 시간 정하기 1/스터디 시간 정하기 1.cc | // 스터디 시간 정하기 1
#include <bits/stdc++.h>
#define int long long
using namespace std;
using pii = pair<int, int>;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, T;
cin >> N >> T;
vector<int> A(100001); // 해당 시간에 몇 명이 있는지 기록
int start = 100000;
int end = 0;
for (int i = ... | ALGO | 0.999988 | 3.803656 | {
"github_metadata": {
"branch": "main",
"commit_count": 833,
"repo_created_at": "2022-10-29T03:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20e02803a9... |
71a0c8f4-fb7a-4b14-ab17-5aadfc721327 | ishandutta2007/codeforces-t | theoneyouwant/normal/1081/E.cpp | //By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;whi... | ALGO | 0.999927 | 3.237892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "cb65b3e02646... |
addb53be-be24-49fc-86d0-da6e29e83b25 | Andrew90/samara | Units/Defect/DiffWindows/MainWindowMenu.hpp | #pragma once
#include "App/config.h"
#include "Ini/WindowsPosition.h"
#include "Dialogs/Dialogs.h"
#include "Windows/CrossThresholdWindow.h"
#include "Windows/LongThresholdWindow.h"
#include "Windows/ThicknessThresholdWindow.h"
#include "Windows/Common.h"
namespace MainWindowMenu
{
struct MainFile{};
MENU_TEXT(L"Фай... | CONFIG | 0.917322 | 4.488733 | {
"github_metadata": {
"branch": "master",
"commit_count": 404,
"repo_created_at": "2016-12-06T09:19: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": "387fde5d... |
86295794-c60e-498f-8b01-ce65989778b2 | danieltrt/SBFL | results/CHECK_CHARACTERS_GIVEN_STRING_CAN_REARRANGED_FORM_PALINDROME_1.py.cpp | bool canFormPalindrome ( string strr ) {
string listt ;
for ( int i = 0 ;
i < strr . length ( ) ;
i ++ ) {
if ( ( strr [ i ] == ' ' ) || ( strr [ i ] == '\t' ) || ( strr [ i ] == '\n' ) || ( strr [ i ] == ' ' ) || ( strr [ i ] == '\0' ) ) {
listt . erase ( listt . begin ( ) + i ) ;
}
else {
... | ALGO | 0.995878 | 4.398242 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-03T19:59: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": "1d6dae28b17d... |
8cb8a558-8a28-4846-b81d-d66e8c28e1fe | aanjaneykumarverma/USACO_Solutions | NumberTheory/product1modn.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define MODA 998244353
#define pb push_back
#define sortv(v) sort(v.begin(), v.end())
#define sorta(A, N) sort(A, A + N)
#define debug(x) cerr << #x << " is " << x;
#define rep(i, a, N) for (ll i = a; i < N; i++)
#define... | ALGO | 0.999851 | 4.854265 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2022-01-07T17:09: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": "2cf817d3a4f... |
96f14377-aa58-44d2-be59-b7facfb0e53c | HuangDDU/hzy_algorithm | leetcode/top100/11.滑动窗口最大值(239)/me.cpp | // 使用堆存储滑动窗口里所有的元素值,但是堆的删除比较难搞,且堆中不允许有重复元素。
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> maxSlidingWindow(vector<int> &nums, int k) {
vector<int> res;
// 初始化窗口,建大顶堆
vector<int> heap(nums.begin(), nums.begin() + k);
// 窗口滑动往堆中删除、添... | ALGO | 0.999966 | 5.61311 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2023-09-10T14:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15c0252e... |
b4141dbb-b9b9-44ff-8f22-c404c4852e61 | Gundorada-Workshop/OpenCloud | code/engine/mg/mg_math.cc | #include <array>
#include "common/math.h"
#include "common/log.h"
#include "engine/mg/mg_math.h"
set_log_channel("mg_math");
using namespace common;
// 0037FD40
static std::array<f32, 1024> SinTable{ };
// 00376504
constexpr static f32 sin_table_unit_1 = static_cast<f32>(SinTable.size()) / math::pi2();
// 0012F1C... | ALGO | 0.983479 | 3.72918 | {
"github_metadata": {
"branch": "main",
"commit_count": 1283,
"repo_created_at": "2022-10-27T17:20:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 20,
"forks": 1,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "eed6d41fb... |
92b9e4bd-2023-4fc4-83cf-2d5337c463b0 | SICS-Fundamental-Research-Center/Planar | core/apps/mst_app_op.h | #ifndef GRAPH_SYSTEMS_CORE_APPS_MST_APP_OP_H
#define GRAPH_SYSTEMS_CORE_APPS_MST_APP_OP_H
#include <mutex>
#include "apis/planar_app_base.h"
#include "apis/planar_app_base_op.h"
#include "common/types.h"
#include "data_structures/graph/mutable_block_csr_graph.h"
#include "data_structures/graph/mutable_csr_graph.h"
#i... | ALGO | 0.961165 | 6.387832 | {
"github_metadata": {
"branch": "main",
"commit_count": 1672,
"repo_created_at": "2024-04-27T11:42:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d724be483d... |
97aed11a-5bd8-4f94-889c-49355b6836ec | ashishpaul99/Love-Babbar-DSA-Course | 12-Reference variables, function-call by ref and call by value/referenceVariable.cpp | // 12. Reference variable Dare : 26/03/24 Time: 3:18 PM
// eg-1:
// #include <iostream>
// using namespace std;
// int main()
// {
// int n = 10;
// int &k = n;
// int &c = n;
// // normal integer varaible
// cout << "n: " << n << endl;
// // k is reference variable reffering to n
// ... | TOOL | 0.970334 | 4.539824 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2023-08-11T15:54: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": "fa425646c3... |
cef08469-b589-4772-bc2c-305020ba42c2 | bjzhang1991/LeetCodeVS | LeetCode/LeetCode/Hard_033_1.h | #pragma once
/*
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
You are given a target value to search.
If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
*/
#include<vector>
#includ... | ALGO | 0.999989 | 5.313069 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-09-03T01:34: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": "7c5dbdcc4b... |
5561790d-6081-48a5-8a09-9f5f1f22bc9e | sr76/excitingscripts | atat/src/corrskel.c++ | #include "calccorr.h"
// This is a skeleton to show how to include user-defined cluster functions;
// look for XXXX and replace it by the (internal) name of this cluster function type;
// look for xxxx abd replace it by the user-visible name of this cluster function type (it will be invoked by the -crf=xxxx option);
/... | ALGO | 0.988168 | 7.162151 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2012-09-13T14:26:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eed86efd4... |
0aaf7946-c87a-4e0e-9d94-6aa5a812132e | AndrewWang996/6.839-final | ExternalLibs/cinolib/include/cinolib/vertex_mass.cpp | /*********************************************************************************
* Copyright(C) 2016: <NAME> *
* All rights reserved. *
* ... | ALGO | 0.96362 | 5.729736 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-12-09T21:18:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42e4b9807... |
71878e38-6e57-47c6-ba08-dfd671d074f4 | Adityacodesupport/DSA | searchTech.cpp | #include <bits/stdc++.h>
using namespace std;
int linearSearch(int arr[], int n, int key)
{
for (int i = 0; i < n; i++)
{
if (arr[i] == key)
{
return i;
}
}
return -1;
}
int binarySearch(int arr[], int n, int key)
{
int low = 1;
int high = n;
while (low ... | ALGO | 0.999801 | 5.276109 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-10T14:03: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": "7463f8759785... |
78034171-33d0-4eb1-90a1-e9ea914118ca | DavidingPlus/algorithm | hello-algo/src/chapter_backtracking/permutations_ii.cpp | /**
* File: permutations_ii.cpp
* Created Time: 2023-04-24
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯算法:全排列 II */
void backtrack(vector<int> &state, const vector<int> &choices, vector<bool> &selected, vector<vector<int>> &res) {
// 当状态长度等于元素数量时,记录解
if (state.size() == choices.size... | ALGO | 0.999912 | 5.715576 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2023-09-10T02:14: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": "679cb163d... |
a327962e-0aaa-47de-bb96-3ace111eeef7 | GIT-heyok/PS | BOJ/Solutions/DP/Tree DP/14267.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <sstream>
#include <string>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <set>
#include <map>
#include <cmath>
#include <memory.h>
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(nu... | ALGO | 0.99999 | 3.873941 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-01-14T04:32: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": "cb4262c6a3a... |
2606587d-c859-4daa-8391-fb5954307e3a | SerxLee/acm | poj/poj2186.cpp | // popular cow
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 10105;
vector<int> g[N];
stack<int> s;
int Bcnt;
int n, m;
int stop;
int Dind... | ALGO | 0.999945 | 4.128052 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-03-20T13:10: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": "c970374d51... |
a7e15834-be30-4293-8f88-416eaccad1a1 | dengziming/c-tour | leetcode/leetcode1249_remove_invalid_parentheses.cpp | //
// Created by 邓子明 on 1/27/22.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string minRemoveToMakeValid(string s) {
int left = 0;
int right = count(begin(s), end(s), ')');
string ans;
for (auto& c : s) {
if (c == '(') {
... | ALGO | 0.999179 | 5.103076 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 4,
"repo_created_at": "2022-01-01T03:00:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d929428e406... |
007d0bbb-3471-4c68-a93a-6177d51964f9 | ahmades/ChemTools | tests/src/sundials_cvode_iterative_SPGMR.cpp | #include <algorithm>
#include <fstream>
#include <limits>
#include <vector>
#include <cmath>
#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/printf.h>
#include <catch2/catch.hpp>
#include "sundials/cvode/interface.hpp"
#include "test_config.hpp"
/* -----------------------------------------------------... | ALGO | 0.992833 | 6.531452 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2021-05-10T13:29:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "85fa007e0... |
81ddf820-cba6-496d-8d33-c8ace4931744 | FrancescoDaDalt/BFES | src/PRSketch/PRSketch.hpp | /*
* MIT License
*
* Copyright (c) 2023 <NAME>
*
* 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... | ALGO | 0.953596 | 7.004118 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-29T07:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8af2d0c284f... |
df3bc323-74e9-41c2-9863-57e0148cf476 | SayedKhaledd/COMP427 | .vscode/Section4/Rational.cpp | //
// Created by seka5 on 3/30/2022.
//
#include <iostream>
#include "headers/Rational.h"
#include <algorithm>
#include <cmath>
using namespace std;
Rational::Rational(double nominator, double dominator) {
if (dominator <= 0) {
cout << "the dominator can't be 0 or a negative value, changed to 1 !" << en... | ALGO | 0.970969 | 5.161771 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-03-21T09:20: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": "75ff131d7a3... |
469d6815-9013-4dd0-ad70-3e80c0db6242 | seipan1213/AtCoder | ABC065/dK.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
struct UnionFind {
vector<int> par;
vector<int> rank;
UnionFind(int n):par(n),rank(n){
rep(i,n){
par[i]=i;
rank[i]=0;
}
}
int find(int x){
if(... | ALGO | 0.999803 | 3.862765 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-04-04T01:28: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": "429482516... |
5aace166-0efb-453a-9054-fc0762a99d66 | google-deepmind/open_spiel | open_spiel/examples/mcts_example.cc | // Copyright 2021 DeepMind Technologies Limited
//
// 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 by applicable l... | ALGO | 0.998247 | 7.33441 | {
"github_metadata": {
"branch": "master",
"commit_count": 4660,
"repo_created_at": "2019-07-22T13:50:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4631,
"forks": 1006,
"issues": 17,
"pull_requests": 6
},
"file_meta": {
"content_id": "5... |
a6d7dc09-8770-4801-a284-30689741905e | NassimREFES/Library-demo | main.cpp | //------------------------------------------------------------------------------
//---------------------------------------------------------------------------
//------------------------------------------------------------------------
//----------------------------
#include <iostream>
#include <stdexcept>
#include <stri... | TOOL | 0.900668 | 3.295799 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-29T07:36: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": "eb97de007f... |
8b8669d4-4c92-447f-95d7-cc14212a78a8 | haulek/VDMC | polynomial.h | // @Copyright 2018 <NAME>
#include <iostream>
#include <blitz/array.h>
#include "util.h"
namespace bl = blitz;
using namespace std;
bl::Array<int,1> binomialCoeff(int n){
// Returns value of Binomial Coefficient C(n, k)
bl::Array<int,2> C(n+1,n+1);
// Calculate value of Binomial Coefficient in bottom up manner
... | ALGO | 0.999081 | 4.386576 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-01-18T20:48:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3430ff27ba... |
00dae6ee-5c56-46d7-a5ed-0eec4a72d386 | UdaySharmaGitHub/DSA-CPP | GFG/Easy Problems/Mirror_Tree.cpp | /*
Mirror Tree
Given a Binary Tree, convert it into its mirror.
MirrorTree1
Examples:
Input:
1
/ \
2 3
Output: 3 1 2
Explanation: The tree is
1 (mirror) 1
/ \ => / \
2 3 3 2
The inorder of mirror is 3 1 2
Input:
10
/ \
20 30
/ \
4... | ALGO | 0.999982 | 6.155571 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1e8e84173... |
14d2fd9d-9697-4a22-b7ff-77779649ace2 | NIGHTMARE09/Algorithms | prim_MST.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> iPair;
#define inf 1000000
vector<string> split_string(string);
int minimum(int x, int y)
{
if(x < y)
return x;
return y;
}
// Complete the prims function below.
int prims(int n, vector<vector<int>> edges, int start) {
priority_q... | ALGO | 0.999742 | 4.103662 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-05-13T16:08: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": "6a69a173a... |
53cd421a-9811-4401-aafb-d27c2882b990 | krister-henriksson/cpp-tests | makedistr.cpp |
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <limits>
#include <boost/algorithm/string.hpp>
#define DEBUG 0
#define EASY_SUBSTR 0
using std::cout;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
us... | DATA | 0.904527 | 4.890235 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-04-12T10:15: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": "65e0ec10dd... |
1847a715-626c-4964-98c1-9f15351c8d11 | Pasuintarapitak/Numerical_Method | Lagrance Interpolation/lagrance.cpp | #include<iostream>
using namespace std;
double findL(double value , double x[] , int size , int index ){
double divisor = 1, dividend = 1;
for(int i = 0 ; i < size ; i++){
if(i == index)
continue;
dividend *= x[i] - value;
divisor *= x[i] - x[index];
}
return dividen... | ALGO | 0.999948 | 3.82292 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-27T14:27:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77faa48d33e9... |
14f28ac3-5e83-43cd-97b3-e8b1f9484808 | burness/paddle-101 | script/tutorial/paddle/paddle/parameter/FirstOrderOptimizer.cpp | /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
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 by applicable law or ... | ALGO | 0.985272 | 7.300973 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-12-16T09:14:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48c96b0a3... |
4346ea55-808b-4384-82c3-72d831ee1dc8 | CadQuery/OCP | opencascade/Extrema_CCLocFOfLocECC2d.hxx | // Created on: 1991-02-26
// Created by: <NAME>
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser ... | ALGO | 0.999819 | 7.121884 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2019-12-17T20:02:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 122,
"forks": 36,
"issues": 28,
"pull_requests": 2
},
"file_meta": {
"content_id": "16839... |
c4b93f5a-b145-4f35-82ee-7c055d6068b7 | Zeroxk/OnlineJudges | Project_Euler/Problem4-Largest_Palindrome_product.cpp | #include <sstream>
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string str) {
unsigned int start = 0;
unsigned int end = str.size()-1;
//cout << "string " << str << endl;
while(start <= end) {
if(str[start] != str[end]) {
return false;
}
... | ALGO | 0.999881 | 5.207314 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2013-01-16T19:49: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": "9501b06f... |
0045ac9e-f084-4c31-9329-fe99df882c7b | pallabcodes/c-or-c-plus-plus | data_structures/linear_ordered/02-linked_list/dll/lru_cache.cpp | #include <unordered_map>
using namespace std;
class LRUCache {
public:
struct Node {
int key, value;
Node *prev, *next;
Node(int k, int v) : key(k), value(v), prev(nullptr), next(nullptr) {}
};
unordered_map<int, Node *> cache;
int capacity;
Node *head, *tail;
LRUCache(int cap) {
capacit... | ALGO | 0.999186 | 6.058371 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2025-01-27T17:53:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "400f3e30f07... |
8b18580a-b513-40d5-9353-835c6e482fa7 | Rajeen-Malek/Graph | DFS_GRAPH.cpp | #include<bits/stdc++.h>
using namespace std;
template <typename T>
class Graph
{
map<int,list<int>> l;
public :
void addEdge(int x, int y)
{
l[x].push_back(y);
l[y].push_back(x);
}
void dfs_helper(int src , map<int,bool> &visited)
{
//recursive function that will tra... | ALGO | 0.999973 | 5.11149 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-11T16:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3bb61818371... |
089b51ff-2e64-4c75-9471-a02d4ad58fb1 | panyan7/CP | Codeforces/Div2/774/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<long long,long long>
int tt = 1, n, m, k;
bool vis1[20000005];
bool vis[1000005];
void solve() {
cin >> n >> m;
ll res = 1;
vector<ll> mul(20);
ll c = 0;
for (int i = 1; i < 20; i++) {
... | ALGO | 0.999982 | 4.063846 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2021-12-16T19:15:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44efa05df81... |
4a308b9a-5c0e-490a-b6ad-a66a2d744a50 | reevacodes/DSA_ARRAY | intersection.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> findIntersection(vector<int>& arr1, vector<int>& arr2) {
int n1 = arr1.size();
int n2 = arr2.size();
int i = 0, j = 0;
vector<int> intersectionArr;
while (i < n1 && j < n2) {
// If elements are equal, add to intersecti... | ALGO | 0.99998 | 6.133802 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-08-08T20:10: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": "cc3ad01a199... |
063572db-7b7b-4966-b66e-81d505edce51 | AthulJoseph27/LeetCode | 33. Search in Rotated Sorted Array/Solution.cpp | // O(log(N)) Time and O(1) space
class Solution {
public:
int search(vector<int>& nums, int target) {
// Binary Searching for pivot
int s=0,e=nums.size()-1,mid,n = nums.size(),p=-1;
if(n == 0) return -1;
if(n==1){
if(nums[0]==target) return 0;
... | ALGO | 0.999993 | 6.129417 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2020-06-21T18:28: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": "43b070a2... |
b7335f37-1e78-43a0-9377-ea8cc5742600 | Skyaducc/DTQG-2021-2022 | CODE/pvhoi20b6string/A.cpp | #include <iostream>
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define endl '\n'
#define foru(i , a , b) for (int i=a ; i<=b ; i++)
#define ford(i , b , a) for (int i=b ; i>=a ; i--)
#define MASK(i) (1LL << (i))
#define BIT(x, i) (((x) >> (i)) & 1)
#define SET_ON(x, i) ((x) | ... | ALGO | 0.999971 | 4.293387 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-11-24T07:26: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": "ec3782f82a86... |
e80dd6f8-e63c-4b3c-9a55-98a84eb65d2c | niravnb/InterviewBit | 4. Strings/RomanToInteger.cpp | /*
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
Read more details about roman numerals at Roman Numeric System
Example :
Input : "XIV"
Return : 14
Input : "XX"
Output : 20
LINK: https://www.interviewbit.com/problems/roman-to-integer/
*/
int getNum(char... | ALGO | 0.999864 | 5.02432 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-10-20T13:01: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": "2da5c96b1c... |
fa551cad-d2a0-443c-a868-97dbe0245469 | delightedok/TGSToolkits | src/iters/tree/ADT/adt.cpp | #include "../../../comms/comm_headers.h"
#include <iters/tree/adt.h>
#define THIS_FILE "adt.cpp"
#define LOG_TAG "ITERS-TREE-ADT"
TGSTK_EXPORT ADTObject::ADTObject(TreeVTable & vtable) : TreeObject(vtable, 2)
{
this->mDatas = NULL;
}
ADTNode * ADTObject::make_node(void)
{
ADTNode * ret = NULL;
do {
... | ALGO | 0.910634 | 5.221858 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-08-02T01:42:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f82982131... |
34a6c285-2fb8-49cc-88c1-07ca6c2f914c | konnov-007/DM5_DevideCounter | DevideCounter.cpp | #include <stdio.h>
#include <stdlib.h>
int devideTask(){
//MY NUMBERS ARE 5, 14, 22
int count=0;
int num1, num2, num3;
int choose, max, min;
FILE *result;
result = fopen ("DevideCounter.txt", "w");
puts("Input first, second and third number that will be devided:\n");
scanf("%d %d %d", &num1, &num2, &num3);
... | ALGO | 0.996113 | 3.531389 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-04-16T10:54: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": "577adc2f6b... |
f5ecfdb1-2d84-40be-a30c-f506e09d20c1 | osamahatem/CompetitiveProgramming | Live Archive/2476 - Crossing the Desert.cpp | /*
* 2476 - Crossing the Desert.cpp
*
* Created on: Dec 17, 2017
* Author: <NAME>
*/
#include <bits/stdtr1c++.h>
#include <ext/numeric>
using namespace std;
const double EPS = 1e-9;
const double LIM = 1e6;
int n, cap, x[22], y[22];
double cost[22][22];
bool vis[22];
double solve() {
memset(vis, 0, size... | ALGO | 0.99969 | 3.967532 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2017-12-09T14:02:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7e905b5... |
a8ce2428-4a76-4715-bdba-727a3e502383 | Aqsa2209/pf-lab-task-k240923 | PF LAB 9 tasks/Pf lab 9 Q5.cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
void vigenereCipher(char* plaintext, char* key) {
int textLen = strlen(plaintext);
int keyLen = strlen(key);
char ciphertext[textLen + 1];
char extendedKey[textLen + 1];
for (int i = 0; i < textLen; i++) {
extendedKey[i] = toupper(k... | ALGO | 0.999862 | 4.272849 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-09-13T09:41:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14a8cfaf5d4... |
a7831538-2369-46d5-a52b-154da098a9e4 | Kshitij-J/Main-Repository | C++/Practical Codes/C014_EXP 6_CPP/C014_Experiment6_4.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter size of array: ";
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cout << "Enter element number " << i + 1 << " : ";
cin >> a[i];
}
int j = 0, rev[n];
for (int i = n - 1; i >= 0; i--)
{
... | ALGO | 0.999555 | 4.5062 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-29T06:27: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": "9f63801f773... |
08dd74e0-85cf-405d-b790-267821352647 | jjdevic/EDA | Cuatrimestre 1/Iterativos/47.cpp | //Ejercicio 47
//<NAME> - EDA 2ºE 2018/2019
//E01
#include <iostream>
#include <vector>
#include <fstream>
using tMatriz = std::vector<std::vector<int>>;
int resolver(tMatriz const& mat, const int &f, const int &c, const int &k, const int &y, const int &x) {
int res = 0, contCeros = 0, contFranjas = 0, contC... | ALGO | 0.999899 | 4.930419 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2020-10-27T16:02: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": "073ccc5f... |
656682bf-f626-4a57-b8a5-e0be5c02c74a | wbsun/snap | etc/ron/lookupiprouteron.hh | #ifndef LOOKUPIPROUTERON_HH
#define LOOKUPIPROUTERON_HH
/*
* =c
* LookupIPRouteRON([N])
* =s IP, classification
* Path selecting RON routing table.
* =d
* Input:
* Forward IP packets(no ether header) on port 0.
* Expects a destination IP address annotation with each packet.
* Probes outgoing paths for unknown... | TOOL | 0.964201 | 5.954744 | {
"github_metadata": {
"branch": "master",
"commit_count": 10231,
"repo_created_at": "2012-11-21T06:45:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2494a... |
2ea83b5e-b28f-4f0c-9911-fae05190babf | QuwsarOhi/CodeTree | solved_probs/lightoj_catagory/dynamic programming/1205.cpp | // LightOJ
// 1205 - Palindromic Numbers
// Digit DP
#include <bits/stdc++.h>
using namespace std;
int dp[18][18][2][2][2];
vector<int>mx;
int recur(int l, int r, bool nonZero, bool lftTight, bool biggerRight) {
if(l > r) {
if(lftTight == 1 && biggerRight == 1)
return 0;
return 1;
... | ALGO | 0.999951 | 4.477247 | {
"github_metadata": {
"branch": "master",
"commit_count": 816,
"repo_created_at": "2016-12-02T12:39:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c4ed855... |
b3c6419b-cc4c-4b7c-aebc-fd06d2738ba9 | PX4/PX4-Avoidance | local_planner/include/local_planner/planner_functions.h | #ifndef LOCAL_PLANNER_FUNCTIONS_H
#define LOCAL_PLANNER_FUNCTIONS_H
#include "avoidance/common.h"
#include "avoidance/histogram.h"
#include "candidate_direction.h"
#include "cost_parameters.h"
#include <Eigen/Dense>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <queue>
#include <vector>
namesp... | ALGO | 0.969134 | 6.187116 | {
"github_metadata": {
"branch": "master",
"commit_count": 947,
"repo_created_at": "2016-04-25T14:30:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 684,
"forks": 343,
"issues": 95,
"pull_requests": 6
},
"file_meta": {
"content_id": "c49d... |
83615a82-8c13-4432-848e-a4079c5ca665 | KartheeshReddy/Competitive-Programming | 16-07-2023/2771. Longest Non-decreasing Subarray From Two Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
// dp
class Solution {
public:
int maxNonDecreasingLength(vector<int>& nums1, vector<int>& nums2) {
int n=nums1.size();
if(n==0)
return 1;
int res=1;
int dp[n][2];
memset(dp,0,sizeof(dp));
d... | ALGO | 0.999984 | 5.69417 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-05-17T01:34: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": "2b05f5fadd4... |
6f86e1de-4326-48f0-bc11-6f35b6123f7a | samek567/ZadaniaAlgorytmiczne | OIG/park.cpp | #include <iostream>
#include <climits>
using namespace std;
struct punkt {
int zachod;
int wschod;
};
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n = 0;
cin >> n;
int liczba = 0;
int t_maks_zachod = 0;
int t_maks_wschod = 0;
int wysokosci[n];
... | ALGO | 0.999989 | 3.525828 | {
"github_metadata": {
"branch": "main",
"commit_count": 545,
"repo_created_at": "2022-10-15T09:19:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d87e51a0e... |
321822b0-3c6d-4c86-b074-1f9adc6f4139 | EricBollar/AdvTopics | RecursionHW/main.cpp | #include <iostream>
#include <cctype>
using namespace std;
struct Node {
int val;
Node* next;
};
string replaceAll(string str, char orig, char replacement) {
if (str.size() <= 0) {
return "";
}
if (str[0] == orig) {
return replacement + replaceAll(str.substr(1), orig, replacement)... | ALGO | 0.996401 | 3.792604 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-11-29T03:01:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4cac323b2cd... |
ee5f828f-eda1-40c6-868f-86287e2d64ae | AnandY4d4v/DSA_CODES_LB_UNACADEMY | Graphs/Dijkstraalgorithm.cpp | #include <bits/stdc++.h>
using namespace std;
class graph{
public:
map<int,list<pair<int,int>>>adjlist;
void addEdge(int u,int v,int wt,bool direction){
adjlist[u].push_back(make_pair(v,wt));
if(direction==0){
adjlist[v].push_back(make_pair(u,wt));
}
}
void printAdj... | ALGO | 0.999918 | 4.542508 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-15T08:40:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b959cba24033... |
f027253c-0e72-47a8-b5f3-0813ce700f35 | CompRD/BroadCRD | src/paths/reporting/COffset.cc | ///////////////////////////////////////////////////////////////////////////////
// SOFTWARE COPYRIGHT NOTICE AGREEMENT //
// This software and its documentation are copyright (2010) by the //
// Broad Institute. All rights are reserved. This software is supplied //
... | ALGO | 0.963177 | 6.403913 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2015-04-16T17:15:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de6f6c7d6d... |
d615d10a-398c-4ab5-8570-4ceb6ab7210e | hellojxt/NeuralAT | src/bem/cuda/include/potential.h | #pragma once
#include "common.h"
#include "helper_math.h"
BEM_NAMESPACE_BEGIN
enum PotentialType
{
SINGLE_LAYER,
DOUBLE_LAYER,
ADJOINT_DOUBLE_LAYER,
HYPER_SINGULAR_LAYER,
BM_LHS,
BM_RHS
};
#define EPS 1e-3
template <PotentialType Type>
HOST_DEVICE inline complex potential(float3 x, float3 y, ... | ALGO | 0.993178 | 5.260605 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2023-06-01T11:23: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": "3d6cfd9d8f... |
b2de01ba-4594-458b-a554-53774cd47bd6 | merchyaqua/usaco-guide | bronze/adhoc/Problem_3_Load_Balancing.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
freopen("balancing.in", "r", stdin);
freopen("balancing.out", "w", stdout);
int n, b;
cin >> n >> b;
int x[n];
int y[n];
for (int i = 0; i < n; i++)
{
cin >> x[i] >... | ALGO | 0.999873 | 3.651118 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-02-19T20: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": "2b7afc489180... |
2724c7a1-0e24-4f86-ab5d-672ddaf2b4b0 | singhya/Algorithms | Google/Trie/212. Word Search II.cpp | class TrieNode{
public:
TrieNode* next[26];
string word;
TrieNode()
{
for(int i=0;i<26;i++)
{
next[i]=NULL;
}
word = "";
}
void createTrie(vector<string> dict)
{
for(auto a:dict)
{
TrieNode* temp = this;
for(... | ALGO | 0.99992 | 6.076432 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-01-07T00:03: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": "b77492ca0... |
0893ddda-3269-488e-8a88-2280551ba1b1 | huynguy97/IP-Week6 | main.4415632466381905803.cpp | #include <iostream>
#include <fstream>
#include <cassert>
using namespace std;
//
//
// ... | ALGO | 0.998267 | 4.373448 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-12T17:18: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": "82d88b61f8... |
6309d05a-d344-47dc-be44-ce772ca2ab4e | ishandutta2007/codeforces-s | shameimaru_aya/normal/1606/F.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define pr pair< int , int >
using namespace std;
int n , m , x , y , d[220000] , rt[220000];
int fst[220000] , v[440000] , nex[440000] , tot , ans[220000];
vector< pr > q[220000];
struct D
{
long long k , b;
D operator + ( const D &x ) const
{
return (D){k... | ALGO | 0.999927 | 3.884707 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe5beb28c49... |
8af57cdf-d138-4589-abe5-f02ba41ddf2a | krylenko/leetcode | src/solved/140_word-break-II.cpp | // ACCEPTED
#include<string>
#include<vector>
#include<utility>
#include<unordered_set>
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<stack>
#define DEBUG
using namespace std;
// assumptions:
// a "sentence" is all the chars in s, plus add'l spaces, to form a list of discrete words
// empt... | ALGO | 0.999247 | 5.147559 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-02-09T05:51:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cff92ea2f9... |
bd400f4b-1409-40cc-b818-b370e78bfc3d | MarcWong/SemanticSfM | SemanticSfM/software/SfM/main_ComputeStructureFromKnownPoses.cpp |
// Copyright (c) 2015 <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 "i23dSFM/sfm/sfm.hpp"
#include "i23dSFM/system/timer.hpp"
#include "i23dSFM/... | TOOL | 0.905521 | 6.171933 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-04T02:16:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 23,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "a439cd5... |
6c87423c-44ed-47e2-b40a-30cf14c506b9 | RedwanPlague/cses_problems | Dynamic-Programming/Projects.cpp | // https://cses.fi/problemset/task/1140/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define N 200000
#define all(v) (v).begin(),(v).end()
typedef long long ll;
struct Project {
int l, r, p;
Project () {}
Project (int l, int r, int p) : l(l), r(r), p(p) {}
bool... | ALGO | 0.999013 | 4.811146 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2021-01-26T14:19:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9430a1fd69... |
2d668cc9-7ae1-48eb-8e46-69b6c9e41e26 | okmd/leetcode | stackqueues/lb-33-stack-permutations.cpp | // Given two integer arrays pushed and popped each with distinct values,
// return true if this could have been the result of a sequence of
// push and pop operations on an initially empty stack, or false otherwise.
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool validateStackSequence... | ALGO | 0.98556 | 6.485577 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2021-04-26T11:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47f53b4464... |
afb0e47d-662d-411a-bf19-e3f18bfb6bbc | sokolov-s/IEXAPITest | Daemon/common_utils/http_types.h | #pragma once
#include <string>
#include <vector>
#include <map>
#include <memory>
#include <utility>
#include <iostream>
#include <sstream>
#include <stdexcept>
namespace common_utils {
using HTTPHeaders = std::map<std::string, std::string>;
struct NetworkException : std::logic_error
{
explicit NetworkException... | TOOL | 0.965571 | 4.852967 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-30T09:23:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98320ff736... |
f3282d99-e06b-45cd-b589-1bd683dc5308 | livinamuk/Hell2025 | Hell2025/Hell2025/vendor/openmesh/include/OpenMesh/Tools/Decimater/ModQuadricT.hh | /* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2025, RWTH-Aachen University *
* ... | ALGO | 0.997002 | 6.169286 | {
"github_metadata": {
"branch": "main",
"commit_count": 234,
"repo_created_at": "2023-09-03T12:40:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1970,
"forks": 89,
"issues": 3,
"pull_requests": 5
},
"file_meta": {
"content_id": "82c109... |
953f71a6-2b81-4f3c-9959-8aa8cebb49a6 | Fengdalu/acm-icpc | regional/2011/Beijing/online/J.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
#define N 10
#define ONES(x) __builtin_popcount(x)
int B[N][N];
int V[N][N];
int P[N];
int frd[(1 << N)];
int Get[N][(1 << N)];
int dp[N][(1 << N)];
int n, m;
void init()
{
memset(frd, 0, sizeof frd);
memset(Get, 0, sizeof Get);
... | ALGO | 0.99999 | 3.717205 | {
"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": "13984b68... |
8d5f5de4-bbc0-4234-b133-ace20ba097e4 | Kowsihan-sk/Codeforces-Solutions | Contests/Codeforces 717 div2/A_Tit_for_Tat.cpp | /** Author : <NAME> **/
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
#define endl "\n"
#define f(a, b, c) for (ll i = a; i < b; i += c)
#define sz(n) ((int)(... | ALGO | 0.999941 | 3.960762 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-06-05T00:49: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": "99889a72e... |
3248bc61-b8e8-4169-b216-e69ca1f6bf63 | ImtiazAhmedAkash/Problem-Solving | codeforces/490/A.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Team Olympiad
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
/*
* Store the indexes of the input value in their corresponding vectors.
* For example, store 1's in... | ALGO | 0.999976 | 3.54635 | {
"github_metadata": {
"branch": "main",
"commit_count": 475,
"repo_created_at": "2022-11-19T14:05: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": "d8642b09b9... |
5d19d7f3-9c18-4f6a-83bc-ae513444add0 | cakeisalie/oomphlib_003 | external_distributions/trilinos/trilinos-11.0.3-Source/packages/Sundance/Playa/src/PlayaEpetraMatrixMatrixSum.cpp | /* @HEADER@ */
//
/* @HEADER@ */
#include "PlayaEpetraMatrix.hpp"
#include "PlayaEpetraMatrixMatrixSum.hpp"
#include "PlayaEpetraVector.hpp"
#include "PlayaExceptions.hpp"
#include "EpetraExt_MatrixMatrix.h"
#ifndef HAVE_TEUCHOS_EXPLICIT_INSTANTIATION
#include "PlayaVectorImpl.hpp"
#include "PlayaLinearOperatorIm... | ALGO | 0.998903 | 6.377295 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2013-01-21T09:11: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": "0b137535d... |
2bf73f7c-259d-4204-97a2-c4743d3ace62 | Zxiaoxue/cplusplus | AVL树/Test.cpp | #pragma once
#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <math.h>
using namespace std;
template<class K, class V>
struct AVLTreeNode
{
K _key;
V _value;
AVLTreeNode<K, V>* _left;
AVLTreeNode<K, V>* _right;
AVLTreeNode<K, V>* _parent;
int _bf;
AVLTreeNode(const K& key, const V& value)
:_ke... | ALGO | 0.995017 | 4.802969 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2016-06-24T15:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19782c635... |
c7a67412-eacf-412a-9847-9ade7339c007 | raincross7/code-similarity | codes/train_code/problem469/problem469_453.cpp | #include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
void run() {
int n;
cin >> n;
vector<int> a(n);
vector<int> has(1000001), cnt(1000001);
for (int i = 0; i < n; i++) {
cin >> a[i];
++has[a[i]];
}
for (int i = 1; i <= 1000000; i++) if (has[i]) {
for... | ALGO | 0.999835 | 3.651276 | {
"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": "c6b0c9efe6c9... |
957e05d3-fc05-4f9a-9b75-4bff2a954a54 | alekseibutiaev/experience | spherical2/spherical_cast.cpp | #include "stdafx.h"
#include <cmath>
#include <glm/ext.hpp>
#include "spherical_cast.hpp"
#if defined( WIN32 ) || defined( WIN64 )
inline float copysign( const float& f_a, const float& f_b ) {
return static_cast< float >( _copysign( f_a, f_b ) );
}
#endif
namespace {
inline float correct_cos( const float... | TOOL | 0.927367 | 6.499771 | {
"github_metadata": {
"branch": "master",
"commit_count": 528,
"repo_created_at": "2017-11-03T13:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "5e08afb6... |
83d85092-fd77-48bc-9601-dd57a89f060d | wenhu1024/DSACPP | dsacpp/BinTree/BinTree.h | #include "BinNode.h"
#include "../release/release.h"
template <typename T>
class BinTree
{
protected:
int _size; // 规模
BinNode<T> *_root; // 根节点
virtual int updateHeight(BinNode<T> *x); // 更新节点x的高度
void updateHeightAbove(... | ALGO | 0.999333 | 4.645923 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-08T08:55: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": "7ac010427de7... |
618916ba-aa16-4d8e-b2b9-db7f3b08d8e6 | MarioDeng27/DataStructures-Algorithms | Sort/MergeSort.cpp | #include <stdio.h>
#include <stdlib.h>
//将有序数组a[]和b[]合并到c[]中,n是a数组的长度,m是b数组的长度 ,主要理解是怎么将两个有序数列给合并的
void MemeryArray(int *a, int n, int *b, int m, int *c);
void mergearray(int *a, int first, int mid, int last, int *temp);
void mergesort(int *a, int first, int last, int *temp);
bool MergeSort(int *a, int n);
void Show... | ALGO | 0.999916 | 3.921148 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-25T12:00:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6d9bc327a... |
c68a808d-86fe-4b7d-9aa5-0c782401357a | AndyLi23/usaco | probs/gold/open_2020/haircut.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
template <class T> using T... | ALGO | 0.999912 | 3.778751 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2020-09-27T17:44: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": "c994b640... |
6bd38928-f2ee-4151-9c5c-41c17ffdaf93 | arkss/Algorithm | BAEKJOON/BAEKJOON_1260/BAEKJOON_1260/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int arr1[1002][1002]; // 그래프를 2차원 배열로 표현
int arr2[1002][1002]; // 그래프를 2차원 배열로 표현
int visited1[1002];
int visited2[1002];
void DFS(int now, int N)
{
int i;
// 시작노드 방문으로 처리 후 출력
visited1[now] = 1;
cout << now << " ";
for (i=1;i<=N;i++)... | ALGO | 0.999985 | 4.411342 | {
"github_metadata": {
"branch": "master",
"commit_count": 649,
"repo_created_at": "2018-12-28T12:31: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": "ea25f86b... |
f2ebcd54-74dd-427d-98fb-d88ceab58110 | Alenlov/AoC | 2018/9/marbles.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <regex>
#include <list>
#include <unordered_map>
int main(int argc, char const *argv[])
{
std::ifstream myfile;
std::string line;
if (argc > 1)
{
myfile.open(argv[1]);
... | ALGO | 0.997189 | 3.833859 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-11-16T17:19: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": "97915d5c1c1... |
b89969be-bf36-44ee-8a4f-9d4eecb3ac9b | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/09_18623_10.cpp | //Qualification Round 2009
//Problem A
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <string>
using namespace std;
void JooPoo()
{
//freopen("test.in", "r", stdin);
freopen("e:\\Program Files\\System\\Desktop\\A-... | ALGO | 0.999812 | 3.427382 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "b50e60246... |
b34c1a9f-0e14-416d-8525-b0cc83e5932f | arkaslittlemind/Placement-Preparation | Arrays/rep_digits.cpp | # include<iostream>
using namespace std;
int main()
{
int n1,n2,repeat_digit_flag=0,count_nos=0,copy_no,digit=0;
cin>>n1;
cin>>n2;
int digit_index_array[10]={0,0,0,0,0,0,0,0,0,0}; // initialize to 0
for(int i=n1;i<=n2;i++)
{
repeat_digit_flag=0; //initialize to repeat_digit_flag to... | ALGO | 0.99972 | 3.533733 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2023-03-13T14:31: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": "d7212ab8... |
41d94b92-c23e-4ac3-871c-d21d64e50249 | pradeep87blore/LeetCodeCpp | PalindromeNumber.cpp | /*
https://leetcode.com/problems/palindrome-number/
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Follow up: Could you solve it without converting the integer to a string?
Example 1:
Input: x = 121
Output: true
Example 2:
Input: x = -121
Ou... | ALGO | 0.999921 | 5.602131 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-01-03T17:01: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": "a6b62151d1... |
9e62a143-9799-4f52-9ede-afb94246e98a | clevercool/TileSparsity | StreamMaskedGEMM/cutlass/tile_traits_standard.h | /***************************************************************************************************
* Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are me... | TOOL | 0.992302 | 7.522347 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-05-31T23:31:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 4,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "888967b... |
935c45b5-fde3-450c-8a3a-a70b4b11be20 | riven521/CluVNS2017 | Project1/Project1/CluVRPinst.cpp | #include "CluVRPinst.h"
#include <iostream>
//**********************************************************************************************//
CluVRPinst::CluVRPinst(std::vector<Cluster> vClusters, int nVehicles)
{
this->nVehicles_ = nVehicles; //输入的车辆数为可用车辆数
this->vehicleCapacity_ = Globals::vehicleCapacit... | ALGO | 0.953068 | 4.127948 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-01-23T13: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": "1f64b4a8df... |
5bd3f3d0-3c16-489b-bfdc-f4a11d839110 | fboehle/Frog-Frog | Trebino FROG_v1.2.0/lib/MEXlib/src/dZdE_blindpg/dZdE_blindpg.cpp | /** \file
*
* $Author: pablo $
* $Date: 2006-11-11 00:15:30 $
* $Revision: 1.1 $
*/
#include "dZdE_blindpg.h"
using std::norm;
using std::real;
using std::conj;
/** \brief MATLAB entry point.
*
* This is the function that MATLAB actually calls when executing the included
* functions. This function checks th... | ALGO | 0.977261 | 5.266251 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-04-30T10:04:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "366d1228d... |
eaff77df-b76e-472a-9852-11503fa1a3a1 | Satendra124/dsa_solutions | A_Maze.cpp | #include <bits/stdc++.h>
using namespace std;
int mod = 1e9+7;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long int ll;
bool visited[501][501];
int s;
void dfs(int i,int j,vector<vector<char>>& maze){
if(i==maze.size()||j==maze[0].size()||i<0||j<0) return;
if(maze[i][j]=='#') ... | ALGO | 0.999979 | 3.903136 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-20T08:36:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abfa848ad37c... |
0a22d82f-8626-45b8-bf3e-8153346ecf0a | lts96/Algorithm | BOJ/C++/4354.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <utility>
#include <queue>
using namespace std;
int n, m, ans = 1;
vector <int> pi;
int failure(string s)
{
int m = s.length();
int j = 0;
int result = 0;
pi.assign(m, 0);
for (int i = 1; i < m; i++)
{
while ((j > 0) && (s[i] ... | ALGO | 0.999639 | 3.498528 | {
"github_metadata": {
"branch": "main",
"commit_count": 263,
"repo_created_at": "2021-06-21T18:10: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": "432fc846c7... |
c5465e69-2384-4208-b5b8-086c5e5f66fe | danaser72/baekjoon | baekjoon/2146/2146.cpp | #include <iostream>
#include <queue>
#include <string.h>
using namespace std;
int N;
int MOVE[4][2] = { {1,0},{0,1},{-1,0},{0,-1} };
int arr[101][101];
int map[101][101] = { 0, };
int ans = 987654321;
vector<queue<pair<int, pair<int, int>>>> v;
int main() {
cin >> N;
for (int i = 1; i <= N; i++) {
for (int j = ... | ALGO | 0.999711 | 3.335391 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2018-02-21T13:07: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": "ff6c530c6... |
a97ff65b-cceb-4471-b851-f70b6582baca | ishandutta2007/codeforces-z | zeliboba/normal/1214/A.cpp | #include <stdio.h>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <unordered_map>
#include <queue>
#include <array>
#include <bitset>
#incl... | ALGO | 0.999828 | 3.997364 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "bb2b7419327d... |
eefae0d8-28f6-45f9-b865-f5b9bcfdc4d4 | Bachzart/DS_Practices | Leetcode/120.cpp | /* bottom-up */
class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
vector<vector<int>> dp = triangle;
int size = triangle.size();
for(int i = size - 2; i >= 0; i--) {
for(int j = 0; j < i; j++) {
dp[i][j] = min(dp[i + 1][j], dp[i + 1][j + 1... | ALGO | 0.999989 | 6.16965 | {
"github_metadata": {
"branch": "main",
"commit_count": 242,
"repo_created_at": "2022-03-20T13:50: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": "fa7ba416b3... |
e1734873-c4e4-4c57-b22f-c830b8a2deae | tkddn204/coding-test-training-cpp | review/personal/2630.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
int n;
int paper[130][130];
int vst[130][130];
int w = 0, b = 0;
void check(int x, int y, int dv) {
int count = 0;
for (int i = x ; i < x + dv; i++) {
for (int j = y ; j < y + dv; j++) {
if (paper[i][j]) count++;
}
}
if (!count) w... | ALGO | 0.999001 | 4.388996 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2023-04-18T13:13: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": "aef5fba4bfe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.