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 |
|---|---|---|---|---|---|---|---|
1b9255d9-9ec2-4170-9f89-ad1425101f6a | CLDP/ACM-ICPC | Regional-2014/Asia-Beijing/B.cpp | #include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int rr[10][10];
int c[30];
int main() {
int t;
scanf("%d", &t);
for (int tt = 1; tt <= t; ++tt) {
int n, m, k;
... | ALGO | 0.999894 | 3.067306 | {
"github_metadata": {
"branch": "master",
"commit_count": 486,
"repo_created_at": "2013-09-24T19:04:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914b9b57... |
961f1ca7-78b8-47ec-adc1-387f536cd7a5 | VirusARzk-Git/Codes | CP/DynamicProgramming/LC-2463.cpp | #define ll long long
class Solution
{
vector<int> v, robot;
ll f(int n, int m, vector<vector<ll>> &memo)
{
if (m == 0)
return 0;
if (n == 0)
return 1e18;
if (memo[n][m] != -1)
return memo[n][m];
ll ans = 1e18;
ll pick = f(n - 1, m ... | ALGO | 0.999965 | 5.233171 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2024-08-05T16:24:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b9f1a723... |
239c7603-f6cd-4566-a795-c66d210cc186 | IgorPBorja/competitive-programming | problems/GruPro/NCPC-2023/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define i64 int64_t
#define printmsg(msg, first, last) cout << msg;for(auto it = first; it != last; it++){cout << *it << " ";} cout << endl
#define printchain(msg, c) cout << msg; for(int64_t x: c.chain){cout << x << " ";} cout << endl;
const i64 MAXN = 60;
const i64 MAXV... | ALGO | 0.999962 | 4.237121 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-10-21T17:25:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "273a306f80e... |
0b2a13ec-2a63-4609-b094-19a8af021c19 | mwashief/step | Templates/Algorithm/Dijkstra.cpp | /*
<NAME>
12 June 2021
Templates Algorithm Dijkstra
*/
#ifndef __DEBUG__
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
#endif
#undef __INTERACTIVE__
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define f... | ALGO | 0.999984 | 4.414182 | {
"github_metadata": {
"branch": "master",
"commit_count": 1440,
"repo_created_at": "2020-06-25T20:48: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": "870832a... |
799beb41-48b8-444a-a112-ac4d903bfe40 | aaratha/cpp | particles2.cpp | #include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <cmath>
#include <vector>
const float PI = 3.14159f;
const float g = 9.81f;
const float mass = 1.0f;
const float partRadius = 0.04f;
const float partCreationInterval = 0.0f;
const float damping = 0.0f; // Adjusted damping factor
float lastPart... | ALGO | 0.951613 | 6.101103 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-05-13T15:26: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": "71d2d59024... |
11cca261-8d19-466b-93e0-3ee3577c4e52 | modulo-/SDP-2016-Team-F | arduino/debug/rotaryEncoderTest/rotaryEncoderTest.ino | /*
Group 14 Arduino Code
*/
#include <Wire.h>
#include <avr/wdt.h>
#include "SDPArduino.h"
#define ROTARY_SLAVE_ADDRESS 5
#define ROTARY_COUNT 6
#define PRINT_DELAY 200
// Initial motor position is 0.
int positions[ROTARY_COUNT] = {0};
void updateMotorPositions() {
// Request motor position deltas from rotary... | ALGO | 0.93731 | 6.139426 | {
"github_metadata": {
"branch": "master",
"commit_count": 960,
"repo_created_at": "2016-01-13T13:05:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdfb72eb... |
4c63bb00-fcad-4b53-8935-e5a38d52c0cd | A1exMinatoooo/OJ_Submissions | NENUOJ/nenuoj_406.cpp | /**
* 划分等级
* Time Limit: 1000/1000MS (C++/Others) Memory Limit: 65536/65536KB (C++/Others)
*
* From Original NENU-OJ 1090, written on Mar 20, 2018
*
* Result: Accepted
* Time: 4ms
* Memory: 576KB
*/
#include <bits/stdc++.h>
using namespace std;
int gpa(int s, int c, int d)
{
if (s < 60)
return 0;
else... | ALGO | 0.999554 | 3.625815 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-12-28T14:25: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": "b8788b4da... |
ae37d236-ad1c-4393-b069-0832f974b791 | rainhope-c/Data-struction | data_structure/tree/mooc/least_leaf_length.cpp | // 假设二叉树中每个结点值为单个字符,采用二叉链存储结构存储。设计一个算法求二叉树bt的最小枝长。所谓最小枝长是指的是根结点到最近叶子结点的路径长度。
//二叉树的基本算法
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
struct BTNode //二叉链结点类
{
char data; //数据元素
BTNode* lchild; //左孩子结点
BTNode* rchild; //右孩子结点
BTNode():lchild(NULL), rchild(NULL... | ALGO | 0.999952 | 4.011919 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-04-30T01:26: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": "a197050a4f6... |
bc7962e2-c4f1-46ab-b3c3-3be1e87f2f54 | skyran1278/leetcode | Cracking the Coding Interview/3 Stacks and Queues/3.2 Stack Min/minStack.cpp | #include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
/**
* @brief 3 m 32 s
* O(1)
*/
class MinStack {
public:
MinStack() {}
void push(int val) {
if (minStack_.empty() || val <= minStack_.top()) {
minStack_.push(val);... | ALGO | 0.99978 | 6.342156 | {
"github_metadata": {
"branch": "main",
"commit_count": 396,
"repo_created_at": "2018-12-26T07:21: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": "5190d4e4c1... |
d0933f03-a1a7-44b7-a594-1cab2cd3cdfe | haidarqwm/algorithm-and-programming | session 10/prob-C popai.cpp | #include <stdio.h>
int main() {
int K;
scanf("%d", &K); // Membaca jumlah testcase
for (int i = 1; i <= K; i++) {
int N, F;
scanf("%d", &N); // Membaca jumlah pemain
int MMR[N];
for (int j = 0; j < N; j++) {
scanf("%d", &MMR[j]); // Membaca MMR pemain
}
... | ALGO | 0.999564 | 4.161802 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-02-28T15:09:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e69f939487f... |
4ee875ea-cb40-48e6-a4c0-18ba243cf740 | itsVaibhavSharma/DSA-cpp | Graphs/BFSandDFS.cpp | #include <iostream>
using namespace std;
struct graph
{
int V;
bool dir;
bool weighted;
int **adj;
char *data;
} *G = NULL;
graph *adjMat()
{
graph *gf = new graph;
cout << "Enter no. of vertices: ";
cin >> gf->V;
cout << "Is graph directed? (1/0) ";
cin >> gf->dir;
cout <<... | ALGO | 0.999362 | 5.027471 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-02-03T15:47:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbd62c95b77... |
34764fea-976a-46e4-a736-04fb821db77e | mehedynoman11/Cpractises-mainpaf | Prefix sum and Binary search/duplicate_linkedlist.cpp | #include <iostream>
using namespace std;
class Node{
public:
int val;
Node* next;
Node (int val) {
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, int val){
Node *newNode = new Node(val);
if (head == NULL) {
head = new... | ALGO | 0.999833 | 4.368111 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-31T16: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": "49d7971a635... |
0a62551d-84ab-4e6e-88e7-ef547a81d4d3 | obiniemur/DSA-Program | 2. Algorithm/Module 17.5 Knapsack practice/u-knapsack.cpp | // Problem Link: https://codeforces.com/group/MWSDmqGsZm/contest/223339/problem/U
#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000;
const int maxW = 1000;
int dp[maxN][maxW];
int knapsack(int n, vector<int> weight, vector<int> value, int w)
{
if (n - 1 < 0 || w == 0)
{
return 0;
... | ALGO | 0.999998 | 4.499874 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-12-14T20:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92ff273000f5... |
971845f8-8562-425c-b45a-009bb0ad71cd | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/pratice/ThreeSumClosest.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
// [Source]: https://leetcode.com/problems/3sum-closest/
// http://www.1point3acres.com/bbs/thread-224520-1-1.html
class SolutionTwoPointer {
public:
int threeSumClosest(vector<int> &nums, int target) {
int size = nums.size();
... | ALGO | 0.999904 | 6.019484 | {
"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": "5487d77d... |
16cc9d52-e049-4b29-b311-96974c4aee3d | TomaSajt/prog-solutions | codeforces/problemset/126B - Password.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
vector<int> z(n);
int l = 0, r = 0;
for (int i = 1; i < n; i++) {
if (i + z[i - l] < r) z[i] = z[i - l];
else {
int c = max(0, r - i);
while (i + c < n && s[c] == s[i + c]) c++;
r = i... | ALGO | 0.999884 | 3.821982 | {
"github_metadata": {
"branch": "master",
"commit_count": 632,
"repo_created_at": "2021-12-02T21:14:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eef899c2... |
5e68656b-416c-4f76-8af9-b6af234b8001 | okugatafahmi/Tucil-URO | tucil.cpp | #include<iostream>
#include<vector>
#include<string>
#include<fstream>
#include<utility>
#include<cmath>
#include<queue>
typedef std::vector<std::vector<std::pair<int,int> > > pPath;
struct koor{
int x,y; //baris x, kolom y
int prior;
int f(koor b){
return pow(x-b.x,2)+pow(y-b.y,2);
}
};
int ... | ALGO | 0.999213 | 4.130466 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-03-28T13:56:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a2fcb4d0... |
c4c345d0-3d13-447a-b8a3-2aab5985b6cd | exafmm/old_fmm_vortex | fmmtra/fgtgp2pmd.cxx | #include "../misc/constants.h"
extern "C" {
#include "mdgrape3.h"
}
extern float *xi,*yi,*zi,*xj,*yj,*zj,*sj;
extern int **ndj,**ndi,*nej,*nij,**neij;
extern float *gxd,*gyd;
extern double *bxmd,(*pos)[3];
extern int *ibase,*isize,*jbase,*jsize,**istamd,**iendmd,*jstamd,*jendmd,*nicall;
void fgtp2p(int lbi, int lbj) ... | ALGO | 0.999461 | 3.868716 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-21T12:01:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "195b2571bc3... |
c9d4d6df-18c7-4e14-aa27-29dcb300af8d | ReNginx/acm | HDU/3094/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef double ld;
typedef pair <int, int> pii;
const int maxn = 2e5+50, maxm = 1e5+50;
const int inf = 0x3f3f3f3f, mod = (int)1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
typedef int arrn[maxn];
typedef ll arrm[ma... | ALGO | 0.999863 | 4.180477 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-04-24T14:09:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ab42492f... |
cceb87c1-9b4c-4c13-8611-e9b1a29c0b22 | zap150/besthea | src/uniform_spacetime_be_evaluator.cpp | /*
Copyright (c) 2020, VSB - Technical University of Ostrava and Graz University of
Technology
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 copyr... | ALGO | 0.998737 | 6.799975 | {
"github_metadata": {
"branch": "master",
"commit_count": 1170,
"repo_created_at": "2020-11-06T09:48:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e4a457... |
a23f2177-4bb4-4dd0-8108-8c9777a44ad8 | agrim123/algo-ds | Data Structures/Graph/Spanning Tree/Prim’s Algorithm/prim.cpp | #include<bits/stdc++.h>
using namespace std;
#define for0(j) for(int i = 0; i < j; i++)
#define pb push_back
#define mk make_pair
const int MAX = 1e4+5;
typedef pair<long long, int> PI;
bool marked[MAX];
vector<PI> adj[MAX];
long long prim(int x) {
priority_queue<PI, vector<PI>, greater<PI> > Q;
int y;
... | ALGO | 0.999977 | 4.071458 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2017-07-14T20:45:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a995d82... |
afbdd68f-58a0-4225-911c-2c47240fb516 | satyamy846/dsa-love-babbar-unacademy | string/permutation_in_string.cpp | #include<iostream>
using namespace std;
int main(){
class Solution {
private:
int checkequal(int a[26],int b[26]){
for(int i=0;i<26;i++)
{
if(a[i]!=b[i])
{
return 0;
}
}
return 1;
}
public:
bool checkInclusion(string ... | ALGO | 0.999979 | 5.022799 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-11T06:04: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": "3bc2a13250dc... |
e9c966e2-338f-4977-ba83-4545b34c1479 | sheeraard/ALPRO-4212 | pertemuan 8/pertemuan 8_2/main.cpp | #include <iostream>
#include <vector>
using namespace std;
//BubbleSort
void bubbleSort(vector<int>& arr){
int n = arr.size();
bool swapped;
for(int i=0;i < n - 1; i++){
swapped = false;
for(int j = 0;j < n - i - 1;j++){
if(arr[j] < arr[j + 1]){
swap(arr[j], arr[j+1]);
... | ALGO | 0.999927 | 5.269845 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-17T22:37: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": "1211d3d936c2... |
0b262be9-87f8-49fd-9af0-c039cf6f8f4a | sangwoo0727/Algorithm | DFS_BFS/BOJ2573_빙산.cpp | #include <iostream>
#include <queue>
#include <utility>
#include <cstring>
#define endl '\n';
using namespace std;
queue <pair <int, int>> q;
int board[301][301];
int tmp[301][301];
int dr[4] = { 0,0,-1,1 };
int dc[4] = { -1,1,0,0 };
bool check[301][301];
int N, M;
void melt() {
while (!q.empty()) {
int n = q.fron... | ALGO | 0.999974 | 4.11324 | {
"github_metadata": {
"branch": "master",
"commit_count": 1100,
"repo_created_at": "2019-01-02T16:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63ef5d7... |
fdd81dce-4512-45ba-b687-d21cf7d128cb | arvind-crate-7/Compatative-Coding | LeetCode/28 F Remove Duplicates from Sorted List II.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* deleteDupli... | ALGO | 0.999836 | 5.587446 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2023-07-26T05:29: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": "3b9fe243ad... |
695c2fa6-2712-47ab-94a8-d7eb63b39de4 | Herong1212/C-_learning | use_Func_muban/demo03.cpp | #include <iostream>
using namespace std;
// 交换的函数模板
template <typename T>
void mySwap(T &a, T &b)
{
T temp = a;
a = b;
b = temp;
}
template <class T> // 也可以替换成 typename
// 利用选择排序,进行对数组从大到小的排序
void mySort(T arr[], int len)
{
for (int i = 0; i < len; i++)
{
int max = i; // 最大数的下标
for... | ALGO | 0.999684 | 4.640018 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-23T13:53: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": "f7c0d4ebad... |
9d725cd8-72a7-43e0-b48d-1af9f5536a33 | Nek5000/nekRS | 3rd_party/AMGX/core/include/solvers/cf_jacobi_solver.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.999793 | 6.788831 | {
"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": "cbb01... |
c2e2838c-06d3-4dae-913b-9c224cd32877 | gods-mack/Competitive-Coding | GeeksforGeeks/max_byLCM.cpp |
/*
URL : https://www.geeksforgeeks.org/minimum-operations-required-to-make-every-element-greater-than-or-equal-to-k/
Minimum operations required to make every element greater than or equal to K
Given an array of length N. The task is to convert it into a sequence
in which all elements are greater than or equal to K.... | ALGO | 0.999908 | 4.141797 | {
"github_metadata": {
"branch": "master",
"commit_count": 315,
"repo_created_at": "2018-02-09T16:51:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "eb80457d... |
d910545b-6acc-4d03-a6be-94fe42438deb | MuhammadFarhanBinAhmad/DIGI-REPO | Practice/HLP3 Practice/Lecture 17 [Function Objects cont.]-20211113/std-function/function.cpp | // CSD2125: 11/09
// Code to illustrate automatic type deduction that allows a function template
// to accept a callable (lambda, function object, function pointer) while a
// non-template function will take a function pointer or a function object
// but not a lambda
#include <iostream>
#include <vector>
#include <algo... | TOOL | 0.929031 | 6.296073 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2023-01-30T14:43: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": "54d7a77328... |
e3959a56-24a9-4030-a834-731c5f71dc64 | jingshaojing/Cppstudy | Codes/Treenode/balanced_binary_tree/balanced_binary_tree/balanced_binary_tree.cpp | // 平衡二叉树 左右子树的高度差小于1
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
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... | ALGO | 0.999992 | 4.411406 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2021-03-16T13: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": "71e75a62c... |
ab6cbc7b-c0dd-4285-b89a-7982d9500413 | joowook/algorithm | algorithm/algorithm/10814.cpp | //#include <iostream>
//#include <algorithm>
//#include <vector>
//#include <string>
//using namespace std;
//
//struct Person {
// int age;
// string name;
// int join;
//};
//
//bool cmp(const Person &u, const Person &v) {
// if (u.age == v.age) {
// return u.join < v.join;
// }
// else {
// ... | ALGO | 0.998627 | 4.412648 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2017-10-28T13:27: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": "17cbfa777... |
e4140b65-b3a2-4a5f-89bd-a2583777cba2 | JohnWStockwellJr/OpenSeaSeis | src/cs/geolib/csSort.cc | /* Copyright (c) Colorado School of Mines, 2013.*/
/* All rights reserved. */
#include "csSort.h"
using namespace cseis_geolib;
osSort::csSort() {
myNumAllocatedNodes = 0;
myTreeNodes = NULL;
}
//--------------------------------------------------------------------------------
osSort::~csSo... | ALGO | 0.999627 | 5.463928 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2016-03-01T18:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 20,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "568a348... |
17d31bfd-4bec-4d61-b73b-340015f160f1 | francisconassif/MAC0214---Extracurricular-Activities-2024.2- | Seletiva USP/I.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define pb push_back
#define eb emplace_back
#define dbg(x) cout << #x << " = " << x << '\n'
#define FOR(i, a, n) for(int i = a; i < n; i++)
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll ... | ALGO | 0.999941 | 3.654922 | {
"github_metadata": {
"branch": "main",
"commit_count": 190,
"repo_created_at": "2024-08-27T17:39: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": "8e094866f0... |
4bb76ec9-d2d6-43d5-9ebc-81807bcf3e98 | KanRenshaw45GALH/Prueba | code j.cpp | #include <iostream>
#include <fstream>
using namespace std;
string nombre (string Jugador)
{
string j1;
cout << "Inserte su nombre Jugador" << "\n";
cin >> Jugador;
j1= Jugador;
cout << "Bienvenido " << j1 << endl;
return Jugador;
}
int turnos(int t)
{
int i;
i=t/2;
t=t-i;
return... | TOOL | 0.960798 | 3.470514 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-09T02:51:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a821d3d89efa... |
091439c1-80e0-4a9e-95e6-b9c9ac8a1cee | macf2/project4 | sorting-algorithms/heapSort.h | #ifndef SORTING_HEAPSORT_H
#define SORTING_HEAPSORT_H
#include "printVec.h"
#include <vector>
using std::vector;
// Helper function for heapSort
inline int leftChild(const int &i) { return 2 * i + 1; }
// Helper function for heapSort
// i is the index of the value being percolated down
// n is the number of items in... | ALGO | 0.999762 | 5.605424 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-04T14:48:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d3adc361f8... |
cc4a37ed-f647-461e-a580-a8fab1916c8f | michael-lehn/FLENS | flens/lapack/impl/ungtr.tcc | /*
* Copyright (c) 2014, <NAME>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1) Redistributions of source code must retain the above copyright
* notice, this ... | ALGO | 0.998755 | 6.998183 | {
"github_metadata": {
"branch": "public",
"commit_count": 475,
"repo_created_at": "2011-12-14T18:21:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 127,
"forks": 32,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1606... |
116e1aa0-d89f-4d3d-b197-6c8396e707d4 | Borschik1/YATP_06.05 | 913.cpp | #include <vector>
#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main() {
ifstream fin("D:/Desktop/INPUT.txt");
ofstream fout("D:/Desktop/OUTPUT.txt");
int n, m, d, l, h, now_v, answer;
float now_time, min_time... | ALGO | 0.999879 | 3.335872 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-05-06T13:10: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": "6ae2dc9ed31... |
06f40581-6780-440a-9d8a-bc0ae9a0c466 | ishandutta2007/codeforces-t | tanphatls987/normal/660/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define INPUT freopen("draft.inp","r",stdin)
#define OUTPUT freopen("draft.out","w",stdout)
#define FOR(i,l,r) for(auto i=(l);i<=(r);i++)
#define REP(i,l,r) for(auto i=(l);i<(r);i++)
#define FORD(i,l,r) for(auto i=(l);i>=(r);i--)
#define R... | ALGO | 0.999424 | 3.100103 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a00ffddf7d60... |
8863c783-08d8-4b8a-8f24-a7352746bdc6 | AldebaranL/ParallelProgrammingHomework | ANN/ARM/ANN_openMP.cpp | #include "ANN_openMP.h"
ANN_openMP::ANN_openMP ( int* _num_each_layer, int _num_epoch, int _batch_size, int _num_layers, float _study_rate)
{
num_layers = _num_layers;
study_rate = _study_rate;
num_each_layer = new int[_num_layers + 2];
num_each_layer[0] = _num_each_layer[0];
for (int i = 1; i <= n... | DATA | 0.977082 | 3.438291 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-03-10T13:30: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": "28a36a66737... |
eb8e81c2-b5f3-427e-8aa8-1b3c49a3f413 | Sheena997/LeetCode-Practice | minTimeToVisitAllPoints.cpp | /*
两点之间的距离
平面上有 n 个点,点的位置用整数坐标表示 points[i] = [xi, yi]。请你计算访问所有这些点需要的最小时间(以秒为单位)。
你可以按照下面的规则在平面上移动:
每一秒沿水平或者竖直方向移动一个单位长度,或者跨过对角线(可以看作在一秒内向水平和竖直方向各移动一个单位长度)。
必须按照数组中出现的顺序来访问这些点。
示例 1:
输入:points = [[1,1],[3,4],[-1,0]]
输出:7
解释:一条最佳的访问路径是: [1,1] -> [2,2] -> [3,3] -> [3,4] -> [2,3] -> [1,2] -> [0,1] -> [-1,0]
从 [1,1] 到 [3... | ALGO | 0.999949 | 5.781561 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-08-02T09:22: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": "617a51c6... |
c6a2a9a3-9831-4d60-8465-7e2cc27003ef | bizkut/warz-client | External/NaturalMotion/common/XMD/include/XM2/inl/sse2/Vector3.inl | #ifdef _MSC_VER
# pragma once
#endif
#ifndef XM2_SSE2_VECTOR3__INL__
#define XM2_SSE2_VECTOR3__INL__
#if (XM2_USE_FLOAT)
# error SSE2 double precision routines included when set to build using floats
#endif
#ifndef XM2_USE_SSE
# error SSE2 routines included when set to build with FPU
#endif
namespace XM2
{
//----------... | TOOL | 0.94995 | 6.431889 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-12-20T14:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 17,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1155a548... |
468786ff-d554-4608-af69-9fe95570f241 | mizti/onlinejudge | tc/SRM425D2L2CrazyBot/a.cpp | #include <vector>
#include <map>
#include <string>
#include <iostream>
#include <stdio.h>
#include <limits.h>
#include <iostream>
using namespace std;
class CrazyBot {
public:
double p_east;
double p_west;
double p_south;
double p_north;
double getProbability(int n, int east, int west, int south, int north){
do... | ALGO | 0.999847 | 4.224383 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2012-11-16T16:08: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": "304d8e8a3... |
ead00a68-a27b-43c5-a9af-c0bd1832e119 | jorgecszabo/algo1 | auxiliares.cpp | #include <algorithm>
#include "auxiliares.h"
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
const double pi = 3.14;
double radioTierra = 6378;
double obtenerLatitud(gps posicion) {
return get<0>(posicion);
}
double obtenerLongitud(gps posicion) {
return get<1>(posicion);
}
c... | DATA | 0.912211 | 4.179824 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-05-28T17:49: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": "251fcbc64e0... |
bc8386d1-7d6e-4146-8011-6fcba6ccf2b4 | hoytech/negentropy | cpp/negentropy/storage/btree/core.h | #pragma once
#include <algorithm>
#include "negentropy.h"
namespace negentropy { namespace storage { namespace btree {
using err = std::runtime_error;
/*
Each node contains an array of keys. For leaf nodes, the keys are 0. For non-leaf nodes, these will
be the nodeIds of the children leaves. The items in the ke... | ALGO | 0.994202 | 4.989429 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2023-03-10T17:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 84,
"forks": 13,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "9be419... |
f43504b6-e4f5-483c-bebd-6257c80fd860 | kjungw1025/SamsungElectronic-DX-Summer-Algorithm | Graph/No16.cpp | #include <iostream>
#include <cstring>
#include <queue>
#define MAX 305
using namespace std;
int N, cnt;
int dy[8] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
char board[MAX][MAX];
bool checkNoMine (int i, int j)
{
for (int way = 0; way < 8; way++)
{
int ii = i + dy[way];
int jj = j ... | ALGO | 0.999906 | 4.148065 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-08-13T13:04: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": "5af3a7e0875... |
e18f34d9-34ae-4572-ab8c-1c653c167f45 | BoostGSoC14/boost.ublas | bench/SYRK/kernels/mtl/DmatDmatAdd.cpp | /*
dense matrix and dense matrix addition kernel
*/
namespace mtl {
double dmatdmatadd(size_t N, size_t iterations = 1) {
mtl::dense2D<value_type> a(N, N), b(N, N), c(N, N);
minit(N, a);
minit(N, b);
std::vector<double> times;
for(size_t i = 0; i < iterations; ++i){
... | ALGO | 0.991642 | 5.418445 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2014-05-08T06:53:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a457d2e7ec... |
d358cac9-b7dd-43c1-98ce-3473990266a9 | Zisrf/Algorithms-and-data-structures | 1sem/4lab/f.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
#define INF 2e9 + 11
bool isGood(double A, double A1, vector<double> &h)
{
int n = h.size();
h[0] = A;
h[1] = A1;
for (int i = 2; i < n; ++i)
h[i] = 2 * h[i - 1] + 2 - h[i - 2];
for (int i = 0; i < n; ++i)
... | ALGO | 0.999522 | 3.29611 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2021-10-29T18:19:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc9a2de08... |
697747f9-6c76-4409-a32e-e0f9ea904730 | godotengine/godot | thirdparty/embree/kernels/builders/heuristic_openmerge_array.h | // Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
// TODO:
// - adjust parallel build thresholds
// - openNodesBasedOnExtend should consider max extended size
#pragma once
#include "heuristic_binning.h"
#include "heuristic_spatial.h"
/* stop opening of all bref.geomIDs a... | ALGO | 0.980605 | 4.545466 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
fff84fbb-bfcc-40c2-b26c-9bcac1358b1c | fvizpal/dsA | G9_shortestPathInUndirectedGraph.cpp | /* 0> Shortest path in Undirected graph
we will be given a src and destination
and we need to give shortest path between them
(if all paths have same weight 1)
BFS krte hua when we traverse ahead in a graph we are following the shortest ; that is the intuition for BFS
approach
. ham BFS ka prayog krenge
... | ALGO | 0.999992 | 5.995444 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2023-08-01T07:30: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": "21d440190... |
2173de94-d1ea-49ff-a153-7bd2ce9045d4 | githubgjb/c-20171012067-3 | Practice/201906040329/SortTestHelper/SortTestHelper/quickSort14.h |
#include <algorithm>
#include "insertionSort03.h"
using namespace std;
/*
双路快排
*/
//对arr[l...r]部分进行partition操作
//返回,使得[l...p-1] < arr[p]
//arr[p+1...r] > arr[p]
//arr[l+1...i) <= v; arr(j...r] >=v
template <typename T>
int __partition14(T arr[], int l, int r){
swap(arr[l], arr[rand() % (r - l + 1) + l]);
//<=... | ALGO | 0.999964 | 5.50146 | {
"github_metadata": {
"branch": "master",
"commit_count": 431,
"repo_created_at": "2017-10-12T07:15: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": "8be9a7a9... |
603588b5-f560-455b-b3e4-9eea70225402 | xinlinrong/bigcpp3_my_solution | Chapter3/P3_14/main.cpp | #include <iostream>
using namespace std;
int main(int argc, char **argv) {
int input_year{0};
cout << "please input year to judge:";
cin >> input_year;
if (cin.fail()) {
cout << "input value is invalid" <<endl;
return -1;
}
if (input_year < 1582) {
cout << "input year is... | ALGO | 0.999673 | 3.615763 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-04-28T01:28: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": "f39f6de89... |
564e5dd9-43e7-4f8a-946e-29cae2fb727a | prost-planner/prost | src/rddl_parser/states.cc | #include "states.h"
#include "evaluatables.h"
#include "rddl.h"
#include "utils/math.h"
#include <sstream>
using namespace std;
namespace prost::parser {
State::State(vector<ConditionalProbabilityFunction*> const& cpfs) {
for (ConditionalProbabilityFunction const* cpf : cpfs) {
state.push_back(cpf->get... | ALGO | 0.913137 | 6.659997 | {
"github_metadata": {
"branch": "master",
"commit_count": 631,
"repo_created_at": "2019-10-18T09:02:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 45,
"forks": 17,
"issues": 64,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c722a... |
cb456015-7c86-4041-81c2-eaec269ba889 | dwirx/Kelas-Terbuka | Tutorial C++/15_latihan1_Calculator/1calculator.cpp | #include <iostream>
using namespace std;
int main()
{
float a,b,hasil;
char aritmatika;
cout << "Selamat datanng di program calculator\n \n";
// memasukan input dari user
cout << "Masukan nilai pertama: ";
cin >> a;
cout << "Pilihan operator +,-,/,*: ";
cin >> aritmatika;
cout << "Masukan nilai kedua: ";
... | TOOL | 0.945415 | 3.150648 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-12-03T15:51: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": "745576330daf... |
64cf54cd-14e0-4b6e-9e65-f5a780c2076e | mcorley/ndiff | src/DiffAlgorithm.cpp | //===--- DiffAlgorithm.cpp - ----------------------------------*- C++ -*-===//
//
// The NDiff File Comparison Utility
//
//===--------------------------------------------------------------------===//
//
// This file implements the DiffAlgorithm interface.
//
//===-----------------------------------... | TOOL | 0.988673 | 6.947735 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2012-05-11T19:12: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": "3115f24aad... |
b2a92b2d-534e-444b-a4e9-736a29de703f | Soumyabethi123/Daily_Coding | Graph/Transitive closure of a Graph.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Back-end complete function Template for C++
class Solution{
public:
void dfs(int i,int j,vector<vector<int>> &graph,vector<int> adj[]){
graph[i][j]=1;
for(a... | ALGO | 0.999979 | 6.089177 | {
"github_metadata": {
"branch": "master",
"commit_count": 255,
"repo_created_at": "2022-12-18T11:07: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": "6153ba94... |
2d30a1cd-9d7e-4a79-be5d-21ec3a9eabbb | swapfloor/algo-with-him | cpp/abc299d.cpp | // https://atcoder.jp/contests/abc299/tasks/abc299_d
#include <bits/stdc++.h>
using namespace std;
int ask(int p) {
cout << "? " << p << endl;
char c;
cin >> c;
return c - '0';
}
void answer(int p) {
cout << "! " << p << endl;
exit(0);
}
int ans = -1;
int f[200000 + 12];
bool tour(int l, int r) {
if (ans !=... | ALGO | 0.999952 | 3.262514 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-04-18T13:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73fac230ae... |
494bf044-21e5-42f0-b3d2-bb92b5b0c5cd | osanseviero/C-training | Interview Questions/24.countSay.cpp | #include <iostream>
#include <string>
using namespace std;
/* This is the count and say sequence
1 one
11 one one
21 two ones (check the previous)
1211 one two and one one
111221 one one, one two, two ones
312211 three ones, two twos, one one
Write a function that returns the n row of this sequence
*/
string... | ALGO | 0.999839 | 4.958292 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2015-08-30T22:50: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": "8629bd791... |
c4bd23d6-4d91-4020-b303-c08f212b9754 | ujjaldas1997/Competitive-programming | merge_k_sorted_array.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 3
vector<int> merge(vector<int> a, vector<int> b){
int n = a.size(), m = b.size();
int i = 0, j = 0;
vector<int> res;
while(i < n and j < m){
if(a[i] <= b[j])
res.push_back(a[i++]);
else
res.push_back(b[j++]);... | ALGO | 0.999983 | 4.35686 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2017-07-29T08:10: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": "1e1c77dcf... |
d754d1da-b1a1-4c12-bc04-47a92c9ccced | parthlathiya12/Codechef-Submissions | 18_03_MARCH18/MINVOTE.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define re(i,b) for(ll i=0;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define pll std::pair<ll, ll>
#define ppll std::pair<pll, ll>
#defi... | ALGO | 0.999825 | 3.346615 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-03-24T17:55: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": "992fb3ba7... |
a1ed5578-a073-4fee-b4c4-665161c5d95c | zedann/Math | Introduction To Math For CP/Geometric progression/main.cpp | #include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define dpp(arr,val) memset(arr,val,sizeof(arr))
#define ll long long
#define ull unsigned long long
#define dd double
#define ld long double
#define PQ priority_queue
#define pii pair<int,int>
#define pll pair<ll,ll>
#define S second... | ALGO | 0.998562 | 3.266843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-11-10T09:31: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": "e6a3c119422c... |
a9b91196-473a-4953-9ef8-af05fd647c44 | Aakashdeep954/DS-ALGO | coding ninjas/data_structures/recursion_1b/replace_pie_recursively.cpp | #include <bits/stdc++.h>
using namespace std;
#define fo(i, c) for (int(i) = 0; (i) < (c); (i)++)
#define go(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define gc getchar_unlocked
#define ll long long int
#define pb push_back... | ALGO | 0.994063 | 3.617663 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2021-01-24T23:13: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": "f76f8b6971... |
a2ef1390-9ae6-494c-bc55-c6f4126c8aee | SamuelXing/Algorithm | cpp_solutions/Greedy/Combination_Sum.cpp | /*
Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
Note:
All numbers (including target) will be positive integers.
The solution set must... | ALGO | 0.999977 | 6.240715 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2017-06-08T17:56: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": "a0c4f24ef... |
61c0c939-655f-4482-a6ec-5d1386558221 | gapost/MISfit | gentbl/calc_q.cpp | #include "stdafx.h"
#include <fstream>
#define VMAX 2.5
#define NMIN 13
#define NMAX 18
#define NV 151
#define NN 21
void printarray(const char* fname, const char* declstr, const CArray1D& A, char* code = NULL);
void printarray(const char* fname, const char* declstr, const CArray2D& A, char* code = NULL);
#define DX... | ALGO | 0.989972 | 3.12844 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-10-30T00:36:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc9c0f32e525... |
e78df6f1-1d33-4a98-a5d0-04578a63afa2 | zeroli/playground | leetcode/leetcode_450.cc | /*
450. Delete Node in a BST
https://leetcode.com/problems/delete-node-in-a-bst/
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
Basically, the deletion can be divided into two stages:
Search for a node to re... | ALGO | 0.999997 | 6.668765 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2019-08-26T07:46: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": "7595cc81... |
26d4033a-6988-421e-8cf0-72c08bc7506c | liuyubobobo/Play-Leetcode | 2001-2500/2305-Fair-Distribution-of-Cookies/cpp-2305/main.cpp | /// Source : https://leetcode.com/problems/fair-distribution-of-cookies/
/// Author : liuyubobobo
/// Time : 2022-06-11
#include <iostream>
#include <vector>
using namespace std;
/// Memoization
/// Time Complexity: O(k * 3^n)
/// Space Complexity: O(k * 2^n)
class Solution {
public:
int distributeCookies(vec... | ALGO | 0.999963 | 5.212002 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0... |
a7af9cd3-5c54-43e9-9092-63bdcf1c1e31 | 19865044959/code_test | leetcode/leetcode/767. 重构字符串.cpp | #include <vector>
#include <string>
#include <unordered_map>
#include <algorithm>
using namespace std;
/**********************************************************************************************************
方法:分析法
说明:分析所给信息与条件,通过条件逐步编程
时间复杂度与空间复杂度:O(n) O(n)
涉及到的知识点:
******************************************... | ALGO | 0.99999 | 4.685385 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-13T01:40:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "534dba6660dd... |
52a3296b-8f83-4f7c-8b7b-70e3d88386ce | avcopan/MPACK | mlapack/library/Rgelsx.cpp | /*
* Copyright (c) 2008-2010
* <NAME>
* All rights reserved.
*
* $Id: Rgelsx.cpp,v 1.5 2010/08/07 04:48:32 nakatamaho Exp $
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of... | ALGO | 0.999307 | 4.983663 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-12-18T18:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d74b5941... |
e696130e-8456-492c-a046-843769985092 | iMao/computed_tomography_task | matrix.h | #ifndef MATRIX_H
#define MATRIX_H
#include <iostream>
#include <memory>
#include <set>
#include <vector>
#include "lines.h"
namespace math {
/**
* @brief The Matrix struct
*/
struct Matrix {
Matrix() = delete;
Matrix(int rows, int cols);
Matrix(const Matrix& matrix);
Matrix(Matrix&& matrix);
Matrix& ope... | ALGO | 0.985846 | 6.352978 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-04-03T15:15: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": "38308398d69... |
ee0b0427-55b3-4145-80a2-8551970ef7e5 | duane/ctex | libs/Render/Box.cc | /*****************************************************************************
* Copyright (c) 2012 <NAME> *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not ... | TOOL | 0.987818 | 6.233165 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2012-02-07T01:22:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2460c597... |
172d6bc0-a5fb-4306-a1d6-5f3cec5e9717 | OneStig/contests | Codeforces/CodeforcesRound944(Div4)/EFindtheCar/solution.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va... | ALGO | 0.999988 | 3.442397 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-11-01T02:52: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": "a6ddbc81... |
f0545fd5-e253-4a6b-aa04-2ec39cf7798e | othieno/GPBB | codebase/source/chapter.17/L17-4.CPP | /* next_generation(), implemented using fast, all-in-one hard-wired
neighbor count/update/draw function. Otherwise, the same as
Listing 17-3. */
/* Calculates the next generation of current_map and stores it in
next_map. */
void cellmap::next_generation(cellmap& next_map)
{
unsigned int x, y, neighbor_count;... | ALGO | 0.999236 | 5.156045 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-12-24T02:43:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79b048f6... |
2744c45e-9819-4b76-95fc-be5c26be6916 | SIC1740/CTDL-Laptrinhptit | CON6_21.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
void sortByFrequency(std::vector<int>& arr) {
std::unordered_map<int, int> frequency;
for (int num : arr) {
frequency[num]++;
}
// Sắp xếp mảng
std::sort(arr.begin(), arr.end(),
[&frequency](int a,... | ALGO | 0.999982 | 6.385549 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-03-02T08:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe988f2832e... |
6334c3c2-d744-4273-ba3b-a31b41589e1a | baohanddd/bmp2txt | DotMatrixPot.cpp | #include "stdafx.h"
static DOTMATRIXPOT pot;
static DOTMATRIX* dm;
static DOTMATRIXRANGE* ranges;
static DOTMATRIXRANGE range;
static DOTMATRIXPOT start;
DOTMATRIXPOT*
dmpInit(DOTMATRIX* matrix)
{
pot.c = 0; pot.r = 0;
pot.size = size;
pot.range = dmpRange;
dm = matrix;
return &pot;
}
int size(FONTSIZE* size) ... | TOOL | 0.955717 | 4.118443 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-03-16T14:52:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd9d2855e... |
a266a9f8-9bdc-4dad-8779-2538bb04c05d | NikharManchanda/CP-Submissions | codeforces/352/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define lim 100006
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef deque<ll> di;
typedef deque<ii> dii;
long long mod = 1000000007;
const double pi = acos(-1.0);
/*--------------... | ALGO | 0.999985 | 3.210917 | {
"github_metadata": {
"branch": "main",
"commit_count": 639,
"repo_created_at": "2021-07-23T08:52: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": "2e89f13e67... |
69e2e4e5-1112-4ac1-99bb-24bd6b188c6e | danyal2075/CrashCourse_C- | templates/02_template.cpp | #include<iostream>
using namespace std;
template<typename t>
class Vector{
int size;
public:
t *arr;
Vector(int s): size(s)
{
arr = new t[size];
}
// This functuon takes another object as an input, we used reference var becuase in C++ refrence var is used to copy content of the an... | ALGO | 0.997672 | 5.117202 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2024-07-01T13:04: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": "75ac0160e... |
c4283326-9188-495c-a547-4b297a3d5b20 | imvskalhans/DSA-Codes | LeetCode203RemoveLinkedListElement.cpp | /*
leetcode 203 Remove Linked List Element
Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.
*/
#include<iostream>
#include<vector>
using namespace std;
struct ListNode
{
int val;
ListNode* next;
ListNode(int x) :... | ALGO | 0.999786 | 5.54494 | {
"github_metadata": {
"branch": "DSA-Practice",
"commit_count": 990,
"repo_created_at": "2022-11-17T19:00:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d... |
56a5497e-8c1e-48dc-b5a0-ed311f3efd5c | uniqss/leetcodecpp | bk/OtherAlgorithms/Queue.cpp | #include "../inc.h"
template <class T>
class QueueElement {
public:
QueueElement(const T& _data) : data(_data), next(nullptr) {}
T data;
QueueElement* next;
};
template <class T>
class Queue {
QueueElement<T>* front;
int count;
public:
Queue() : front(nullptr), count(0) {}
~Queue() ... | ALGO | 0.994832 | 4.706385 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2020-07-09T12:15: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": "c179449e... |
b9cc5e11-78ae-4100-9610-f6eb0c291932 | ishandutta2007/codeforces-c | chen_zexing/normal/1176/F.cpp | #include <stdio.h>
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <cmath>
#include <assert.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <climits>
#include <set>
#include <unordered_map>
#include <time.h>
#include <map>
#include <stack>
#include <unordered_s... | ALGO | 0.999467 | 3.384232 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "f9627547ea3f... |
4f507d33-9510-42b2-a04b-5636410923a0 | rocky55737/AlgoAfoc | BaekJoon/7576/main.cpp | #include <iostream>
#include <vector>
#include <queue>
int main()
{
int M, N;
std::cin >> M >> N;
std::vector<std::vector<int>> vector_box(N, std::vector<int>(M));
std::queue<std::pair<int, std::pair<int, int>>> queue_riping_tomato;
int unripen_tomato = 0;
for (int i = 0; i < N; i++)
{
for (int j = ... | ALGO | 0.999998 | 4.135738 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-09-26T03:58: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": "79257f83c65... |
63e74f48-9ef0-4938-815c-46dc30ef686b | dlzhou/algorithms | leetcode/genpats/22.generate-parentheses.cpp | /*
* [22] Generate Parentheses
*
* https://leetcode.com/problems/generate-parentheses/description/
*
* algorithms
* Medium (55.28%)
* Total Accepted: 347.6K
* Total Submissions: 628.8K
* Testcase Example: '3'
*
*
* Given n pairs of parentheses, write a function to generate all combinations
* of well-fo... | ALGO | 0.998391 | 6.040555 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-04-15T09:08: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": "f8e8b78a6... |
f1480c2f-9d72-4534-b61a-ac011cdf4196 | rajuramj/AdvPT | testProg.cpp | #include<iostream>
#include "Matrix.h"
using namespace std;
int main()
{
//Matrix m1(4,3,0.5);
Matrix<int> m1(2,2,0);
//m1.displayMatrix();
Matrix<int> m2(2,2,0);
m1(0,0) = 1;
m1(0,1) = 2;
m1(1,0) = 3;
m1(1,1) = 1;
m2(0,0) = 4;
m2(0,1) = 5;
m2(1,0) = 2;
m2(1,1) = 3;
... | ALGO | 0.920382 | 3.397334 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-11-02T13:58: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": "cf8c4c5309... |
13f4870a-6d37-467e-a4d1-86b83597c322 | hby-star/LeetCode | 148.sort-list.cpp | /*
* @lc app=leetcode.cn id=148 lang=cpp
* @lcpr version=30204
*
* [148] 排序链表
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#inc... | ALGO | 0.999996 | 6.347715 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-07-05T15:40:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd7841bd8... |
b9230e7c-f84b-407c-9dee-022c3ecd1234 | TheAlgorithms/C-Plus-Plus | sorting/slow_sort.cpp | // Returns the sorted vector after performing SlowSort
// It is a sorting algorithm that is of humorous nature and not useful.
// It's based on the principle of multiply and surrender, a tongue-in-cheek joke
// of divide and conquer. It was published in 1986 by <NAME> and Jorge
// Stolfi in their paper Pessimal Algorit... | ALGO | 0.99986 | 5.635525 | {
"github_metadata": {
"branch": "master",
"commit_count": 1738,
"repo_created_at": "2016-07-16T10:19:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32391,
"forks": 7439,
"issues": 10,
"pull_requests": 23
},
"file_meta": {
"content_id": ... |
55be0991-372d-4a13-aff5-c3968d9efb87 | ishandutta2007/codeforces-nonalphabetic | _h_/normal/1464/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = (a); i < b; ++i)
#define rrep(i,a,b) for(int i = (b); i --> (a);)
#define trav(x, v) for(auto &x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) (int)(v).size()
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
... | ALGO | 0.999851 | 3.805425 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dfc15c59d26... |
eada6f1b-a9fb-49a8-9007-e2c76d8a93d8 | TheP1ch/Belyakov_AS | lab/GTS.cpp | //
// Created by <NAME> on 26.12.2021.
//
#include "GTS.h"
void GTS::add_link(const int &cs_out, const int &cs_in, const int &pipe_rib) {
pipes[pipe_rib].cs_out = cs_out;
pipes[pipe_rib].cs_in = cs_in;
Used_pipes.insert({pipe_rib, pipes[pipe_rib]});
compressors[cs_out].increase_degree_out();
compr... | ALGO | 0.993309 | 3.708278 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-09-13T11:09:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "f97f753e685... |
6b4486b3-6aaa-472c-8566-2de264ac4e4b | revistain/SCRQuickDebug | UniversalHookX/src/debugger/pattern.cpp | #include "pattern.h"
#include <iostream>
#include <vector>
#include <thread>
#include <windows.h>
#include <mutex>
#include "../console/console.hpp"
// Mutex for safe access to foundAddresses
std::mutex foundMutex;
std::vector<LPCVOID> foundAddresses; // 저장할 메모리 주소
uint32_t getFoundAddr() {
if (foundAddresses.size... | TOOL | 0.924863 | 6.037905 | {
"github_metadata": {
"branch": "gui",
"commit_count": 45,
"repo_created_at": "2024-09-17T06:43: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": "2b0ad9ad9819... |
659ad643-3ba6-4727-b690-1be3a62d86fe | phillip-keldenich/circlecover-triangles | src/rectangle_base_cover.hpp | /*
* Copyright 2022 <NAME>, Algorithms Department, TU Braunschweig
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, ... | ALGO | 0.99759 | 6.8319 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-02-08T08:41: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": "caf8981018b3... |
0098dc32-c961-41bb-aedb-2cbd6968ad9e | generalized-intelligence/GAAS | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/include/fast_gicp/gicp/fast_vgicp_cuda.hpp | #ifndef FAST_GICP_FAST_VGICP_CUDA_HPP
#define FAST_GICP_FAST_VGICP_CUDA_HPP
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/search/kdtree.h>
#include <pcl/registration/registration.h>
#include <fast_gicp/gicp/gicp_settings.hpp>
#include <fast_gi... | ALGO | 0.983634 | 6.913832 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2019-01-29T06:14:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1991,
"forks": 453,
"issues": 7,
"pull_requests": 3
},
"file_meta": {
"content_id": "b7224f... |
67de8142-42c7-425f-9835-7e0255e7aea2 | Kibet-mutai/miscallaneous | src/fast_expo.cpp | #include <iostream>
int power(int a, int p)
{
if (p == 0)
return 1;
int temp = power(a, p / 2);
int res = temp * temp;
if (p % 2 == 1)
res *= a;
return res;
}
// binary exponation
int non_rec_pow(int a, int b)
{
int res = 1;
if (b == 0)
return 1;
while (b > 0) ... | ALGO | 0.999845 | 5.469885 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-12T22:23: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": "554c8b2e2b... |
20755977-3d8b-4741-a624-398f18c8d511 | shy625/dont-stop-the-camera-study | LJI/스터디-C++/main_1577_도로의 개수.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int N, M;
main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> N >> M;
vector<vector<long long>> DP(N + 1, vector<long long>(M + 1, 0));
DP[0][0] = 1;
int K;
cin >> K;
set<pair<pair<int... | ALGO | 0.999719 | 3.768459 | {
"github_metadata": {
"branch": "main",
"commit_count": 1371,
"repo_created_at": "2022-02-08T12:37:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6dc6cf613... |
3afc22ed-a02e-49fd-8186-d4cb9324df1a | artificial-intelligence-department/ai_programming_playground_2024 | ai_11/yurii_verbytskyi/epic_4/vns_lab_4_task_1_variant_7_yurii_verbytskyi.cpp | #include <iostream>
#include <stdio.h>
#include <cstdlib> //random
using namespace std;
int main(){
int size; // = 9;
cin >> size;
//int array[size] = {5, 7, 98, 65, 74, 34, 67, 12, 0};
int array[size];
for(int i = 0; i < size; i++){
array[i] = rand() % 100;
}
for(int i = 0... | ALGO | 0.999493 | 3.182101 | {
"github_metadata": {
"branch": "main",
"commit_count": 2638,
"repo_created_at": "2024-09-22T19:14:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7af4b2e4ba... |
0385ffad-e454-4947-9879-db3745191f25 | bgb10/ps-playground | barkingdog/0x18 그래프/기본 문제/1325 효율적인 해킹/1325-BFS.cpp | /*
컴퓨터를 노드, 신뢰하는 관계를 단방향 간선이라고 추상화해서 풀면 된다.
연결 요소의 개수가 가장 많은 노드들을 찾으면 된다.
풀이에서는 탐색 방법으로 BFS를 사용했다.
시간복잡도는 O(V(V+E+V)) 이다.
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> adjs[10002];
bool vis[10002];
int computer_connected[10002];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
... | ALGO | 0.999996 | 4.535551 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-13T12:12: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": "085cb0991c1d... |
63053927-63ad-42f5-8453-44997bd15bd2 | KatsuyaKikuchi/ProgrammingContest | AtCoder/PAST/001/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
ll A[200005];
int main() {
ll N;
cin >> ... | ALGO | 0.999688 | 3.502474 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-12-04T21:42: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": "4d7f6253e... |
7c3a0da0-181c-4790-a6fe-e0d3db7d46b1 | Hemantgithubpro/leetcode | Codeforces/Contests/2104/2104A.cpp | #include <bits/stdc++.h>
using namespace std;
// 2104A_4 worked, and i did it on my own
bool isValid(vector<int> &a){
return (a[0]==a[1] && a[1]==a[2]);
}
string solve(vector<int> &a){
// while(a[2]>a[0] && a[2]>a[1]){
// // if(a[0]<a[1]){
// // a[0]++;
// // }else{
... | ALGO | 0.999842 | 4.911132 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2025-03-06T19:40: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": "1cd04cd7c8... |
8b61866c-11d3-4180-bcde-a10ff02c006f | Terpodia/Competitive-Programming | Problems Solved/Codeforces/Math/Windblume Ode.cpp | #include <iostream>
using namespace std;
int aux;
bool isPrime(int p) {
for (int i = 2; i * i <= p; i++)
if (p % i == 0) return false;
return true;
}
int main() {
int t;
aux = scanf("%d", &t);
while (t--) {
int n;
aux = scanf("%d", &n);
int a[n];
for (int i = 0; i < n; i++) aux = scanf... | ALGO | 0.999081 | 3.522869 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2021-12-10T22:43:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75cf034a26... |
2d87a9c0-8aa1-41fa-8e9e-7b93f60bc704 | ashhek/Leetcode_solution | 0229-majority-element-ii/0229-majority-element-ii.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int n = nums.size();
int cnt1 = 0, cnt2 = 0;
int el1 = INT_MIN;
int el2 = INT_MIN;
for (int i = 0; i < n; ++i) {
if (cnt1 == 0 && el2 != nums[i])
cnt1 = 1, el1 = nums[i];
... | ALGO | 0.999998 | 5.807972 | {
"github_metadata": {
"branch": "main",
"commit_count": 2699,
"repo_created_at": "2023-07-01T10:39: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": "b4a964fef... |
ac4e624b-4ab2-47a3-aab1-3e50d35f4329 | ikr/algo-practice | atcoder/2021/Just_one/solution.cpp | #include <atcoder/dsu>
#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using mint = atcoder::modint998244353;
template <typename T> constexpr int inof(const T x) {
return static_cast<int>(x);
}
template <typename... | ALGO | 0.999839 | 5.474753 | {
"github_metadata": {
"branch": "master",
"commit_count": 5422,
"repo_created_at": "2016-06-23T07:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "653c876... |
4941a371-4373-4827-a81c-49583910e844 | RMohit927/LeetCode | Week1/Container with most Water.cpp | /*
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water.
Notic... | ALGO | 0.999974 | 6.919704 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-09-08T11: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": "59b1ba380ee... |
90230924-736f-45b2-84f8-e9434e3caff7 | adoumouangnamouemmanuel/100-days-cpp | day-5/0x04-more_functions_nested_loops/10-print_triangle.cpp | #include <iostream>
using namespace std;
void print_triangle(int size); // Function prototype
/**
* main - Tests the print_triangle function with different sizes.
*
* Return: Always 0.
*/
int main(void)
{
print_triangle(2);
print_triangle(10);
print_triangle(1);
print_triangle(0);
return 0;
... | ALGO | 0.948121 | 6.842113 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2025-05-10T18:41: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": "420d0f546... |
9930a4f6-be0d-4ff1-abea-9325a7c39403 | hs-fassih/CodeForce | NextRound.cpp | // Problem Ranking: 800
// There is bug in this program, I would appreciate your contibtion in removing it
#include <iostream>
using namespace std;
int main()
{
int n = 0, k = 0, score = 0, qualifier = 0, zero = 0; // where 'n' is participants & 'k' is the k_th place
cin >> n >> k;
if (k < 1 || k > n || n <... | ALGO | 0.999926 | 3.73983 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-08-10T15:32: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": "125886940dc2... |
60c2d247-ad75-468b-848b-6631f9ec4642 | aakritim15/Comps-BTech--Sem-V | OS/code/PRIORITY.CPP | #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip> // for std::setw
using namespace std;
struct Process {
int id; // Process ID
int burstTime; // Burst time
int priority; // Priority (smaller number = higher priority)
int arrivalTime; // Arrival... | ALGO | 0.999966 | 6.249599 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-07T15:22: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": "e83b16e2b68d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.