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 |
|---|---|---|---|---|---|---|---|
b0b6e31d-4dcd-418c-a8dd-185c32fcaff9 | RobotLocomotion/drake | multibody/plant/deformable_driver.h | #pragma once
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "drake/common/default_scalars.h"
#include "drake/common/drake_copyable.h"
#include "drake/common/eigen_types.h"
#include "drake/multibody/contact_solvers/contact_solver_results.h"
#include "drake/multibody/contact_sol... | ALGO | 0.958053 | 7.462375 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
895e9799-e130-4297-8ef9-e38848dd660e | viv92/video-analytics | src/dependencies/datk/src/optimization/discAlgorithms/deprecated/minNormPoint.cc | /*
* Implementation of the Minimum Norm Point Algorithm for Submodular Minimization.
The problem is: \min_{X} f(X), where f is submodular.
Author: <NAME> (<EMAIL>)
This was modified to fit into the framework of HSSFOTK.
Melodi Lab, University of Washington, Seattle
*
*/
#include <queue>
#include "stdio.h"
#inc... | ALGO | 0.999783 | 4.983195 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-08-25T07:55:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5af6298eb6... |
8e71eddc-4abc-49be-a174-dcba93dfa73f | pnor/dynamic_paper | src/time_util.cpp | #include <algorithm>
#include <cctype>
#include <chrono>
#include <ctime>
#include <format>
#include <string>
#include <boost/xpressive/xpressive_static.hpp>
#include <sunset.h>
#include <tl/expected.hpp>
#include "format.hpp"
#include "location.hpp"
#include "logger.hpp"
#include "string_util.hpp"
#include "time_fro... | TOOL | 0.984536 | 7.569907 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2023-12-19T03: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": "d0178469ee... |
9a94389b-5be5-47b8-a418-5e0d262d83af | sayan112/Leetcode_Sayan | 718-maximum-length-of-repeated-subarray/718-maximum-length-of-repeated-subarray.cpp | class Solution {
private:
int lcs(vector<int>& n1, vector<int>& n2, int i, int j, int &ans, vector<vector<int>>&dp){
if (i >= n1.size() || j >= n2.size()) return 0;
if(dp[i][j]!=-1) return dp[i][j];
int cur = 0;
if (n1[i] == n2[j]){
cur = lcs(n1, n2, i + 1, j + 1, ans, d... | ALGO | 0.999979 | 6.126022 | {
"github_metadata": {
"branch": "main",
"commit_count": 2787,
"repo_created_at": "2021-12-10T15:08: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": "8442fb586... |
d255d8be-de06-4563-8e98-139b716879b3 | exopeng/Competitive-Programming | cf/misc/lg.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <class T> using Tree = tree<T, null_type, less<T>,
rb_tree_tag, tree_order_statistics_node_update>;
#define mp make_pair
#define pb push_back
#define lb lowe... | ALGO | 0.999978 | 3.752143 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-08-15T17:23: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": "bd0c10f28677... |
700f54a2-a7c2-4f0f-964a-1bafbf2aec52 | iliyian/CompetitiveProgramming | luogu.com.cn/P1349/main.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int mod = 2333;
struct Mat {
int a[2][2];
Mat() {
memset(a, 0, sizeof(a));
}
Mat operator * (const Mat &b) {
Mat res;
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
for (int k = 0; k < 2; k++) {
re... | ALGO | 0.99997 | 4.927261 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc635f7b62... |
940cf5db-720d-43bb-91e8-dc741bb6ec7a | mahabub19/resource | Contest/CF_practice/C_Removing_Smallest_Multiples.cpp | #include<bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << " = "; print(x)
#define ll long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define N (ll)(2e5 +1)
#define f first
#define s second
#define pb push_back
#define mod (ll)(1e9+7)
void print(vector<ll> &vec){
f... | ALGO | 0.99993 | 3.817033 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-17T12:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2675a32ed6be... |
6ac4d5bf-ad22-43e7-9a93-312da5744a57 | gyan2976/Competitive-Programming | Trees/Generic Tree/GenericTree - Dynamic.cpp | #include <bits/stdc++.h>
#include <limits.h>
#include <stdio.h>
#include <climits>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
//Generic Tree - Dynamically
class TreeNode
{
public:
int data;
vector<TreeNode*> children;
TreeNode(int da... | ALGO | 0.999921 | 5.141734 | {
"github_metadata": {
"branch": "main",
"commit_count": 342,
"repo_created_at": "2022-10-05T19:35: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": "d82ebdf538... |
482f6965-12ec-414c-876b-15d0b95340e8 | goelashwin36/coding-interviews-prep | LinkedList/reverse.cpp | #include <iostream>
using namespace std;
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:
// Using recursion
ListNode *reverseListRecurse(ListNo... | ALGO | 0.999944 | 6.247981 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-06-21T07:55:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac5d72c7a... |
60b8c0e1-c91b-4df5-90f7-bf68cdcf188a | shpvckdotov/Algorithms | contest1taskJ.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
void longest_matching_subsequences_filling(const std::string& first, const std::string& second,
std::vector<size_t>& first_string_len, std::vector<size_t>& second_string_len,
std::vector<std::vector<bool>>& longest_matching_subsequences)
{... | ALGO | 0.999995 | 5.289046 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-02-22T08:58:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "9467938c856... |
af17d0a1-0109-40ec-8930-871d49ec83b8 | callmePicacho/Data-Structres | 上课Demo/9.二叉搜索树的操作.cpp | #include<iostream>
#include<malloc.h>
using namespace std;
typedef int ElementType;
typedef struct TreeNode *BinTree;
struct TreeNode{
ElementType Data;
BinTree Left;
BinTree Right;
};
// 查找递归实现
BinTree Find(ElementType X,BinTree BST){
if(!BST) // 如果根结点为空,返回 NULL
return NULL;
if(X < BST->Data) // 比根结点小,去左子树... | ALGO | 0.999995 | 3.58177 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-05-08T11:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3576,
"forks": 513,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "22ae... |
2ed5c928-9ec1-4b37-b582-02efdacfa626 | ishandutta2007/codeforces-d | daklqw/normal/1081/G.cpp | #include <bits/stdc++.h>
const int MAXN = 100010;
int mod = 998244353;
typedef long long LL;
typedef std::pair<int, int> pi;
void reduce(int & x) { x += x >> 31 & mod; }
int mul(int a, int b) { return (LL) a * b % mod; }
int pow(int a, int b, int res = 1) {
for (; b; b >>= 1, a = mul(a, a)) if (b & 1) res = mul(res, ... | ALGO | 0.999724 | 4.522955 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "dba9b4601b19... |
acd003cb-d941-4168-808f-fa94a10a248c | JunhyukBaik/Foundations-of-Algorithms | The Selection Problem and the Adversary Argument/HW.11.1.cpp | /*
* [2018117635] [백준혁] 저는 이 소스 코드를 다른 소스 코드를 복사하지 않고 직접 작성하였습니다.
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct item {
int index;
int value;
} item_type;
typedef vector<item_type> item_list;
item_type tournament(int low, int high, item_list S, item_list L[])
{
in... | ALGO | 0.999993 | 3.785252 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-04-25T16:01: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": "c8b74cd37fc... |
cfa69266-97f8-422b-9522-bb74f671fd84 | jaxvanyang/acm | jax/codeforces/uncategorized/cf-712/b.cc | #include <iostream>
#include <cstring>
using namespace std;
const int maxn = 3e5 + 5;
char a[maxn], b[maxn];
// int sumA[2][maxn], sumB[2][maxn];
int sum[maxn];
bool flags[maxn];
int main() {
int t;
scanf("%d", &t);
AGAIN:
while (t--) {
int n;
scanf("%d", &n);
scanf("%s%s", a, b);
... | ALGO | 0.999989 | 3.836907 | {
"github_metadata": {
"branch": "master",
"commit_count": 384,
"repo_created_at": "2021-11-02T02:32:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba69188d... |
80e10347-9663-45a9-8756-f2ce3fdf2c07 | 1cekrim/boj | 1987/1987.cc | #include <algorithm>
#include <iostream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
int r, c, max;
std::vector<std::string> map;
std::vector<bool> check(26, false);
void dfs(int x, int y, int cnt)
{
constexpr int dx[] = { 0, 1, -1, 0 };
constexpr int dy[] = { 1, 0, 0, -1 };
max... | ALGO | 0.999763 | 4.559925 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2019-11-06T06:05: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": "dcaab470... |
c7a87352-672a-4781-ad98-76a6d5c06194 | waynebhayes/BLANT | Graphette-faye/Draw/DrawGraphette.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <algorithm>
//Requires c++11 for stoull
#include <string>
#include <vector>
#include <cstring>
#include <cstdio>
#include <math.h>
#include "graphette2dotutils.h"
using std::cout;
using std::cerr;
using std::string;
using std::string... | TOOL | 0.980264 | 5.583993 | {
"github_metadata": {
"branch": "master",
"commit_count": 1648,
"repo_created_at": "2018-01-16T01:08:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 43,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "73012... |
4616534a-c54a-4873-9ebd-484d8dcbc8e1 | tgabor7/FluidSim | LGA/HPPGrid.cpp | #include "HPPGrid.h"
#include <random>
#include <iostream>
HPPGrid::HPPGrid()
{
}
void HPPGrid::collide()
{
//fn = resetFunction(fn);
for (int i = 1; i < width - 1; i++) {
for (int j = 1; j < height - 1; j++) {
for (int k = 0; k < 4; k++) {
int c = f[i][j][(k + 1) % 4] * f[i][j][(k + 3) % 4] * (1 - f[i][... | ALGO | 0.991564 | 4.123824 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2020-09-21T05:22: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": "cb379c696... |
1602baa3-440d-4fa6-8604-1287a541fd35 | chaejinims2/icj-codes | 백준/Silver/2870. 수학숙제/수학숙제.cc |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int n;
string str;
vector<string> v;
const int numA = 'A';
bool compare(string str1, string str2) {
if(str1.empty() && str2.empty())
return false;
if (str1.size() != str2.size()) {
return str1.size() < str2.s... | ALGO | 0.999873 | 4.700191 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-02-19T07:03: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": "fefdb9371195... |
38b5dd8a-5025-4acd-83db-b7c3a98dd757 | fpmanna1/Programmazione_1 | Homeworks/Homework 1/HomeworkCalciatore/Elenco.cpp | #include "Elenco.h"
void swap(Calciatore &, Calciatore &); //interna al modulo
// genera il vettore, cioè alloca lo spazio per un elenco di dimensione
// dim (par. di ingresso alla funzione) e restituisce l'indirizzo del primo elemento
void create(Elenco & l, const int dim, int & nelem) {
l=new Calciatore [dim];... | ALGO | 0.994533 | 4.338461 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-06-23T16:46:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82a74722585... |
e0e3ffd0-bf36-4f28-b060-f10836c88ba9 | thanhtrnnn/dsa-pshit | divide_conquer/fibonaccistring.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
//DSA04005
#define forup(i, a, b) for (int i = (a); i < (b); i++)
#define fordown(i, l, r) for (int i = l; i >= r; i--)
#define print(a, x, y) forup(i, x, y) cout << a[i] << " "
#define all(M) M.begin(), M.end()
#define tests... | ALGO | 0.999988 | 3.938412 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-11T16:17: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": "35e0009ae8... |
2528c8ac-2621-49b2-9309-10b4b75f7106 | Monkus36/Banker-s-Algorithm | banker.cpp | #include <iostream>
#include <fstream>
using namespace std;
const int n = 5; // number of processes
const int m = 3; // number of resource types
int i, j, k;
bool safeSequences[n];
int result[n];
int l = 0;
int allocMatrix[5][3];
int maxMatrix[5][3];
int available[3];
void populateArrays();
void banker();
void outpu... | ALGO | 0.999758 | 3.924041 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-04-27T01:49: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": "bcbb72019e21... |
306db8d2-63e2-4b84-b2f8-1c753a506851 | SungwookLE/PCCP | 2_히든퀘스트1/심화1/boj2444.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n ;
cin >> n;
string mid = "*";
for(int i = 1 ; i < n ; ++i){
mid+="**";
}
for(int i = 0 ; i < (n-1)+1 ; ++i){
for(int j = i ; j < n-1; ++j){
cout << " ";
}
for(int j = 0 ; j < (i+1)... | ALGO | 0.9999 | 3.938195 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2024-01-20T16:02: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": "ed710a5a... |
4d6cb800-e6ab-4701-8704-b3a01f8dceae | eddiebarry/cp_code | iot-project/PEDAP+PEG_MESSAGE_TIME_DELAY.cpp | #include <iostream>
#include <stdlib.h> /* srand, rand */
#include <time.h>
#include <vector>
#include <math.h>
#include <set>
#include <queue>
#include <list>
#include <set>
#define NUM_NODES 100
#define TRANS_POWER .0001
#define CIRCUIT_POWER .0001
#define RECIE_POWER .0001
#define FIELD_X 100
#define FIELD_Y 10... | ALGO | 0.999811 | 3.135648 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-27T23:32: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": "a016fc43e4... |
f5a5cc0a-1c3c-4c2f-9d6d-32b17995f579 | Mayank-Parasar/leetcode | longest_binary_one.cpp | //
// Created by <NAME> on 2020-02-26.
//
/*
* Return the longest run of 1s for a given integer n's binary representation.
* Example:
Input: 242
Output: 4
242 in binary is 0b11110010, so the longest run of 1 is 4.
* */
#include <iostream>
#include <deque>
using namespace std;
deque<int> return_binary(int num) {
... | ALGO | 0.999614 | 4.587928 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2019-09-14T04:35:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "375fceb3... |
dc6d4148-318b-42a2-aa49-f58a13dd15de | theIDinside/cxgledit | src/ui/render/font.hpp | //
// Created by 46769 on 2020-12-20.
//
#pragma once
#include <array>
#include <memory>
#include <string>
#include <vector>
#include <map>
#include <core/buffer/text_data.hpp>
#include <core/math/vector.hpp>
#include "texture.hpp"
#include "vertex_buffer.hpp"
#include <ft2build.h>
#include FT_FREETYPE_H
namespace ... | TOOL | 0.938564 | 3.548868 | {
"github_metadata": {
"branch": "views",
"commit_count": 85,
"repo_created_at": "2020-12-23T17:02: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": "2458049976... |
70ef7f87-d12e-4c5a-9201-afdeeaae8994 | IlhanSeven/projectEuler | Problem_032/p032.cpp | /*
* Solution to Project Euler problem 32 - Pandigital products
* by IlhanSeven
* https://github.com/IlhanSeven/projectEuler
*
* PROBLEM: Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
*/
/* ALGORITHM: Below code is easy to understand.
... | ALGO | 0.999716 | 5.57524 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-10-03T19:42: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": "87ea09861... |
d0019ce0-131c-4bcb-ba71-26714b837df0 | hckim96/One-BOJ-Everyday | G4-2448/2448.cc | #include <iostream>
#include <string>
using namespace std;
#define WIDTH_MAX 6144
#define HEIGHT_MAX 3072
string base[3] = {
" * ",
" * * ",
"*****"
};
char map[HEIGHT_MAX][WIDTH_MAX];
void myPrint(int n, int r, int c) {
if (n == 3) {
for (int height = 0; height < n; height++) {
... | ALGO | 0.999971 | 4.023587 | {
"github_metadata": {
"branch": "master",
"commit_count": 1106,
"repo_created_at": "2020-09-23T04:52:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fa20e1... |
be7226a2-6924-41a8-8c8f-32e454c99c05 | SayedTahsin/Competitive_Programming | Graph/7.PrimsAlgo.cpp | //*<NAME>
//! BlackBeard
#include <bits/stdc++.h>
using namespace std;
void solve()
{
vector<pair<int, int>> graph[10000];
int vis[1000];
memset(vis, -1, sizeof(vis));
int n, m, v, u, w;
cin >> n >> m;
int sum = 0;
for (int i = 0; i < m; i++)
{
cin >> u >> v >> w;
graph[u... | ALGO | 0.999995 | 4.339155 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-07-30T16:07:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68dd4b91e0... |
b1f818e5-59e9-4115-940f-eb8c00cade93 | Osurac/EDA-FAL | ED/Ejercicio 2/main.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include "Horas.h"
#include "Pelicula.h"
bool resuelveCaso() {
int n;
std::cin >> n;
if (n == 0) return false;
std::vector<Pelicula> v;
Pelicula aux;
for (int i = 0; i < n; ++i) {
std::cin >> aux;
v.push_back(aux);
}
std::so... | ALGO | 0.99968 | 4.634107 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-10-16T11:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98c5b4cae7... |
0210780d-d80e-43be-a0bd-83ef19d14cd5 | abhiy13/CP-Solutions | Practice/GOODBAD.cpp | /*
Author: abhiy13(Abhishek)
Int Elligence;
Chandigarh University
Time:-: dd:mm:yyyy hr:mm
*/
#include <bits/stdc++.h>
using namespace std;
#define io ios::sync_with_stdio(false);cin.tie(NULL);
#define pii pair<int,int>
#define pll pair<llu,llu>
#define pb(x) push_back(x)
#define f first
#define se second
type... | ALGO | 0.999831 | 3.521143 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-06-23T06:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f0d9dd7f... |
fdb869eb-5c95-4da5-bbfb-5824e5eebb48 | BBBlgB/my_securenn | libspu/mpc/semi2k/beaver/trusted_party.cc | // Copyright 2021 Ant Group Co., Ltd.
//
// 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 agreed ... | ALGO | 0.908681 | 6.9278 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2023-08-03T09:26: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": "890a96c607... |
5dbcd55b-0704-4949-a9fe-ad2e71f1a68b | chm994483868/HMDailyLearningRecord | Algorithm_C/Algorithm_C/First/MoreThanHalfNumber/MoreThanHalfNumber.cpp | //
// MoreThanHalfNumber.cpp
// Algorithm_C
//
// Created by CHM on 2020/7/22.
// Copyright © 2020 CHM. All rights reserved.
//
#include "MoreThanHalfNumber.hpp"
int randomInRange(int min, int max) {
int random = rand() % (max - min + 1) + min;
return random;
}
void swap(int* num1, int* num2) {
int t... | ALGO | 0.999987 | 4.663553 | {
"github_metadata": {
"branch": "main",
"commit_count": 701,
"repo_created_at": "2021-06-25T01:22:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83dccbd47c... |
0be9f01e-26c6-4eea-924b-f4ba4a6b3ecd | totokadiw/roipmerdeka | fox_beacon/fox_nano.ino | /*
Fox Beacon menggunakan Arduino Nano
14 Pebruari 2022
Jember, Jawa Timur - INDONESIA
Oleh: JZ13OUK, <NAME>
<EMAIL>
https://1014rapi.wordpress.com/
Referensi:
Arduino Nano
https://docs.arduino.cc/hardware/nano
Klik untuk mengakses ArduinoNanoManual23.pdf
Modified from: <NAME> (http://mikemy... | TOOL | 0.978813 | 5.373346 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-05-25T08:34: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": "54eafad8637... |
e09427a1-7663-4def-ae48-1489240cd199 | ideasrule/old_igvc | common_stripped/qwt-6.0.0-rc5/src/.svn/text-base/qwt_clipper.cpp.svn-base | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 <NAME>
* Copyright (C) 2002 <NAME>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
**************************... | TOOL | 0.998804 | 6.530716 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2013-02-24T19:35:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3aa0c26cd2... |
07a01897-a170-460e-a605-19f06ba6f390 | ryusterakiba/Bubble_Rings | sim/src/cloth_old.cpp | #include <iostream>
#include <math.h>
#include <random>
#include <vector>
#include "cloth.h"
#include "collision/plane.h"
#include "collision/sphere.h"
using namespace std;
Cloth::Cloth(double width, double height, int num_width_points,
int num_height_points, float thickness) {
this->width = width;
... | ALGO | 0.992054 | 4.644293 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2022-04-12T02:35:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d4c4d3d2af... |
91a54294-d4c3-42b9-bad6-674daa8a9531 | romeorizzi/portafoglioVoti_public | Algoritmi/2019-09-04/all-CMS-submissions/2019-09-04.11:47:41.095300.VR435956.pacman_best.cpp | /**
* user: VR435956
* fname: XU
* lname: SUNYI
* task: Prob3_pacman_best
* score: 0.0
* date: 2019-09-04 11:47:41.095300
*/
/* template per pacman, problema per esame Algorimi 2018-09-26
Romeo 2018-09-25
*/
#include <cassert>
#include <cstdio>
const int BASE = 1000000;
const int MAXBLUE = 5;
const int MAXM = 1... | ALGO | 0.999614 | 3.714017 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2020-06-21T22:16:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4aa36890... |
e42565cb-b203-4e08-b096-2a3f8733f662 | GEN05/ITMO | Term 1/Algorithms and data structures/Lab_1/3.cpp | #include <iostream>
long long merge(int *c, int p, int q, int r) {
int n = q - p + 1, i = 0, j = 0, m = r - q;
long long cnt = 0;
int *a = new int[n];
int *b = new int[m];
for (int k = 0; k < n; k++) {
a[k] = c[p + k];
}
for (int k = 0; k < m; k++) {
b[k] = c[q + 1 + k];
... | ALGO | 0.999985 | 5.113561 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-04-29T16:39: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": "09c6cc17c... |
bd5617fb-da0f-427b-b5d3-7d97dee44399 | Mfknudsen/UFO-Exam | CppOptimizer/NavMeshOptimized.cpp | #include <cmath>
#include "NavMeshOptimized.h"
using namespace std;
vector<vector<float>> NavMeshOptimized::getVertices() {
vector<vector<float>> result = vector<vector<float>>();
for (int i = 0; i < vertices2D.size(); ++i) {
Vector2 v = vertices2D.at(i);
result.push_back(*new vector<float>{... | ALGO | 0.999249 | 3.963467 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-03-17T19:27: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": "9bc9ffcaa9d... |
0eea8d19-e63b-4da2-8d55-d9f6433e0599 | kunalMore23/Solar_Panel_Simulator | BSpline3D/BSpline3D.cpp | #include "pch.h"
#include "BSpline3D.h"
#include <vector>
using namespace std;
BSpline3D::BSpline3D(Point3D inP0, Point3D inP1, Point3D inP2, Point3D inP3) :
degree(3),
mP0(inP0),
mP1(inP1),
mP2(inP2),
mP3(inP3)
{
// Generate a simple knot vector for an open B-spline
int n = 4;
int m ... | ALGO | 0.941656 | 5.641245 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-12-11T08:58:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eef05cab35f... |
646e5bd3-60ff-4063-8197-b3a173ef0a1f | Riverside-City-College-Computer-Science/CSC5_Winter_2014_40651 | an2503076/Lab011514/Loops/RetirementSavings/main.cpp | /*
File: main.cpp
Author: <NAME>
Created on January 15, 2014
*/
//System Libraries
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
//global Constants
const unsigned char CNV_PERC=100;
//function prototypes
/*
*
*/
//execution begins here!
int main(int argc, char** argv) {
... | ALGO | 0.97359 | 3.65781 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2014-01-09T02:22:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f632ca476... |
565c3009-e0df-45a5-80e4-d9f757979fd1 | Altynai/LeetCode | number-of-flowers-in-full-bloom/answer.cpp | class Solution {
public:
vector<int> fullBloomFlowers(vector<vector<int>> &f, vector<int> &p) {
int n = f.size();
vector<pair<int, int>> events;
for (int i = 0; i < n; i++) {
events.emplace_back(f[i][0], 1);
events.emplace_back(f[i][1] + 1, -1);
}
sort(events.begin(), events.end());
... | ALGO | 0.999969 | 6.183134 | {
"github_metadata": {
"branch": "master",
"commit_count": 2981,
"repo_created_at": "2014-02-07T14:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e373f1... |
fff28732-64c9-47dc-b54b-5e9b90ca3254 | luofeng457/fmtconv-git | src/fmtcl/TransOp2084.cpp | /*****************************************************************************
TransOp2084.cpp
Author: <NAME>, 2015
--- Legal stuff ---
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of ... | ALGO | 0.969527 | 6.204409 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-08T15:30: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": "b5039fa5b0... |
b0f7ad65-8f5e-4737-812d-430bc51c6fea | mohumedsalah/Problem-Solve | sagheeer/[Graphs] Basic Algos 3/10199 - Tourist Guide.cpp | #include <bits/stdc++.h>
using namespace std;
#define repi(i, j, n) for(int i=(j);i<(int)(n);++i)
#define rln() getchar()
#define rint(n) scanf("%d",&n)
#define rs(n) scanf("%s",n)
#define rc(n) scanf("%c",&n)
#define rf(n) scanf("%lf",&n)
#define rl(n) scanf("%lld",&n)
#define pint(x) printf("%d", x)
#define psp() p... | ALGO | 0.999808 | 3.577087 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2017-09-25T23:35:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "474c37feb... |
517b205e-35b0-4beb-b2ba-2182d25eec0b | malaifa/source | src/protocols/backrub/BackrubProtocol.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.996561 | 5.463405 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-19T15:35:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8957703ee... |
67cc1e54-9bd1-44b2-8929-d45df6885f1a | Jauoad/Data-Structures | SuffixArray.cpp | // ﷽
// SuffixArray.cpp (filename)
// Source: https://github.com/Jauoad
// Copyright (c) 2024 Jauoad
#include <iostream>
#include <vector>
#include <algorithm>
// Structure to represent a suffix
struct Suffix {
int index; // Index of the suffix in the original text
std::string suffix; // String representing t... | ALGO | 0.999654 | 5.935956 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-05-19T15:38: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": "0799eeb1f23... |
b7185635-9e0b-4edb-83ae-f27e91985c4f | ChenhanYu/hmlp | frame/containers/KernelMatrix.hpp | /**
* HMLP (High-Performance Machine Learning Primitives)
*
* Copyright (C) 2014-2017, The University of Texas at Austin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either ... | ALGO | 0.997988 | 6.347991 | {
"github_metadata": {
"branch": "master",
"commit_count": 523,
"repo_created_at": "2016-10-21T21:03:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 8,
"issues": 20,
"pull_requests": 0
},
"file_meta": {
"content_id": "f733e7... |
e0c54a85-8d9d-464c-9f40-8b6eb34fc660 | rsanchez1993/Learning_CPlusPlus | Data Structures GWC/Assignment002/driver.cpp | // FILE: Driver.cpp
#include <iostream>
#include "List.h"
using namespace std;
template <typename T>
void cinNbr(T&); // enter a number from keyboard
void displayItems(const List<double>&);
void addItems(List<double>&);
void searchItem(const List<double>&);
void removeItem(List<double>&);
void removeCopies(List<doubl... | TOOL | 0.988443 | 4.649608 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-04-20T07:35: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": "22144853d... |
15b090e3-366d-4e53-bd99-e6b2ff83f353 | RajibTheKing/Interview_Preparation | Practice_Problems/Largest_Rectangle_In_Histogram.cpp | //explanation: https://www.youtube.com/watch?v=ZmnqCZp9bBs
class Solution {
public:
int largestRectangleArea(vector<int>& heights)
{
stack<int> st;
int i = 0;
int area = 0;
int maxArea = -1;
for (; i < heights.size(); i++)
{
// cout << "Pos : " << i... | ALGO | 0.99988 | 5.834243 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2022-04-29T20:52: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": "0b15b0ad... |
52e25ad8-8ded-4e25-b9c6-992602e40640 | wiki-152/Object_Oriented_Programming | Assignments/2/Solutions/C++/Solutions/Question 5.cpp | /*
<NAME>
22I - 2469
BS SE-E
*/
#include <iostream>
using namespace std;
class Integer
{
private:
int num;
string str;
public:
Integer()
{
num = 0;
str = "-";
}
Integer(int input_num)
{
num = input_num;
}
Integer(string input_str)
{
str = input_str;
}
void set(int input_num)
{
num... | ALGO | 0.969003 | 4.248021 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-09T19:45: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": "bc7b9f73ac23... |
c765ec06-c12f-4c69-a7a3-3f3e658be815 | Nhatthang27/CompetitiveProgramming | ICPC/2024-Asia-Yokahama/B_The_Sparsest_Number_in_Between.cpp |
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve()
{
int a, b;
cin >> a >> b;
int res = 0;
int ans = -1;
for (int i = 62; i >= 0; i--)
{
if ((a >> i) & 1)
res |= (1LL << i);
else
{
int tmp = res | (1LL << i);
... | ALGO | 0.999947 | 4.032889 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-27T03:40: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": "87f5ade86027... |
f39f7133-c8be-42c6-bbee-30dceef69e45 | OAAX-standard/hailo-acceleration | runtime-library/deps/onnxruntime/onnxruntime-4.17.0/cmake/external/onnxruntime-extensions/operators/text/op_equal_impl.hpp | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include <vector>
#include <string>
#include "string_utils.h"
#include "string_tensor.h"
template <typename T1, typename T2, typename T3>
class BroadcastIteratorRight {
public:
BroadcastIteratorRight(const s... | ALGO | 0.994946 | 7.332864 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-11-11T09:11:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15a28f91bd2d... |
53ef86ba-92da-4810-a8d2-a4ef3b6c5f0a | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0410/personal_submission/cf439d_sheepstick.cpp | #include<bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
int n, m; cin >> n >> m;
vector<int> a(n), b(m);
vector<array<int,2>> mixed;
for (auto &ai : a){
cin >> ai;
mixed.push_back({ai, 0});
}
i64 bTot = 0;
for (auto &bi : b){
cin >> bi;
bTot += bi;
mixed.push_back({bi, 1});
... | ALGO | 0.999955 | 3.372246 | {
"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": "ab15... |
2beca94e-e87a-4177-8344-39406a80d32d | whing123/C-Coding | Others/1.cpp | /* *题目:
* 线段重合问题,最少需要多少次将线段全部清除,选一个点会将涵盖该点的所有线段清除
* 输入第一行线段数,下面两行:起点行,终点行
* *思路:
* 将所有线段的点排序后放在坐标轴上构成许多小线段,在这些小线段中找出涵盖数最多的,然后把涵盖线段去除,再重复上述,直到没有线段
* *技法:
*
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct line {
int start;
int end;
line(int s, int e) { start = s... | ALGO | 0.999992 | 3.958668 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-09-05T04:34:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94074be09... |
0328ce0a-9c9b-46af-869e-0ac48131decb | jamarshon/Leetcode | 870-879/877StoneGame.cpp | /*
877. Stone Game
Alex and Lee play a game with piles of stones. There are an even number
of piles arranged in a row, and each pile has a positive integer number of
stones piles[i].
The objective of the game is to end with the most stones. The total number of
stones is odd, so there are no ties.
Alex and Lee take ... | ALGO | 0.999874 | 5.435174 | {
"github_metadata": {
"branch": "master",
"commit_count": 412,
"repo_created_at": "2016-07-09T03:02:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f481b679... |
4b68eeb0-b485-44a8-ba56-c49f950bb034 | Shine124-sys/DSA-C-CPP | Stacks/BYLINK.CPP | #include <iostream>
using namespace std;
struct node {
int info;
struct node *link;
};
struct node *top;
void create();
void traverse();
void push();
void pop();
int main() {
create();
cout << "\nStack is:\n";
traverse();
push();
cout << "\nAfter pushing an element, the stack is:\n";
... | ALGO | 0.99963 | 4.246239 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-02-04T14:14: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": "1a0bc572a12... |
32310236-b27e-4904-a561-695f98f7c6f8 | abhisri459/anything | newfolder/Best_state.cpp | // elements in descending order.
#include <iostream>
#include <vector>
using namespace std;
void print(vector<int> a, int n)
{
for (int i = 0; i <= n; i++)
cout << a[i] << " ";
cout << endl;
}
// Sorts a[] in descending order using
// bubble sort.
void sort(vector<int> a, int n)
... | ALGO | 0.999981 | 4.773111 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-09-18T05:11:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76739a8e42... |
e721bace-64d7-4662-99f6-86e716a9a9f3 | foo-bar-omastar/c-plusplus-tutorials | Program_13.CPP | /*Assuming The class stock....the following functions are performed:
1. Write the objects of STOCK to the binary file STOCK.DAT
2. Read the objects of STOCK fromthe binary file STOCK.DAT and display them
on the screen...
3. Count and Display the number of records in the file... */
#include<iostream.h>
#incl... | TOOL | 0.95633 | 3.835136 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-08-13T15:09: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": "935b7ab77... |
f701b1f8-f0db-4be0-a030-2a7b1cbdd3d9 | Rodrigo61/GUAXINIM | SPOJ/DQUERY/main.cpp | using namespace std;
bool debug = false;
//<editor-fold desc="GUAXINIM TEMPLATE">
/******** All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#incl... | ALGO | 0.999964 | 4.608683 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-03-16T13:30:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "468ce8c95... |
f69bff1a-acc0-4b75-a511-49d75d8aa871 | tanmoy108/C-PLUS-PLUS-Files | 40_array_problem_4.cpp | /*
40.
Problem:
Given an unsorted array A of size N of non-negative integers, find a continuous subarray which adds to a given number S
Consstraints:
1<= N <=10^5
0<= Ai <=10^10
Example:
Input:
N=5, S=12
A[] = {1,2,3,7,5}
Output: 2 4
Explanation: The sum of elements from 2nd position to 4th position is 12.
*/
#inc... | ALGO | 0.999976 | 4.207716 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2022-08-25T15:44:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "730af817a5... |
85cd57dd-c585-4ba5-8b9b-b018140da9ab | Nanako7-ix/Daily | E_Min_of_Restricted_Sum.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define setpre(x) fixed << setprecision(x)
#define debug(x) cerr << #x << " = " << x << "\n"
#define endl "\n"
using namespace std;
using namespace __gnu_pbds;
using i64 = long long;
using u64 = unsigned long long;
usin... | ALGO | 0.998901 | 3.730667 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2025-04-01T07:11: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": "277011225fc... |
d9640d11-dbbb-4b4c-a6e9-208a64ff6c16 | Golangltd/codeclass | interface{}/src/opencv-master/opencv110/cvaux/src/vs/blobtrackanalysistrackdist.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.985386 | 6.260011 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-08-14T03:58:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 615,
"forks": 195,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "de375... |
50bc4347-3071-4540-80fe-2bf30ed62896 | zyk326/algorithm | enhance/22.cpp | #include<iostream>
#include<math.h>
#define MaxSize 102
using namespace std;
int N, D;
int point;
int i, j;
bool flag = false;
struct Node{
int x;
int y;
}nodes[MaxSize];
int vis[MaxSize];
double dis_loc_ii(int loc, int to){
return sqrt(pow(nodes[loc].x - nodes[to].x, 2) + pow(nodes[loc].y - nodes[to].y... | ALGO | 0.999993 | 3.869157 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-03-05T14:03: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": "2c2b8529dae... |
1e34e391-b426-418a-bb5d-057d3a372328 | cassiewilliam/cutlass_hopper_tutorial | src/c10/7_mixed_gemm/1_w4a8_dense_gemm/builder.hpp | #pragma once
#include "cutlass/epilogue/collective/collective_builder.hpp"
#include "cutlass/gemm/collective/collective_builder.hpp"
#include "dispatch_policy_extra.hpp"
#include "mainloop_sm90_tma_gmma_ws_x.hpp"
namespace cutlass::epilogue::fusion {
// D = alpha * acc
template<int StagesC,
int StagesD,
... | ALGO | 0.91255 | 6.866416 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-11-12T07:55:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f4d7ec6b3e... |
98118a3a-3e5b-428f-8ee5-e0ab0b4a4e95 | melvin-salcedo/firstGame | nave/asteroides.h | #include <list>
#include <allegro.h>
class Meteoro:public Bala,public NAVE{
int x;
int y;
int etiqueta;
int numero=1;
int yy=0,xx=0, velocidad=0;
int personal,comparacion=1;
int puntaje=0,cuerpos=0;
int vida=110;
int fin;
public:
int contador_=0;
Meteoro(int _x=0,int _y=0,in... | ALGO | 0.947961 | 4.206089 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-04-17T12:54: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": "de3002ecc2... |
611f2e76-cd78-4553-b4b5-3c0bf252f419 | marioyc/Online-Judge-Solutions | TJU/1411 - Arctic Network.cpp | #include <cstdio>
using namespace std;
int parent[500],rank[500];
void Make_set(int x){
parent[x] = x;
rank[x] = 0;
}
int Find(int x){
if(parent[x]==x) return x;
parent[x] = Find(parent[x]);
return parent[x];
}
int num_comp;
void Union(int x, int y){
int PX = Find(x),PY = Find(y);
if(P... | ALGO | 0.999915 | 4.433743 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2010-09-24T16:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 603,
"forks": 359,
"issues": 1,
"pull_requests": 9
},
"file_meta": {
"content_id": "97bf... |
e6936f95-398c-4e53-81e7-13a79d072f67 | raincross7/code-similarity | codes/train_code/problem499/problem499_365.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll mod = 1e9+7;
const ll INF = 1e18;
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
int main() {
cin.tie(0);
ios_base::sync_with_s... | ALGO | 0.999968 | 4.254994 | {
"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": "25741e014c65... |
364acc08-1ca2-444a-ab1a-c791447d40f2 | PowerNeverEnds/BaekjoonOnlineJudge_Cpp | 1000~1999/1647_도시 분할 계획.cpp | /**
* BOJ 1647
* - 도시 분할 계획
* author: phcdream
* created: 오전 12:47 2020-12-19
**/
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
typedef long long ll;
#define INF ((int)1e9+7)
#define ALL true
#define dfor if(true && ALL) for
#define dout if(true && ALL) cout
using nam... | ALGO | 0.999967 | 4.385909 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-12-25T01:47: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": "f7481b9ce4... |
58fed4aa-ad19-4421-add5-7df22d1d2eac | thepluck/CP-Training | Private/AnhVuong/R2/Codes/pinball.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
class segTree {
private:
vector <ll> val; int lo, hi, n; ll res;
void update(int i, int l, int r, ll v) {
val[i] = min(val[i], v);
if (l != r) {
int m = (l + r) / 2;
if (m >= lo) update(i * 2, l, m, v... | ALGO | 0.999966 | 3.868659 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-11T09:33: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": "b53f0abd5c2d... |
377ea608-b307-4590-a914-7ef09aeed333 | spencermcw/Code | csci211/labs/lab6/list.h | // demonstrate a simple linked-list of integers
#ifndef LIST_H
#define LIST_H
class List
{
public:
List();
~List();
void insert(int value); // insert at beginning of list
void print(); // print all values in the list
// fill in the bodies of these four function in list.cpp
... | TOOL | 0.910861 | 4.596756 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-04-23T01:35:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f41b56686a... |
b34e7553-a9b4-45f4-9dbb-79d64901fa21 | quangloc99/CompetitiveProgramming | olympiad/JOISC/2019/naan.cpp | /**
* Author: <NAME> (darkkcyan)
* Problem: https://oj.uz/problem/view/JOI19_naan
* Code solution + test data: https://www.ioi-jp.org/camp/2019/2019-sp-tasks/index.html
* Well this problem is surely not easy as it seem, and sadly there was not English
* solution. This solution below is from the code solution and t... | ALGO | 0.999996 | 3.413048 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2018-10-30T16:35:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b574e299... |
d5556826-a362-444d-abbb-f0189269b009 | agnihotriankit23/DSA_Sheet | Strongly Connected Components (Kosaraju's Algo) - GFG/strongly-connected-components-kosarajus-algo.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
void dfs(int node, vector<int> &vis,stack<int> &s, vector<int> adj[])
{
vis[node]=1;
for(auto i : adj[node])
{
if(vis[i]==0)
dfs(i,vis,s,adj);
}
s.push(node);
}
void DFS(int node, vector... | ALGO | 0.999868 | 6.175832 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2022-09-14T09:44: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": "9483e5f087... |
52d0d966-ac2e-4d25-87bd-1061b92e00bf | ankur-verma30/Coding-with-LeetCode | 1442-number-of-operations-to-make-network-connected/1442-number-of-operations-to-make-network-connected.cpp | class DisJointSet {
public:
vector<int> size, parent;
DisJointSet(int n) {
size.resize(n, 0);
parent.resize(n);
for (int i = 0; i < n; i++)
parent[i] = i;
}
int findUltimateParent(int node) {
if (node == parent[node])
return node;
return ... | ALGO | 0.999891 | 5.370221 | {
"github_metadata": {
"branch": "main",
"commit_count": 3981,
"repo_created_at": "2023-09-29T18:14: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": "bea57435d... |
e8bbd100-dd6e-4cc3-ae76-065e9df313c1 | simonnguyen175/cp-repo | daily/cohuong/10-11/DE2/period.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int t = 0, n;
string s;
int p[N];
void solve(){
if ( n == 0 ) return;
cin >> s;
s = ' ' + s;
p[1] = 0;
int k = 0;
for (int i = 2; i <= n; i ++){
while ( k && s[k+1] != s[i] ) k = p[k];
if ( s[k+1] == s[i] ) k... | ALGO | 0.998891 | 3.365228 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21: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": "0414358c5c... |
b442653c-f4c1-4d60-a649-76736dcc65ff | NikosMav/Operating-Systems-1 | source/channel.cpp | #include "../headers/aux.h"
#include <time.h>
using namespace std;
int main() {
//Loading semaphore
sem_t *chan_r_enc1 = sem_open(CHAN_CRF_ENC1, 0);
sem_t *chan_w_enc2 = sem_open(CHAN_CWT_ENC2, 0);
sem_t *enc2_r_chan = sem_open(ENC2_CRF_CHAN, 0);
sem_t *chan_r_enc2 = sem_open(CHAN_CRF_ENC2, 0);
... | ALGO | 0.998995 | 4.100962 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-20T23:18: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": "03d2beb4a10d... |
88cb526b-bdb6-4970-9898-302a93e14ca1 | Lambpot/MCTS-Puissance-4 | test4_JMCTS2_0.5/test_JMCTS2.cpp | #include "projet.hpp"
#include "p4.hpp"
#include <vector>
#include <iostream>
#include <iomanip>
int main() {
unsigned temps = 1000;
Joueur<P4>* ia1 = new JMCTS<P4>(1.4, temps);
Joueur<P4>* ia2 = new JMCTS2<P4>(1.4, temps);
std::vector<Joueur<P4>*> joueurs = {ia1, ia2};
unsigned nbTours = 1;
s... | ALGO | 0.998847 | 4.70955 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-23T10:25:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3a97aa71949... |
5212c5e5-5587-4e1a-8cb9-744c7aa3aaf3 | druidream/competitive-programming | atcoder/abc323/B/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define Rep(i, x, n) for (int i = x; i < n; i++)
#define rev(i, n) for (int i = n - 1; i >= 0; i--)
#define LSOne(S) ((S) & (-S))
#define roundUp(a, b) ((a + b - 1) / b)
#define print(x) cout << x << '\n';
#define printBool(x) ... | ALGO | 0.999942 | 4.198158 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-04-04T10:26: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": "8033cb58c9b... |
0b05f48e-6e8b-4bce-92d4-253684984ed9 | KiraYoshikage1999/Pointers11 | ProjectTutorial11/ProjectTutorial11.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <ctime>
#include <string.h>
using namespace std;
#include "ArreyFunction.h"
void main() {
int amountOfBooks = 4;
char** str = new char* [amountOfBooks];
for (int i = 0; i < amountOfBooks; i++) {
str[i] = new char[12];
cout <... | TOOL | 0.980676 | 3.333891 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-06T16:56: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": "96410103e0... |
a9f7ef29-00c0-49b7-bde2-0c6b9738c367 | VSkvortcova/Tehnology_program | Лабораторная_2.cpp | #include <iostream>
using namespace std;
// Вектор
class vect {
private:
int dim;
double* b;
int num;
static int count;
public:
// Конструктор по умолчанию.
vect() : dim(0), b(nullptr), num(++count) {
cout << "Вектор #" << num << ": создан по умолчанию." << endl;
}
// Кон... | ALGO | 0.998606 | 3.808923 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-20T07:40: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": "743e9290c82b... |
4812efec-fa16-47e9-b193-b55a0554563e | Bappy38/Advanced-Problem-Solving | Prefix Sum & Difference Array/2D prefix sum.cpp | #include<bits/stdc++.h>
#define Input freopen("in.txt","r",stdin)
#define Output freopen("out.txt","w",stdout)
#define ll long long int
#define ull unsigned long long int
#define pii pair<int,int>
#define pll ... | ALGO | 0.999777 | 3.422391 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-06-07T06:28: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": "0017fd3a0... |
b3b13a2e-1438-4ffd-9dfc-d426b4a1966b | OwaisK4/Competitive-Programming | Vjudge/Fall 2023 Rounds/Fall 2023 Round 15/B_Dungeon.cpp | #include <bits/stdc++.h>
#define int long long
#define all(a) a.begin(), a.end()
#define seed chrono::high_resolution_clock::now().time_since_epoch().count()
#define file_read(filepath) freopen(filepath, "r", stdin);
#define file_write(filepath) freopen(filepath, "w", stdout);
#define fastio \
ios... | ALGO | 0.999975 | 4.868897 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-04T18:41: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": "83f469051ee4... |
f1b2bfb7-d5f6-4711-a7d7-58643506ecc8 | SproutMJ/baekjoon | 17136.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
bool board[10][10];
int card[6] = {0, 0, 0, 0, 0, 0};
int ans = 987654321;
void dfs(){
bool flag = true;
int r = 0;
int c = 0;
for(r = 0; r<10; r++){
for(c = 0; c<10; c++){
if(board[r][c] == true){
... | ALGO | 0.999706 | 4.353026 | {
"github_metadata": {
"branch": "master",
"commit_count": 329,
"repo_created_at": "2022-01-22T07:17: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": "ca912468... |
501107b9-cf44-489d-8c54-8c5528a28d30 | ollenurb/uni-dump | Projects/SCPD/Mandelbrot/src/ondemand/worker.cpp | #include "worker.h"
#include "../utils/constants.h"
#include "../utils/mandelbrot.h"
#include <mpi.h>
#include <iostream>
#include <vector>
void Worker::compute_mandelbrot(int size) {
int x, y;
double x_0, y_0;
for(int i = 0; i < size; i++) {
x = (from_to[0] + i) % width;
y = (from_to[0] +... | ALGO | 0.986534 | 5.404074 | {
"github_metadata": {
"branch": "master",
"commit_count": 325,
"repo_created_at": "2020-12-24T11:22:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "512c1b1f... |
4b466a98-4df2-43f4-a311-a87f5206c315 | rg-rupeee/competitive-programming | cp/Little_Elephant_and_Candies.cpp | /*
author : <NAME>
id: rg_rupeee
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define MAX_N 1e5+1
#define INF 1e9
#define MOD 1e9+7
#define LINF 1e18
#define rep(i,n) for (i... | ALGO | 0.999951 | 3.755795 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-04-22T19:58: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": "ee084b7371f... |
a0bc15e2-ad80-4e47-99e3-7c15aee04296 | edw9998/DSA | week6/chain_hashing.cpp | #include <bits/stdc++.h>
using namespace std;
class HashTable{
public:
// For Each Bucket(idx) Points To List.
int bucket;
// Pointer To The Array Containing Buckets Linked To Lists.
list<int> *table;
HashTable(int bucket_nums);
int hashFunction(int key);
v... | ALGO | 0.983618 | 4.920973 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2021-02-19T15:52: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": "a8a0292822... |
286ab135-e66f-45d8-a1c0-6da8d838ada3 | claris-yang/knowledge_planet | luogu/P1102.cpp | //
// Created by yangtao on 20-4-8.
//
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll ;
const int N = 2e5+5;
int a[N];
int n, c;
ll res;
int searchl(int l, int r, int c) {
while(l < r) {
int mid = (l + r) >> 1;
if(c <= a[mid]... | ALGO | 0.999993 | 3.934189 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-07-06T06:42:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f22d6638... |
c4efd7f8-4fc1-4bb4-9c91-d13c979bb55e | adityasin39/LOVE-BABBAR-DSA-PROGRAMS | comparerevisionnumbersleetcodesdesheet.cpp | class Solution {
public:
int compareVersion(string version1, string version2) {
int i=0;
int j=0;
int m=version1.size();
int n=version2.size();
bool isleading1=true;
bool isleading2=true;
while(i<m && j<n)
{
while(i<m && isleading1 && versi... | ALGO | 0.999511 | 5.275089 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-01-28T11:54: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": "225d77a58d... |
ffebe6ba-147c-4795-a274-415d0d7d4b41 | lmc5474/Algorithm-cpp | Class010/MergeTwoLists.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
//https://leetcode.cn/problems/merge-two-sorted-lists/description/
struct ListNode{
int val;
ListNode *next;
ListNode(): val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr){}
ListNode(int x, ListNode *next):v... | ALGO | 0.999957 | 5.418749 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-06T07:50: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": "9b774ba06935... |
b2ba928b-d786-467e-b7ef-9b0c5f714ae6 | chaitanyav/fun_code | sieve_of_atkin.cpp | /*
*
* Copyright 2011, <NAME>
*
*
* Author <NAME>
*
* Sieve of Atkin http://en.wikipedia.org/wiki/Sieve_of_Atkin
*
*/
#include <stdint.h>
#include <iostream>
#include <cmath>
#include <bitset>
using namespace std;
int main() {
const int64_t N = 100000000;
bitset<N> sieve;
sieve.reset();
sieve.flip(... | ALGO | 0.999549 | 4.053175 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2010-09-12T18:56:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f121eb4d... |
8449f64e-6817-47d0-ab6c-68553be4b407 | secondcycle/essentials | programming_practice/c++/class_objects.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
// Write your Student class here
class Student {
int score[5] = {0, 0, 0, 0, 0};
int numOfScores = 5;
public:
void input(){
for(int i=0; i < numOfScores; i++){
... | ALGO | 0.999733 | 3.90841 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-04-04T08:43: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": "db2649c701... |
fe59c01c-8d62-4b41-a670-0323140d86b4 | joey-joe-joe-jr/AoC22 | day5/part2.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <utility>
#include <cstdio>
using namespace std;
vector<string> read_ip(string s)
{
vector<string> lines;
string line;
ifstream ip(s);
while(getline(ip,line))
lines.push_back(line);
return lines;
}
stru... | ALGO | 0.999908 | 3.689588 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-12-16T11:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ace1b187df4... |
3fa8dbdc-cb21-4bd0-afce-6b59c3c00cf4 | zcy05331/code-backup | 洛谷/P1337.cpp | #include <bits/stdc++.h>
const int MaxN = 1010;
const double delta = 0.993;
struct node
{
int x, y, w;
};
int n;
node a[MaxN];
double ansx, ansy;
double ans = 1e18, t;
inline int read()
{
bool f = 0;
int x = 0;
char ch = getchar();
while (ch < '0' || ch > '9')
{
if (ch == '-')
... | ALGO | 0.999967 | 4.13547 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-02-19T14:44: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": "0758b7fd4... |
a1f771c4-cd8c-4883-b1e2-531e2ddb7499 | BaeJi77/algorithm | BOJ/15000~/16000/16991.cpp | #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
using namespace std;
int N;
vector<pair<int, int> > vt;
double map[20][20];
double dp[17][1<<17];
double solve(int now, int bit) {
if(bit == (1<<N) - 1) {
i... | ALGO | 0.999491 | 3.546356 | {
"github_metadata": {
"branch": "master",
"commit_count": 482,
"repo_created_at": "2018-02-12T10:29:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73c25e68... |
f405f32c-1294-4569-8bab-1d1756488f1a | EdoardoBaraldi/LSN_Edoardo_Baraldi | Exercise_8/exe8.cpp | #include "exe8.h"
//functions
double phi_T (const double x, const double mu, const double sigma);
double T_unifrom(const double &pos_1, const double &pos_2, const double width);
double Boltzamann(const double old_en, const double new_en, const double temp);
double V(const double x);
double K(const double x, const doub... | ALGO | 0.999905 | 3.531803 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-28T19:02: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": "1cf4918a02e6... |
277b3eb4-029c-4f96-b5e8-dfcf086ceb2d | uso529133/quickSort | quickSort.cpp | #include <iostream>
#include <vector>
using namespace std;
template <typename T>
void quickSort(vector<T> &A, int begin, int end) {
if (begin >= end) return;
vector<T> B, C;
if (end - begin > 3) {
if (A[begin] < A[end] && A[begin] < A[begin + 1]) {
if (A[begin + 1] < A[end]) swap(A[begin], A[begin + 1... | ALGO | 0.99991 | 4.983019 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-09-02T01:44: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": "b412feb49b... |
ca29f027-69a1-44d4-afdb-b40da3f65471 | vishalkumardecentvro/coding-question-solution | ArraQuestions/UnionOfTwoArrays.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
int n, p;
cin >> n >> p;
int arr[n], brr[p];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 0; i < p; i++)
{
cin >> brr[i];
}
int a, b;
a = arr[0];
b = brr[p - 1];
in... | ALGO | 0.999963 | 3.000875 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-09-16T13:15: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": "42c26b6e61... |
7dcfe36a-7432-4d57-b744-0e1c4b3239cc | rijuyuezhu/XCPC-code | OI-time_Problems/数学/数论/同余/exBSGS/code.cpp | #include<algorithm>
#include<cstdio>
#include<map>
using namespace std;
typedef long long ll;
char In[1000000], *ptrs = In, *ptrt = In;
#define getchar() (ptrs == ptrt && (ptrt = (ptrs = In) + fread(In, 1, 1000000, stdin), ptrs == ptrt) ? EOF : *ptrs++)
ll read() {
ll x = 0, f = 1; char ch = getchar();
for(; ch < '0'... | ALGO | 0.999989 | 3.754058 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2023-03-05T03:20: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": "67f56563a... |
9e1b996e-d96c-4a31-8a5a-3548fcafb7ef | ishandutta2007/codeforces-s | shnirelman/normal/1684/B.cpp | #include <bits/stdc++.h>
#define f first
#define s second
//#define int li
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9 + 13;
const li INF64 = 1e18 + 13;
const int M = 1e9 + 7;
//const int M = 998244353;
const int N = 100 + 13;
const int LOGN = 30... | ALGO | 0.999844 | 4.888503 | {
"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": "077b72807b9e... |
41bed92c-fefe-491a-afd5-4f4eb81717b9 | himanshugoswamiii/Programming | SEM_2/Test/dll_array.cpp | #include <iostream>
using namespace std;
class Node{
// Class Node: Each element of the Array is a Node
public:
int data; // Data in the Array
Node* next; // pointer to next element of the Array
Node* prev; // Pointer to the previous element of the Array
Node(int val){
// Constructor f... | ALGO | 0.997934 | 4.645291 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-07-04T20:50: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": "2551bbfb03d... |
c2c0678e-86a1-45a5-89b2-94c46d9ef772 | JoseEnriquez88/introduccion | 16_Arboles/4.1.recorrido_de_un_arbol_en_preOrden.cpp | // Recorrido de un arbol en pre orden
#include <iostream>
#include <stdlib.h>
using namespace std;
struct Nodo
{
int dato;
Nodo *derecha;
Nodo *izquierda;
};
void menu();
Nodo *crearNodo(int);
void insertarNodo(Nodo *&, int);
void mostrarArbol(Nodo *, int);
bool busqueda(Nodo *, int);
void preOrden(Nodo *);
... | ALGO | 0.999974 | 4.968416 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2024-06-28T23:36: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": "417131c7d0... |
6b466ac2-8546-465b-9621-e6738c7c7d88 | Johniel/uva | 11286.cpp | #include <iostream>
#include <map>
#include <vector>
#define FOR(i, c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
using namespace std;
typedef unsigned long long int ulli;
const int N = 500, S = 10000, M = 5, ID = 1 << M;
bool used[M];
ulli tmp[M], student[S];
int s, id;
int main(void)
{
while(tru... | ALGO | 0.999544 | 3.76368 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-09-14T19:08:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f5260ac9f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.