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 |
|---|---|---|---|---|---|---|---|
0b927565-af26-4902-b36d-9aab5a75bbca | CarlosHuu/Object-Oriented_Programming | Lab6/wrong.cpp | // Wrong Code
#include <iostream>
using namespace std;
// --------------------------
// Correct code should print:
// 10
// 15
// 20
// 25
// 30
// 35
// 40
// 45
// 50
// 55
// --------------------------
void add_func(int** sum_result, int** array_10X5){
int* temp = new int [10];
for(int i=0; i<10; i++) *... | ALGO | 0.959965 | 4.206455 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-03-02T06:40: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": "72a7f632cc... |
ecb2cf4e-facd-45d3-ad99-b599b054fe44 | Sankhyesh/LeetCode-problems-striver-sheet- | Linked_List/61. Rotate List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* rotateRight... | ALGO | 0.999979 | 5.834476 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2022-01-11T09:46: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": "5863844228... |
ee7d5ae7-9009-4d23-b27d-435d26a4a54f | David-Park/Algorithm | 1206_B.cpp | #include <cstdio>
#include <malloc.h>
/*
Cannot Use STL
*/
int max(int a, int b) {
return a < b ? b : a;
}
int solution(int size, int* arry) {
int ret = 0;
for (int i = 2; i < size - 2; i++) {
if (arry[i - 2] < arry[i] && arry[i - 1] < arry[i] && arry[i + 1] < arry[i] && arry[i + 2] < arry[i]) {
ret += arry[i... | ALGO | 0.99968 | 3.893766 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-05-21T09:05: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": "e211ab833... |
855dd29f-72b3-400b-9076-3aef3fc243b2 | mabarrera4/UVa-Online-Judge-Solutions | 11848.cpp | /*
* 11848. <NAME>
* TOPIC: spfa, dijkstra
* status: in progress
*/
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define xchg(x,y) (((x)==(y))||((x)^=(y),(y)^=(x),(x)^=(y)))
#define bubble (xchg(pos[heap[i]],pos[heap[j]]),xchg(heap[i],heap[j]))
#define BIT(k) (1UL... | ALGO | 0.999681 | 3.820221 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-05-19T19:11:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f85768387... |
2b3e6b01-2c21-413c-82b4-91d2d3890d95 | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/FindAllAnagramsInAString.cpp | /*
* [Source] https://leetcode.com/problems/find-all-anagrams-in-a-string/
* [Difficulty]: Easy
* [Tag]: Hash Table
*/
#include <iostream>
#include <vector>
using namespace std;
// [Solution]: Sliding window
// [Corner Case]:
class Solution {
public:
vector<int> findAnagrams(string s, string p) {
vec... | ALGO | 0.999793 | 6.607328 | {
"github_metadata": {
"branch": "master",
"commit_count": 484,
"repo_created_at": "2014-09-14T08:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fe057b7... |
9ef92b5b-cd0a-44e7-bdc1-825485a07fa4 | TanLocLouis/DSA | other/dijkstra.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
const int INF = INT_MAX;
class Graph {
private:
int V;
vector<vector<pair<int, int>>> adj;
public:
Graph(int vertices) : V(vertices) {
adj.resize(V);
}
void addEdge(int u, int v, int weight) {
... | ALGO | 0.999969 | 6.056214 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-04-07T11:09:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e45b12655... |
f7259e6b-9dcc-49d3-aac6-041c31d0dfb8 | libaoquan95/LintCode | 第4章-12-带最小值操作的栈.cpp | #include <iostream>
#include<stack>
using namespace std;
class Solution {
public:
/**
* http://www.lintcode.com/zh-cn/ladder/6/-第4章-12-带最小值操作的栈
*/
stack<int> mainStack;
stack<int> helpStack;
void push(int number) {
// write your code here
int top;
mainStack.push(numbe... | ALGO | 0.999942 | 4.933146 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-03T01:51:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eaef88584... |
c07e4462-c80b-4f7d-95b5-9cd67a69c978 | microsoft/AirSim | ros2/src/airsim_ros_pkgs/include/math_common.h | namespace math_common
{
template <typename T>
inline T rad2deg(const T radians)
{
return (radians / M_PI) * 180.0;
}
template <typename T>
inline T deg2rad(const T degrees)
{
return (degrees / 180.0) * M_PI;
}
template <typename T>
inline T wrap_to_pi(T radians)
{
int m = (int)(radians / (2 * M_PI));
... | ALGO | 0.960852 | 7.058465 | {
"github_metadata": {
"branch": "main",
"commit_count": 3561,
"repo_created_at": "2017-02-14T00:52:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17314,
"forks": 4743,
"issues": 668,
"pull_requests": 36
},
"file_meta": {
"content_id": "... |
211ca246-8794-4707-884c-140bf838d122 | nh0znoisung/Online_Judge-Competitive_Programming | Codetour/2022/Codeverse/online/a.cpp | #include <bits/stdc++.h>
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i)
#defi... | ALGO | 0.999899 | 3.906007 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-10-28T13:33: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": "fce2f27f2e1... |
b535db95-c468-4219-97c6-ee6c94422f79 | ZhangXin8069/20210608-20250619 | __2021/content-laptop/zcc/zx2.cc | #include <iostream>
#include <complex>
#include "Eigen/Core"
using namespace std;
using namespace Eigen;
class biCGstab
// Stable Biconjugate Gradient Method
{
public:
biCGstab(int max4loop = 10,
int nu4dim = 2,
float min4diff = 1e-5,
MatrixXcd *poit4A = NULL,
Ve... | ALGO | 0.999949 | 4.577682 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-06-19T14:27:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cca1007b276... |
fd5f8ed0-ff66-439a-aab6-30f7662a3fb6 | OpenMS/OpenMS | src/openms/extern/IsoSpec/IsoSpec/operators.h | /*
* Copyright (C) 2015-2020 <NAME> and <NAME>.
*
* This file is part of IsoSpec.
*
* IsoSpec is free software: you can redistribute it and/or modify
* it under the terms of the Simplified ("2-clause") BSD licence.
*
* IsoSpec is distributed in the hope that it will be useful,
* but WITHOUT ANY WAR... | TOOL | 0.94965 | 6.092278 | {
"github_metadata": {
"branch": "develop",
"commit_count": 34896,
"repo_created_at": "2014-01-09T10:15:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 358,
"issues": 638,
"pull_requests": 64
},
"file_meta": {
"content_id": ... |
1f2f7070-3ef6-431e-b7dd-0f23aa17cf22 | horenbergerb/CS475HW | HW2/nn.cpp | //TODO
//Implement confusion matrix
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include <fstream>
#include "rand.h"
#include "mat.h"
double stepFunc(double x);
double activationFunc(double x);
Matrix computeLayer(Matrix weights, Matrix layerInputs, int curLayer, int layers);
void ... | DATA | 0.948337 | 4.015587 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-03-15T21:17: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": "0b73d7ca94... |
bf85a8f7-603e-4ef9-88a4-eb715ce3942b | caporalCoder/data-structures-and-algorithms | codechef/PANSTACK.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <list>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <iostream>
#include <fstream>
#include <chrono>
#include <complex>
#define endl "\n"
#... | ALGO | 0.999932 | 4.199081 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2018-07-16T15:04:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76bf7e31... |
5cd3ff51-ad10-410d-bc53-29c56cfc359e | neha2k4/LEETCODE | 3077-maximum-strength-of-k-disjoint-subarrays/3077-maximum-strength-of-k-disjoint-subarrays.cpp | class Solution {
public:
long long maximumStrength(vector<int>& nums, int k) {
vector<vector<long long>> dp(k + 1, vector<long long>(nums.size() + 1, 0));
for (int i = 1; i <= k; i++) {
long long maxSum = LLONG_MIN/2;
long long curr = LLONG_MIN/2;
long long multi... | ALGO | 0.999921 | 5.705502 | {
"github_metadata": {
"branch": "main",
"commit_count": 1146,
"repo_created_at": "2025-01-03T13:42: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": "1f8be4397... |
bb2473d8-2252-460b-a80a-baca179195d9 | ellisaveta/FMI-SDA | hw12/Task02.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct Edge {
long from, to, cost, win, index;
bool operator < (const Edge& other)
{
if (cost == other.cost)
{
return win > other.win;
}
return cost < other.cost;
}
};
Edge edges[200001];
... | ALGO | 0.999948 | 4.301524 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-10-14T15:19: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": "6046c8faf9a... |
d11918c7-2af6-40ce-81cc-695246516eb2 | ashuvictor/Dynamic-Programming | 31-40/33_Edit Distance.cpp |
We are given two strings ‘S1’ and ‘S2’. We need to convert S1 to S2. The following three operations are allowed:
Deletion of a character.
Replacement of a character with another one.
Insertion of a character.
We have to return the minimum number of operations required to convert S1 to S2 as our answer.
ii) Whe... | ALGO | 0.999978 | 5.073018 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-05-31T03:35:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30e81a178e33... |
58e3dfab-d6da-41c5-9744-f6186e9dac2b | sparcians/map | sparta/sparta/utils/TreeUtils.hpp | // <TreeUtils.h> -*- C++ -*-
/**
* \file TreeUtils.hpp
*
* \brief File that defines hand sparta::TreeNode functions
*/
#pragma once
#include <string>
#include <cinttypes>
#include <vector>
#include "sparta/simulation/TreeNode.hpp"
namespace sparta::utils
{
/**
* \brief Search a TreeNode for a give... | TOOL | 0.923365 | 6.152329 | {
"github_metadata": {
"branch": "master",
"commit_count": 1153,
"repo_created_at": "2019-12-12T15:37:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 195,
"forks": 65,
"issues": 51,
"pull_requests": 1
},
"file_meta": {
"content_id": "fbbf... |
87b2cd64-839e-4ccf-83ef-e79794a52943 | ltf0501/NoName | Contest/2019 NWERC/J.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
using namespace std;
#define F first
#define S second
#define PB push_back
typedef long long int ll;
constexpr int kN = int(5E5 + 10);
int ABS(int n) {return n >= 0 ? n : -n;}
int s[kN], nxt[kN], p[kN];
bool used[kN];
... | ALGO | 0.999977 | 3.909681 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2019-05-19T15:55:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e4095d7... |
5a24da7e-418d-4253-ac56-4be74b40117f | qingping95/ACM | 模板库/自整理/图论及树/生成树计数.cpp | /*
* 基尔霍夫矩阵,Max-tree 矩阵,a[i][i]表示i节点的度数,如果有一条边(i,j),则a[i][j]=-1
*/
#include <iostream>
#include <cstdio>
#include <stack>
#include <cstring>
#include <queue>
#include <algorithm>
#include <cmath>
//#define lson x<<1
//#define rson x<<1|1
//#define mid ((lt[x].l+lt[x].r)/2)
//#define ID(x, y) ((x)*m+(y))
#define CHECK(x... | ALGO | 0.999983 | 3.966266 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2016-04-29T15:59:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02b7fd156... |
9b9cddbf-3e25-426e-9486-98ecbeef4671 | zybao0/ray_tracing | ray_tracing_demo/2-3/main.cpp | #include<ray.h>
#include<ctime>
#include<mutex>
#include<thread>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<fstream>
#include<iostream>
#include<direct.h>
#include<BMPImage.h>
#include<my_random.h>
#include<all_texture.h>
#include<all_objects.h>
#include<condition_variable>
using namespace std;
using... | ALGO | 0.958077 | 3.677787 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-01-21T01:51:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34c8b1709... |
196942cb-f6c7-45de-aff8-26e0eb2a3335 | Gokulkrishnanrg2004/Super_dream_batch_training | 225-implement-stack-using-queues/implement-stack-using-queues.cpp | class MyStack
{
queue<int>q1,temp;
public:
MyStack()
{
}
void push(int x)
{
if(q1.empty())
{
q1.push(x);
return;
}
while(!q1.empty())
{
temp.push(q1.front());
q1.pop();
}
q1.p... | ALGO | 0.999048 | 5.264509 | {
"github_metadata": {
"branch": "main",
"commit_count": 974,
"repo_created_at": "2024-09-25T09:00: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": "0a70cbe8ff... |
57a8e0c0-7353-403b-9aaa-c0d9add1204c | AbhirupChakraborty/Striver-SDE-Sheet-Challenge-2023 | middleOfLL.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
//Approach 1: count the no of nodes ->O(N) + then ... | ALGO | 0.99986 | 5.838164 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-06-04T14:04: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": "7dadad34211... |
2d4f5833-ec04-4a9f-86fc-246be4f53a0b | ymardoukhi/Percolation | Percolation_C++/TAMSD.cpp | /*
TAMSD.cpp
Purpose: To calculate the TAMSD from a trajectory of a random walker
@author: <NAME>
@version: 1.1 12/12/2017
*/
/*
Store the calculated value of TAMSD onto an output file
@params: t The total measurement time
max_div The number of data points on the interval (0,t)
... | ALGO | 0.98972 | 4.394245 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-12-12T20:25: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": "8e5aaec02... |
600f2a2a-565f-4ab9-af8e-2f7edec52235 | stevenmsl/cpp_w_a_527 | main.cpp | #include <iostream>
#include <tuple>
#include <vector>
#include <string>
#include "solution.h"
#include "util.h"
using namespace std;
using namespace sol527;
string toString(vector<string> input)
{
string result = "[";
for (auto e : input)
{
result += e;
result += ",";
}
/* remove the last comma *... | ALGO | 0.998514 | 4.356457 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-02-17T20:03: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": "20d691166a... |
06a711ca-18ea-4a0e-82b4-7c5fa58d5dd9 | kalfazed/tensorrt_starter | chapter2-cuda-programming/2.6-nsight-system-and-compute/src/main.cpp | #include <stdio.h>
#include <cuda_runtime.h>
#include "utils.hpp"
#include "timer.hpp"
#include "matmul.hpp"
int seed;
int main(){
Timer timer;
int width = 1<<10; // 1,024
int low = 0;
int high = 1;
int size = width * width;
int blockSize = 16;
char str[50];
float... | ALGO | 0.992789 | 5.251731 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2023-05-07T17:40:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 256,
"forks": 67,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "327a0945... |
d2872c1e-4a92-4619-a692-3ed7c44f1a3f | miguelSantirso/AlertaCaracol2 | Compo_Caracoles/Arbiter.cpp | /*
* Copyright (c) 2006 <NAME> http://www.gphysics.com
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies.
* Erin Catto makes no representations about the suitabilit... | ALGO | 0.999245 | 6.487426 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2013-01-26T18:23: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": "0decec100... |
cdf4d3b1-b41e-4c20-85e7-da4e18743c8b | LuthfiMayoga44/Semester2 | Praktikum/Praktikum 2/Praktikum 2.cpp | #include <iostream>
using namespace std;
int partition(int arr[], int low, int high) {
int pivot = arr[high];
int i = (low - 1);
for (int j = low; j <= high - 1; j++) {
if (arr[j] <= pivot) {
i++;
swap(arr[i], arr[j]);
}
}
swap(arr[i + 1], arr[high]);
re... | ALGO | 0.999973 | 5.685509 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-03-17T18:07:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "093310e1fe3... |
de5b3c0b-b8b0-4e0b-b693-5d0c9e85c8dd | hsozan/cpp | cpp-09/ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
PmergeMe::PmergeMe() {}
PmergeMe::~PmergeMe() {}
PmergeMe::PmergeMe(const PmergeMe & origin)
{
*this = origin;
}
PmergeMe & PmergeMe::operator=(const PmergeMe & origin)
{
this->vector_ = origin.vector_;
this->deque_ = origin.deque_;
return *this;
}
void PmergeMe::printVector()
{
int i... | ALGO | 0.997806 | 4.707902 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-12-09T08:18: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": "42b3afd9fda8... |
840aa47f-aa55-4229-802d-10e8f12a89b1 | Cube219/PS | BOJ/13000~14000/13439 - 팩토리얼과 점화식.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
using ll = long long int;
int tNum;
int n, k;
constexpr int MAXN = 1000;
int min_factor[MAXN + 1];
vector<pair<int, int>> fPrimes;
ll fNum[1001];
map<... | ALGO | 0.999986 | 4.706779 | {
"github_metadata": {
"branch": "main",
"commit_count": 1172,
"repo_created_at": "2021-01-20T03:42: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": "e897f3270... |
7ce8ea4b-6a5b-4f3e-838c-cb51afbc8f09 | raresraf/project-martial | dataset/CoSiM_CF/raw/fe6be80f-724f-4400-b667-ea9564f15f3e/546A.CPP | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#de... | ALGO | 0.999758 | 3.297959 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2022-10-01T11:58:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1490441252... |
c9a11a36-1477-4ee4-b1e5-fd08b14c6984 | sabiusa/cses | problems/moving-robots/moving-robots/main.cpp | //
// main.cpp
// moving-robots
//
// Created by <NAME> on 5/17/21.
//
#include <iostream>
#include <vector>
#include <array>
#include <iomanip>
using namespace std;
#define ll long long
#define ull unsigned long long
const ll N = 8;
vector<vector<ll>> cnt(N, vector<ll> (N, 4));
vector<vector<double>> ans(N, ... | ALGO | 0.999892 | 4.31494 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2021-03-11T06:35: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": "d2c485bbea... |
c4be0221-503b-4fe6-aaec-d54a6f1febad | jurextrade/WEB | members/1/Projects/MyProject123/MQL4/Files/input/save/copy_R_B.cpp | #include "Progress.h"
#include "PG_Objects.h"
#include "PG_Logicals.h"
/* ============================================================
STRATEGY : Jurex
RULE : B
DESCRIPTION
=============================================================*/
void R_RULE (B)
{
double VELOCITY = 0;
double WPR_14 = 0;
//
//
... | ALGO | 0.996428 | 4.815876 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-06T08:23: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": "062a9bc49319... |
fffcfe5d-43b2-4110-ac23-c86eaa90a6a8 | aravind-kumar/Coding | valid_parent_o(1)_o(n).cpp | class Solution {
public:
bool isValid(string s) {
int top= -1;
for(int i=0;i<s.size();++i) {
if(top < 0 || !isMatch(s[top],s[i])) {
top++;
s[top] = s[i];
} else {
--top;
}
}
return top == -1;... | ALGO | 0.999708 | 5.93997 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2016-10-18T17:55:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c7b3f3f... |
1319db6d-7397-45a4-a729-c0ee115313ff | TasneemEdogawaConan/DigitalDesign2 | Project/DAG.cpp | #include<iostream>
#include<fstream>
#include<sstream>
#include "DAG.h"
using namespace std;
DAG::DAG(int n)
{
adjMatrix= new int*[n];
for(int i=0; i<n; i++)
{
adjMatrix[i]= new int [n];
}
for(int i=0; i<n;i++)
for(int j=0;j<n;j++)
adjMatrix[i][j]=0;
}
DAG::~DAG()
{}
void DAG::Read(string fileName) //sam... | ALGO | 0.99937 | 3.633648 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-03-10T09:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d5d24fff... |
4ea31571-e99b-4ef2-b754-195c60cafccd | devdrx/cp-submissions | C_Brr_Brrr_Patapim.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
template<typename Node, typename Update>
struct ... | ALGO | 0.999722 | 3.893405 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-03-29T14:31: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": "ac2f29f51a3... |
3d088b60-42d5-4ef0-ab82-88c9c9b85a69 | codetatvaacademy/GU-Technical-Training-2026 | DheerajKumar/Technical-Training-2026/PrefixSum/problem1685.cpp | /*1685. Sum of Absolute Differences in a Sorted Array
You are given an integer array nums sorted in non-decreasing order.
Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute differences between nums[i] and all the other elements in the array.
... | ALGO | 0.999881 | 6.176041 | {
"github_metadata": {
"branch": "main",
"commit_count": 1911,
"repo_created_at": "2024-12-21T05:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 91,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "880be907... |
26df81f2-8b2b-46a7-9adc-f027302d40de | hyturing/Competitive-Programming | CSES Problem Set/dice_combinations.cpp | /**
* Author: hyturing
* Created: 12 Jun 2022 01:24:05 IST
**/
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9+7;
const int MM = 998244353;
const int N = 1e5+5;
const int INF = 1e18;
void solve() {
// code here
int n; cin >> n;
vector<int> dp(n+1, 0);
dp[0] = ... | ALGO | 0.999981 | 4.83402 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-06-22T01:38:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3eb0274998c... |
22247841-8f57-4afa-94ac-9aaacacbd698 | Tasbi2116/Operating-System-Code | Deadlock_Detection.cpp | #include <iostream>
using namespace std;
const int MAX_PROCESSES = 20;
const int MAX_RESOURCES = 20;
int numProcesses, numResources;
int allocation[MAX_PROCESSES][MAX_RESOURCES];
int request[MAX_PROCESSES][MAX_RESOURCES];
int need[MAX_PROCESSES][MAX_RESOURCES];
int available[MAX_RESOURCES];
void input() {
cout <... | ALGO | 0.999489 | 5.31274 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-02-21T14:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26b022d3a2cd... |
024ed630-54f1-499d-9e0f-7d34fea17117 | saraiahrak/Ex4 | Matrix.cpp | //
// Created by dekel on 18/01/2020.
//
#include "Matrix.h"
//constructor- initializes a matrix and it's cells and states
Matrix::Matrix(vector<vector<int>> mat) {
this->intMat = mat;
this->rows = mat.size();
this->cols = mat.at(0).size();
initMatrix(mat);
setInitialState(0, 0);
setDestState... | ALGO | 0.99973 | 4.938015 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-01-18T21:42:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d634d23c6... |
bf9397c7-c618-4da3-b3cc-cfbda2b33533 | akhilsharmaa/Competitive-Programming | HackerRank/TechFest 22 Level-1/a.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define MOD 1000000007
#define vt vector
#define pYes cout << "YES" << endl;
#define pNo cout << "NO" << endl;
int main(){
// Taking INPUT Array
int n; cin >> n;
vector<int> arr(n);
... | ALGO | 0.999959 | 3.701653 | {
"github_metadata": {
"branch": "master",
"commit_count": 757,
"repo_created_at": "2021-09-05T16:38:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d2e0acd... |
e8015c76-1f06-4e92-8716-bdbf23d21e05 | johan1103/baekjoonCoding | 백준문제풀이 연습/2667.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<cstring>
#define MAX_SIZE 500
using namespace std;
int map[MAX_SIZE][MAX_SIZE];
int visit[MAX_SIZE][MAX_SIZE];
int villageCnt[MAX_SIZE];
const int dx[4] = { 0,1,0,-1 };
const int dy[4] = { 1,0,-1,0 };
void dfs(int x, i... | ALGO | 0.99999 | 4.152498 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2021-07-01T13:08: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": "4a66e0f6f... |
31e9e0c3-e221-4485-8a8e-bf847aed886f | LiveLetLive/Algorithms | Algorithms/src/uva/UVA_11456_Trainsorting.cpp | #include "CommonHeader.h"
#ifdef UVA_11456_TRAINSORTING
READ_INPUT(UVA_11456_TRAINSORTING)
#include <iostream>
#include <cstdio>
#define FOR(i, init, count) for(int i = init; i < count; i++)
#define MAX 100001
typedef int ll;
int N, M, K, T;
ll Mat[MAX];
ll Len[MAX];
ll dpInc[MAX];
ll dpDec[MAX];
int count = 0;
... | ALGO | 0.999947 | 3.66941 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2016-05-11T01:26: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": "5efdbcdb... |
572cd2a3-6134-4c63-aa0b-f6c9a4419bb7 | jiy12345/Beakjoon-Online-Judge | Dynamic Programming/11060 - 점프 점프.cpp | #include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
#define MAX 1000
int N;
int maze[MAX];
int minNumOfJump[MAX];
bool isInRange(int i) {
return 0 <= i && i < N;
}
int bfs() {
int answer = -1;
queue<vector<int>> bfs_queue;
bfs_queue.push({ 0,0 });
minNumOfJump[0] = 0;
while (!bfs_que... | ALGO | 0.999995 | 3.318587 | {
"github_metadata": {
"branch": "master",
"commit_count": 1571,
"repo_created_at": "2020-09-04T08:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "62fa22... |
26826172-98c1-4eab-8b56-722117fd3322 | seongjuni/baekjoon | 7단계 2차원 배열/7단계 2차원 배열/2738.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
// 두 행렬 A와 B를 저장할 2차원 벡터 선언
vector<vector<int>> A(N, vector<int>(M));
vector<vector<int>> B(N, vector<int>(M));
// 행렬 A의 원소 입력
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++)... | ALGO | 0.99975 | 5.098323 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-01-03T05:39: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": "6805d424385... |
ea0a27b1-9903-4c8a-8a70-1e137ea2918c | sobolevma/Informatics | Semestr2/Задание 5/Задание 5/Задание 5.cpp | // Задание 5.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "conio.h"
#include "math.h"
#include <iostream>
using namespace std;
int A,B=0;
double Y0=0,Y1=0;
bool e=false;
struct Mnogoch{
double znach;
int pokaz;
Mnogoch *next;
};
struct ProizvMnogoch{
double znach_pr;
... | ALGO | 0.999551 | 3.433169 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-09T18:49: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": "adba13bdfd23... |
3ce1a5a2-f659-4f28-8321-7d25f41213b4 | Headtalk/mlpack-ios | mlpack-1.0.8/src/mlpack/core/tree/cover_tree/dual_tree_traverser_impl.hpp | /**
* @file dual_tree_traverser_impl.hpp
* @author <NAME>
*
* A dual-tree traverser for the cover tree.
*
* This file is part of MLPACK 1.0.8.
*
* MLPACK is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Fo... | ALGO | 0.987751 | 7.165887 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-04-19T04:27:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c061843153a... |
7dcc6ebb-4a13-4345-93f4-c0148fab0187 | TurtleShip/ProgrammingContests | Solutions/TopCoder/SRM_DIV2/SRM498_DIV2/Try2/AdditionGame.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cm... | ALGO | 0.99985 | 4.815828 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2014-04-19T08:12:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8499a3cc... |
8f013d15-77c2-4e3c-904e-3305ffadba61 | magdi14/Algorithms | Kruskal.cpp | // UVA: 11631
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
struct DisjointSets
{
int n;
int* parent;
int* num_nodes;
int MaxN;
void Initialize(int _n)
{
n = _n;
parent = new int[n+1];
num_nodes = new int[n+1];
for(int i=1; i<=n; i+... | ALGO | 0.999977 | 3.733123 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-03T21:59:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45fff4cc51... |
1df4feff-65b8-44f7-8d79-f925ae8108ac | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1227/personal_submission/cf1223c_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN ((int) 2e5)
using namespace std;
int n, X1, X2, Y1, Y2, A[MAXN + 5];
long long K;
long long calc(int lim) {
long long a = 1LL * X2 / gcd(X2, Y2) * Y2;
a = lim / a;
int b = lim / X2 - a, c = lim / Y2 - a;
long long ret = 0;
for (int i = 1; i <= a; i++) ret += ... | ALGO | 0.999543 | 3.33999 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "8a46... |
3057beed-a5ff-4862-a5ac-3268a66b8075 | mastree/cp | Codeforces/Training/GE1800 Grinding/963D.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define el '\n'
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int K = 26;
struct Vertex{
int next[K];
int go[K];
int id = -1;
char pch;
int p = ... | ALGO | 0.999951 | 3.919022 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-03-13T14:52:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd39fdae1... |
4b8da4c2-ea80-4881-b2a9-54b2b1ceeedf | rishabh27goel/DSA-Extra-Questions | Leetcode/Finding_Pairs_With_a_Certain_Sum.cpp | #include <iostream>
#include <vector>
using namespace std;
class FindSumPairs {
private:
unordered_map<int, int> numTwoMap;
vector<int> numOne;
vector<int> numTwo;
public:
FindSumPairs(vector<int>& nums1, vector<int>& nums2) {
ios_base::sync_with_stdio(false);
cin.tie... | ALGO | 0.999906 | 6.024201 | {
"github_metadata": {
"branch": "main",
"commit_count": 1041,
"repo_created_at": "2022-10-02T12:47: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": "0c866d13b... |
7d5bacd9-c75c-4404-834f-0c73a24b81d4 | infikei/algorithm | programmers/algo/380000+/PG_388353_지게차와_크레인.cpp | // Solve 2025-02-08 (대회 Solve)
// Update 2025-03-25
#include <string>
#include <vector>
#include <queue>
using namespace std;
struct Pair{
int x, y;
Pair(int x, int y) : x(x), y(y) {
}
};
int dx[4] = { 0, 0, -1, 1 };
int dy[4] = { -1, 1, 0, 0 };
int bfs1(vector<string> &storage, char target) {
int... | ALGO | 0.999815 | 5.23152 | {
"github_metadata": {
"branch": "main",
"commit_count": 1613,
"repo_created_at": "2022-05-22T18:51:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d87e8b55b... |
5e2ad915-d9ca-4b5a-9b6a-30fa88231945 | tomsiadev/algorithms | Codeforces/Codeforces-1528D.cpp | /*
Problem: https://codeforces.com/problemset/problem/1528/D
General idea:
Iterate over all cannons and for each vertex 'u' calculate shortest arival time to vertex 'v' (being fired from 'u'), at time t0 = 0.
Store results at dp[u][v] = arival_time. Since cannons are rotating periodically, getting from vertex 'u'... | ALGO | 0.999993 | 4.402372 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-27T12:39: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": "da2c68aecd... |
f9f92653-4eef-4796-bd16-b0867a9474fa | 99Deomns/leecode | 239.cpp | #include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <deque>
#include <queue>
#include <limits.h>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(NUL... | ALGO | 0.999993 | 5.678574 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-06-24T07:57: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": "d6d762f4d... |
98e4ca45-3269-4cc2-88a3-beaead145363 | Syed-HamzaShah/playground | RecoverATreeFromPreOrderTraversal.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.999517 | 4.992846 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2024-10-12T20:48: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": "9f46847ca7... |
98d343d0-b501-420a-9ebf-bf5b302f378c | icmcgema/gema | codes/hld.cpp | /*
Heavy-Light Decomposition
Implementacao do problema: https://acm.timus.ru/problem.aspx?space=1&num=1553
Encontrar o maximo valor de um vertice no caminho entre dois vertices, com
queries de update de incremento no valor de um vertice.
*/
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp... | ALGO | 0.999757 | 4.414875 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2018-05-13T03:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db9a7f26... |
ceb5747a-aa82-42ae-b24f-8ce6eee42418 | Fidelta8/The-Making-of-the-Atomic-Bomb | 2 The effect of a Tamper/Tamper Effect.cpp |
#include <iostream>
#include <cmath>
#include <ctime>
#include <chrono>
#include <fstream>
using namespace std;
//declaring functions
double cr(double r);
int main()
{
//declaring variables and constants
double n;
double const eta = 1.8958 * pow(10, 8); //[1/s]
double const mi = 2.3446 * pow(10, 5); //[m^2... | ALGO | 0.998883 | 3.869579 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-10-19T08:37: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": "a156399fe60... |
bddee0a7-436d-43d5-aa38-4434a9be5357 | vishu-bhandari/DSA | coding_lovebabbar/leetcode arrays lec-10/ArrayIntersection.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> ArrayIntersection(int arr1[], int n, int arr2[], int m)
{
vector<int> ans;
int i = 0, j = 0;
while (i < n && j < m)
{
if (arr1[i] == arr2[j])
{
ans.push_back(arr1[i]);
i++;
j++;
... | ALGO | 0.999993 | 5.579759 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2024-03-04T11:07: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": "7c1da2ac45... |
fcc4a1a8-5e57-446a-800c-002ff09f5a3b | softg0th/degenerative-algoshit-vol2 | A.cpp | #include <cmath>
#include <iostream>
#include <vector>
std::vector<unsigned int> arr;
std::vector<unsigned int> zerosInBlock;
unsigned int blockSize;
void initialize(const std::vector<unsigned int> &input) {
unsigned int n = input.size();
arr = input;
blockSize = static_cast<unsigned int>(std::sqrt(n));
zerosIn... | ALGO | 0.999556 | 5.458589 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-04T00:20: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": "13779e6accfc... |
395011b5-a365-4dc9-aa32-c812eecd6ef1 | Al-mizan/Competitive-Programming | codeforces/practice/B_Sakurako_and_Water.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define endl '\n'
#define ff first
#define ss second
#define pi acos(-1)
#define mod 1000000007
#define newline cout << '\n'
#define no ... | ALGO | 0.999931 | 4.47689 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-08-30T04:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e0bbbde7e2... |
6b722016-c2ba-4c7e-abd4-b6d21063a9fb | YuxiKou/leetcode-3 | ReverseLinkedListII.cc | /*
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list.
*/
/*
find the mth node
start reversing length n - m
n... | ALGO | 0.999934 | 5.86326 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-07-26T23:22: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": "360866130... |
8e29f3c9-9c13-4235-bbaa-09793bc5d35d | ishandutta2007/codeforces-s | shoemakerjo/normal/877/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
char grid[n][m];
string line;
for (int i = 0; i < n; i++) {
cin >> line;
for (int j = 0; j < m; j++) {
grid[i][j] = line[j];
}
}
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
x1--; y1--; x2--; y2--;
//dir... | ALGO | 0.999846 | 3.924245 | {
"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": "eebe69d59251... |
8fcead73-6871-4e72-b69a-f4ad3b26a9e9 | DarkSharpness/DarkSharpness | ACMOJ/15/1511.cpp | #include <iostream>
#include <Dark/inout>
using ll = long long;
const ll N = 1e6+10;
ll sum[N],num[N],n,c[N],x[N];
ll head = 1,tail = 1,q[N],f[N];
inline double slope(ll i,ll j) noexcept
{ return double(f[j] + sum[j] - f[i] - sum[i]) / (num[j] - num[i]); }
signed main() {
dark::read_u(n);
for(int i = 1 ; i <=... | ALGO | 0.99993 | 3.755532 | {
"github_metadata": {
"branch": "main",
"commit_count": 515,
"repo_created_at": "2021-03-20T15:34: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": "ebe52e583e... |
e17ae09f-88a7-41d4-8c3e-89d6b9072959 | duyanh2k2/v-o-l-m-g- | HoaDon.cpp | #include <bits\stdc++.h>
#include "VatTu.cpp"
#include"NhanVien.cpp"
using namespace std;
struct HoaDon
{
int maHD;
char NVlap[30];
char ngaylap[20];
int soluong;
VatTu dsvt[30];
long tongTien;
};
struct NodeHD
{
HoaDon info;
struct NodeHD* next;
struct NodeHD* pre;
};
struct DList
{
NodeHD* Head;
NodeHD* T... | TOOL | 0.956877 | 3.096282 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-24T07:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2e51b889f4b... |
08c5edcb-a630-44a3-a873-dec839e0d3b7 | asomeJay/algorithm | Acm_icpc/C,C++/boj1915.cpp | /* 가장 큰 정사각형 */
#include <iostream>
#include <algorithm>
#define MAX_MAP 1001
#define IN_RANGE 1
#define OUT_OF_RANGE 0
#define CANT 0
#define CAN 1
using namespace std;
int map[MAX_MAP][MAX_MAP];
int dp_map[MAX_MAP][MAX_MAP];
int N, M;
bool can_make(int r, int c, int size);
bool is_range(int r, int c);
int main... | ALGO | 0.999622 | 3.460263 | {
"github_metadata": {
"branch": "master",
"commit_count": 636,
"repo_created_at": "2020-03-05T05:29:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74a732fb... |
fe4b1d3a-8913-42f6-8581-b6bd04ba6bd5 | grmikh/aoc2022 | 5/5_1/soln5_2.h | #pragma once
#include <iostream>
#include <fstream>
#include <iomanip>
#include <deque>
#include <vector>
#include <unordered_set>
std::string soln5_1(std::ifstream&& in)
{
static const std::unordered_set<char> special_chars = {'[', ']', ' ', '\r'};
std::string str;
std::vector<std::deque<char>> stacks;
... | ALGO | 0.999377 | 5.706092 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-12-03T16:45: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": "33f55e42b0... |
b77f031a-1467-4bbb-bdff-65b5701cc84e | Nek5000/nekRS | 3rd_party/AMGX/core/include/solvers/chebyshev_poly.h | /* Copyright (c) 2011-2017, 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 met:
* * Redistributions of source code must retain the above copyright
* notice, this list of ... | ALGO | 0.999374 | 6.307691 | {
"github_metadata": {
"branch": "master",
"commit_count": 405,
"repo_created_at": "2019-08-04T08:45:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 91,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "b93bd... |
6d1ba20f-f859-46c9-a4c7-d5320f1d8c6d | vinod-2309/Competitive-Programming | Codeforces/Tree Dp/A_Copil_Copac_Draws_Trees.cpp | #include<bits/stdc++.h>
using namespace std ;
#define mod 1000000007
#define int long long
#define f(i,a,b) for( int i = a ; i < b ; i++ )
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin() , v.end()
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef ve... | ALGO | 0.999968 | 5.374806 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-06-06T06:38: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": "0f1930ee7... |
8c32caf1-6a71-4538-9a2c-98ae3c392c99 | michelbierlaire/biogeme | archive/libraries/bisonbiogeme/patNL.h | //-*-c++-*------------------------------------------------------------
//
// File name : patNL.h
// Author : \URL[<NAME>]{http://rosowww.epfl.ch/mbi}
// Date : Wed Sep 6 09:01:26 2000
//
//--------------------------------------------------------------------
#ifndef patNL_h
#define patNL_h
#include "patGEV.h... | ALGO | 0.989301 | 5.372408 | {
"github_metadata": {
"branch": "master",
"commit_count": 1272,
"repo_created_at": "2017-11-10T09:44:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 119,
"forks": 53,
"issues": 6,
"pull_requests": 7
},
"file_meta": {
"content_id": "18da... |
b672da3c-522f-44e7-a488-ce9912854612 | MohammadAh2002/Problems-Solving | Problems/Display a Linked List in Order.cpp | /*
Write a function that is passed the head pointer of a singly linked list where the data
type of each node is an integer and that displays those integers, one per line, in the
order they appear in the list.
*/
#include <iostream>
using namespace std;
struct stList {
int Value;
stList* Next;
};
void Prin... | ALGO | 0.989342 | 4.948368 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-09-10T16:23: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": "b3d0a03cc02... |
529417da-b544-4344-8f11-04008221f5f7 | dl57934/Algorithms | 2020-07-30/2143/2143.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll T, A, B;
ll Aorigin[1002], Borigin[1002];
vector <ll> Asum, Bsum;
void input();
int main(){
input();
ll count = 0;
for(auto a : Asum){
ll findNum = T - a;
ll upperNum = upper_bound(Bsum.begin(), Bsum.end(), f... | ALGO | 0.999918 | 3.356864 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2018-12-17T08:15: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": "96ec2416... |
379ef790-62a6-4812-b168-c64c974f470a | pytorch/torchrec | torchrec/csrc/dynamic_embedding/details/clz_impl.cpp | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <torchrec/csrc/dynamic_embedding/details/bits_op.h>
namespace torchrec::bits_impl {
temp... | ALGO | 0.980855 | 7.33717 | {
"github_metadata": {
"branch": "main",
"commit_count": 2711,
"repo_created_at": "2021-07-12T23:15:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2274,
"forks": 542,
"issues": 74,
"pull_requests": 48
},
"file_meta": {
"content_id": "e27... |
787acda1-bbf4-4ff3-8a73-759a6c898806 | JIMpk2w/data-struc-lab | lab04/lab04-1.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
int num, command, push, count = 0;
stack<int> stack;
cin >> num;
int stackOutput[num];
while (num > 0) {
cin >> command;
if (command == 1) {
cin >> push;
stack.push(push);
} ... | ALGO | 0.999854 | 5.087977 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-10T09:23: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": "8d82c93dcc6c... |
0a99fec7-1ab9-417d-b452-0bf14d5c9cc8 | fan-ziqi/rl_sar | src/rl_sar/library/thirdparty/unitree_sdk2-2.0.0/example/state_machine/state_machine.hpp | #pragma once
#include <algorithm>
namespace unitree::common
{
enum class STATES
{
DAMPING = 0,
STAND = 1,
CTRL = 2
};
class SimpleStateMachine
{
public:
SimpleStateMachine(double pd_ratio_init = 0.1, double delta_pd = 0.005) : state(STATES::STAND), pd_ratio(pd_... | TOOL | 0.958204 | 6.441921 | {
"github_metadata": {
"branch": "main",
"commit_count": 181,
"repo_created_at": "2024-03-06T09:06:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 664,
"forks": 75,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d02bc86... |
9b674e7b-fd62-4a9e-9c89-aa75c7fe710c | erlv/15745-project-dswp | DSWP_5.cpp | // 5th step - inserting thread synchronization
#include "DSWP.h"
using namespace llvm;
using namespace std;
void DSWP::insertSynchronization(Loop *L) {
//this->insertSynDependecy(L);
cout << "inserting sychronization" << endl;
int channel = 0;
for (unsigned int i = 0; i < allEdges.size(); i++) {
Edge e = allE... | ALGO | 0.953183 | 3.203712 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2015-05-22T21:48: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": "c98127ff5... |
dd274e84-dca5-4875-8243-dd7b622972d1 | kkafi09/dasprog-data-science | latihan-eas/latihan-eas-soal-3.cpp | #include <iostream>
#include <iomanip>
using namespace std;
struct Interpolation {
int x;
int y;
};
struct ResultInterpolation {
double t;
double gt;
};
double func_gt(Interpolation data[], double t) {
double v0 = (t - data[1].x) * (t - data[2].x) / ((data[0].x - data[1].x) * (data[0].x - data[2].x));
do... | ALGO | 0.999323 | 5.095439 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-10T13:00: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": "e5d4741b0b78... |
d69e785b-71ac-43f8-aec5-5890ea82136b | shubhmrj/DSA_WITH_Cplus | Vector/Question7.c++ | // #include<iostream>
// #include<vector>
// #include<algorithm>
// using namespace std;
// // class Solution {
// // public:
// // int maxArea(vector<int>& height) {
// // int n =height.size();
// // sort(height.begin(),height.end());
// // for(int i=n-1;i>=1;i--) {
// // i... | ALGO | 0.999844 | 5.872808 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-26T09:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88d21b1718d... |
c695871e-8566-46e4-bf68-cc0380697253 | sagaragarwal2404/Vector-Clocks-and-kshemkalyani | VC-cs20mtech11005.cpp | #include<pthread.h>
#include<iostream>
#include<fstream>
#include<unistd.h>
#include<vector>
#include<sstream>
#include<limits.h>
#include<numeric>
#include<cstdio>
#include<sys/socket.h>
#include<stdlib.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<string.h>
#include<math.h>
#include<string>
#include<algori... | ALGO | 0.996118 | 3.81906 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-08-14T19:54: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": "07602210738f... |
67b13607-1b4c-4065-98a2-5a469c97ab7b | Mindjolt2406/Competitive-Programming | TopCoder/SRM/779/250.cpp | #include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==I... | ALGO | 0.999988 | 3.95408 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-11-15T05:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6efc51e9... |
923dcf1c-37a2-4d37-88e8-ffe69ee0f9d4 | zimpha/competitive-programming | topcoder/2020 Humblefool Prelim/NonSimilarTriangles.cpp | #include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <tuple>
using namespace std;
int gcd(int a, int b) {
return b ? gcd(b, a % b) : a;
}
class NonSimilarTr... | ALGO | 0.999541 | 5.27097 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-08-17T16:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd1106... |
814e879a-955a-4c0c-9061-896917451b6e | GabrieleLabanca/AlgoritmiNumericiFisica | prg/05_ODE/henonheile/hh_projection.cc | #include<iostream>
#include<iomanip>
#include<math.h>
#include <fstream>
#include "rk4s.h"
using namespace std;
// y = (x, px, y, py)
void ydot(double t, double *y, double *dy)
{
double X = y[0];
double px = y[1];
double Y = y[2];
double py = y[3];
dy[0] = px;
dy[1] = - X - 2*X*Y;
dy[2] = py;
dy[3] ... | ALGO | 0.999936 | 3.577748 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-04-24T12:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db8bd0404... |
63d172cb-6446-40b2-ad9c-40e3ca283789 | cctbx/cctbx_project | scitbx/random/mersenne_twister.h | /* XXX backward compatibility 2010-06-23
Starting with boost svn rev. 63217 (2010-06-21 19:30:09 -0700)
the implementation below is no longer in sync with the main
boost version.
Waiting for the new boost version to trickle through the system.
Future: use main boost version and the stream interface
to... | TOOL | 0.992432 | 7.053195 | {
"github_metadata": {
"branch": "master",
"commit_count": 38660,
"repo_created_at": "2015-07-22T13:36:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 256,
"forks": 121,
"issues": 120,
"pull_requests": 31
},
"file_meta": {
"content_id": "... |
86bedaee-3cf5-4793-b02b-cc8ccb9445d3 | starviewer-medical/starviewer | starviewer/src/core/orderimagesfillerstep.h | /*************************************************************************************
Copyright (C) 2014 Laboratori de Gràfics i Imatge, Universitat de Girona &
Institut de Diagnòstic per la Imatge.
Girona 2014. All rights reserved.
http://starviewer.udg.edu
This file is part of the Starviewer (Medical Imag... | ALGO | 0.903583 | 7.655612 | {
"github_metadata": {
"branch": "devel",
"commit_count": 10675,
"repo_created_at": "2014-05-30T08:34:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 151,
"forks": 68,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df744... |
691d3fae-f4fe-483c-a972-27210384c88e | manwar/perlweeklychallenge-club | challenge-303/ulrich-rieke/cpp/ch-1.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
std::vector<std::string> split( const std::string & text , char delimiter ) {
std::vector<std::string> tokens ;
std::istringstream istr { text } ;
std::string word ;
while ( std::getline( istr , w... | ALGO | 0.999639 | 4.650334 | {
"github_metadata": {
"branch": "master",
"commit_count": 44412,
"repo_created_at": "2019-03-30T01:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 194,
"forks": 332,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "51... |
559b2deb-08d9-494d-8306-ff76d459f29f | f3270/FAU_Workshop | fau_workshop.ino | // Workshop FAU 23.04.2013
#include <Servo.h>
Servo firstServo; // create servo object to control a servo
Servo secondServo; // a maximum of eight servo objects can be created
//------------------------------------------------------------------------------------------------------
// Edit this block -------------... | TOOL | 0.912232 | 5.322835 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-07-04T01:15: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": "e245c706a5... |
e63609b4-245f-46d6-82ca-622e564505da | crazytuzi/Algorithm | DFS.cpp | #include<stdio.h>
#include<stdlib.h>
#define _MAX_X 5
#define _MAX_Y 4
/*绘制迷宫的函数*/
int draw();
int arr[_MAX_X][_MAX_Y]={0}; //迷宫图
int endx=3,endy=2; //目的地
int startx=0,starty=0; //起点
int stop[][2]={{0,2},{2,2},{
3,1},{4,3}}; //障碍物
int num=1;
int min=-1;
int next_step[][2]=... | ALGO | 0.999896 | 3.277972 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-12T03:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d249b9cf4a... |
d4983eb5-37b4-471d-b4da-9758eba4f46c | daviyan5/estudos | algoritmos/ordenacao/mergesort.cpp | #include <iostream>
using namespace std;
typedef long long LL;
typedef long double LD;
int n;
int cont = 0;
void merge(int *&v, int l, int r) {
cout << "Entrou merge de " << l << " ate " << r << endl;
int aux[n];
int m = (l + r) / 2;
int i = l, j = m;
cout << "v antes" << endl;
for (int i = 0... | ALGO | 0.999958 | 5.200823 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2020-11-09T18:10:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce843b3d650... |
6186934c-a570-431f-ab51-14ce84878507 | bkfish/2018-NUAA-Data-Structrue-Experiments-design | Design/Kit4y/第11题-迷宫-2分/Stack.cpp | #include"Stack.h"
#include"Position.h" //存放方向
#include<iostream>
#include<cstdio>
#include<cstdlib>
#define OK 1
#define ERROR 0
#define OVERFLOW 0
#define etype Position
using namespace std;
bool InitStack(Stack &S)
{
S.top = (SNode *)malloc(sizeof(SNode));
S.base = S.top;
if(!S.top)
{
cout <<... | ALGO | 0.999455 | 3.831445 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-01-10T20:24:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7decfcc9e... |
1f37ca65-0ccc-4b23-915d-7bd2a88285af | SgAkErRu/labs-se | 3 course/spo_lab/lab01/command.cpp | #include "cpu.h"
#include "command.h"
#include <cmath>
#include <iostream>
#include <limits> // для numeric_limits<float>::epsilon(), чтобы сравнивать результат дробных вычислений с 0
using VM_types::cmd_t;
using VM_types::data_t;
using VM_types::address_t;
using VM_types::data_length;
using VM_types::cmd_length;
// ... | TOOL | 0.921117 | 5.1488 | {
"github_metadata": {
"branch": "master",
"commit_count": 427,
"repo_created_at": "2021-11-24T21:13:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30e32880... |
d1d925f1-cc00-4ca3-92a2-69d17bf9dd8a | Gaurav5643976/leetcodeCpp | validParanthese20.cpp | // Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
// An input string is valid if:
// Open brackets must be closed by the same type of brackets.
// Open brackets must be closed in the correct order.
// Example 1:
// Input: s = "()"
// Output... | ALGO | 0.993261 | 6.284014 | {
"github_metadata": {
"branch": "main",
"commit_count": 1667,
"repo_created_at": "2021-01-08T19:15: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": "78b5f0ae0... |
7db66295-bf50-4d2b-b7e2-d314e735c426 | fsq/codeforces | 768B. Code For 1.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <memory>
using namespace std;
#d... | ALGO | 0.999959 | 3.833689 | {
"github_metadata": {
"branch": "master",
"commit_count": 341,
"repo_created_at": "2018-01-18T00:18:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "def23f82... |
6d43820e-e31d-483c-b1d8-d00441da8820 | kuronekonano/OJ_Problem | cpp/UPC-6491 Daydream(优化KMP子串计数&特判).cpp | #include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1e5 + 10;
int n;
char a[maxn];
void kmp_pre(char x[], int m, int next[]) {
int i, j;
j = next[0] = -1;
i = 0;
while (i < m) {
while (j != -1 && x[i] != x[j])
j = next[j];
++i, ++j;
next[i] = x[i] == x[j] ? next... | ALGO | 0.999645 | 3.259748 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-01-17T07:45: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": "17ceb8409... |
d089ff9f-4ead-4329-81e1-8f94cd53deca | wengduo/item | windows/c程序/练习/练习/1.cpp | #include<stdio.h>
/*int main()
{
int arr[5][5] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 };
int i = 0;
int j;
for (int j = 0; j < 5; j++)
{
printf("%d ", arr[i][j]);
if (j == 4)
{
j--;
i++;
}
if (i == 5)
{
i--;
while (j >= 0)
{
p... | ALGO | 0.999693 | 3.388392 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-08-11T00:41:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5bc8327e1... |
3edd50c6-e881-429a-8962-6ed160d49edb | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/try/8294486_5654117850546176_try.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
char ans[1000 + 1];
int ord[1000 + 1];
int n, m, r, o, y, g, b, v;
int main() {
freopen("B-small-attempt0.in", "r", stdin);
freopen("B-small-attempt0.out", "w", stdout);
int c, t, i;
scanf("%d", &t);
for (c = 0; c < t; c++) {
... | ALGO | 0.998253 | 3.460174 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc9f08f0b... |
61c28602-3900-41c5-8558-c700b5335cfc | stereolabs/zed-ros-wrapper | zed_nodelets/src/tools/src/sl_tools.cpp | ///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2023, STEREOLABS.
//
// All rights reserved.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIE... | TOOL | 0.929555 | 6.63894 | {
"github_metadata": {
"branch": "master",
"commit_count": 454,
"repo_created_at": "2015-09-09T14:29:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 470,
"forks": 397,
"issues": 26,
"pull_requests": 1
},
"file_meta": {
"content_id": "e71e... |
e0666519-dd67-4b9e-9fcc-e077fe6f6bc2 | md-qubais/DSA_solved_questions | graphs_problems.cpp | #include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define int long long
#define endl "\n"
#define pb push_back
#define p push
#define fori(n) for(int i=0;i<n;i++)
#define ford(n) for(int i=n-1;i>=0;i--)
#define fl(x,n) for(int i=x;i<n;i++)
#define Maxheap priority_queue<int>
#define M... | ALGO | 0.999324 | 4.461041 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-06T17:30: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": "75db39c741b4... |
425ec041-a501-4bb6-8ee2-55a4c520c6d4 | mkmark/leetcode | leetcode/1977/solution-2.cpp | /*
author: <EMAIL>
time: O()
space: O()
Runtime: tle
Memory Usage:
dfs + dp + sum dp
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
class Solution {
public:
int n;
/// dp[i][j] = sum(dp[j+1][2j-i .. n]), if flag
... | ALGO | 0.999988 | 5.125315 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-01-21T14:01: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": "f8f4d54898... |
a9b31a62-64db-46c6-a0db-44a8e60bac9e | tiankonguse/ACM | contest/TheWaySoFar-Training/2011-Daejeon/A.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
#define N 2005
int n;
int dx[N] , Dx , Dy , dy[N];
struct box {
int x1 , y1 , x2 , y2;
bool operator < (const box& R) const{
return y1 < R.y1;
}
}a[N] , tmp;
int t[200005];
int f[200005];
i... | ALGO | 0.999947 | 3.536168 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2013-03-25T04:04:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 69,
"forks": 40,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "354f93... |
ceda30b7-c975-4c01-b570-69798470ef16 | samarjit-singh/leetCode | 404-sum-of-left-leaves/404-sum-of-left-leaves.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.999946 | 5.793456 | {
"github_metadata": {
"branch": "main",
"commit_count": 2895,
"repo_created_at": "2022-06-01T09:24: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": "63f23e4fd... |
dd199a18-aea1-4140-aefc-f4a53e5faa3c | spacemonkey1101/cppCodesBasic | 9_pointer.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[10] = {1, 2, 3};
cout << "address of arr " << arr << endl;
cout << "address of arr + 1 " << arr + 1 << endl; // one element forward based on data type
cout << "address of arr - 1 " << arr - 1 << endl; // goes back by 1 byte ; out of array
... | ALGO | 0.95834 | 4.065956 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2022-10-22T07:05: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": "a135f0b61... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.