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 |
|---|---|---|---|---|---|---|---|
2127195b-8a3a-4224-9863-9124b640eb28 | Ankush-choudhary76/DSA | LinkedList/MEDIUMproblemDLL/Find all Pairs with given Sum in sorted DLL/brute.cpp | #include<bits/stdc++.h>
using namespace std ;
struct Node
{
int data ;
Node* next ;
Node* back;
Node(int data1 ): data(data1) , next(nullptr) , back(nullptr){};
Node(int data1 , Node* next1 , Node* back1): data(data1) , next(next1) , back(back1){};
};
vector<pair<int,int>>findPair(Node* head , int sum){
... | ALGO | 0.999959 | 3.250757 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-07-12T04: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": "1618086f110... |
c12b3121-31fe-4568-8540-83fbafda20a5 | meem-5971/ACM-Advanced-Camp-DIU | Practice/Fahimcp contest/AC implementation/J_Ideal_Sheet.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
typedef vector<vector<int>> Matrix;
Matrix normalize(const vector<string>& sheet, int& h, int& w){
int H=sheet.size();
int W=sheet[0].size();
int minrow=H,maxrow=-1,mincol=W,maxcol=-1;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
... | ALGO | 0.999915 | 4.832262 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-05T01:27: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": "72867f243704... |
8ed8cd8a-5808-4894-8390-fda7be978074 | 101magikarp101/USACO | 882-2/god.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <cstring>
#include <bitset>
#include <string>
#define ll long long
using namespace std;
int T, N, K;
int arr[501];
int d[501];
int main() {
cin >> T;
for (in... | ALGO | 0.999925 | 4.312268 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-25T15:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59e12221532... |
bad74e78-7c85-44c5-a37a-7d9912d43f42 | rtxu/cp | codeforces/1419/B/solution.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
os << '{';
string sep;
for (const auto &x : v)
os << sep << x, sep = ", ";
return os << '}';
}
template <typename T, size_t size>
ostream &operator<<(ostream &os, const ar... | ALGO | 0.999939 | 4.886869 | {
"github_metadata": {
"branch": "master",
"commit_count": 453,
"repo_created_at": "2015-09-14T16:07: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": "0369b781... |
b82cb02a-6914-49ef-aa88-a514cb9e9591 | GauravUpreti893/LeetCode | 1372-longest-zigzag-path-in-a-binary-tree/1372-longest-zigzag-path-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999945 | 4.757002 | {
"github_metadata": {
"branch": "main",
"commit_count": 4576,
"repo_created_at": "2022-02-01T16:25: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": "900fa853f... |
75487bc1-d530-4889-be9f-eb0af974e90b | ishandutta2007/codeforces-p | pavement/normal/415/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef TEST
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define ins insert
#define mp make_pair
#define mt make_tuple
#define pb push_back
#de... | ALGO | 0.999951 | 3.059122 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "30b547da45dc... |
8ba7046d-193b-4ed5-a051-2a78362313c0 | matthewsamuel95/ACM-ICPC-Algorithms | Search/BinarySearch/c++/bsearch.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
std::vector<int> myarray;
// implements binary search
bool binary_search(int number)
{
int higher = myarray.size();
int lower = 0;
int mid;
do
{
mid = (lower + (higher - lower)) / 2;
if (number == myarra... | ALGO | 0.999621 | 4.609272 | {
"github_metadata": {
"branch": "master",
"commit_count": 1421,
"repo_created_at": "2017-10-21T21:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2203,
"forks": 1277,
"issues": 4,
"pull_requests": 48
},
"file_meta": {
"content_id": "... |
b14689d9-9379-4680-bf2d-799c5438eb35 | SarvinB/ConnectedSubgraphAdjacencyMatrix | main.cpp |
// CPP program to print the number of largest
// connected component in a grid and show you all subgraph groups
// input is every Adjacency_matrix
#include <bits/stdc++.h>
using namespace std;
// struct for position of cells
struct Node
{
int i;
int j;
};
class Graph
{
// length and width
int n;
... | ALGO | 0.999943 | 3.799464 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-04T10:49: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": "93e70c9bb9... |
b8d5170e-8bbc-4920-be65-b604b15dd029 | abhinavagarwalla/kgpkubs-southkorea | Strategy/Tactics/tReceiveBall2015.hpp | #ifndef TRECEIVEBALL2015_HPP
#define TRECEIVEBALL2015_HPP
#include <list>
#include "comdef.h"
#include "tactic.h"
#include "skillSet.h"
#include "beliefState.h"
#include "logger.h"
#include "config.h"
namespace Strategy
{
class TReceiveBall2015: public Tactic
{
public:
TReceiveBall2015(const BeliefState* sta... | ALGO | 0.916759 | 4.916311 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2015-05-31T11:07:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d3bcdfb1... |
433db673-bea8-423e-8119-634a87a05988 | EmoryHuang/myLeetCode | Solution/210.课程表II/210.课程表II.cpp | /*
* @Descroption: LeetCode 210. 课程表 II
* @Author: EmoryHuang
* @Date: 2021-10-23 14:46:05
* @Method:
* 拓扑排序
* 维护一个队列,将入度为 0 的节点入队,然后将其连接的节点入度减一
* 直到队列为空
*/
class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
unordered_map<int, vector<int>> edges;... | ALGO | 0.999987 | 6.364008 | {
"github_metadata": {
"branch": "master",
"commit_count": 327,
"repo_created_at": "2021-05-03T09:10:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8984a09e... |
313edac5-a445-422a-aa0b-c0d5e05b0f2a | ishandutta2007/codeforces-h | hs-black/normal/1144/G.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll long long
using namespace std;
template <typename T>
void read(T &x) {
x = 0; bool f = 0;
char c = getchar();
for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
for (;isdigit(c);c=getchar()) x=x*10+(c^48);
if (f) ... | ALGO | 0.999993 | 3.418986 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "c1e8e9e1fc17... |
55b1083b-687f-495d-80e2-c80a8c879b4d | fsilva19/coluna_maior | coluna_maior.cpp | #include <iostream>
using namespace std;
#define MAX 20 //define como tamanho maximo uma matriz do tipo 20x20 (linhas x colunas);
void procura_maior(int lin, int col, int matriz[MAX][MAX]);
int main(){
int lin, col;
int matriz[MAX][MAX];
cout << "\nCODIGO EM C++ PARA VERIFICAR QUAL O MAIOR VALOR DE CADA ... | ALGO | 0.999323 | 4.23685 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-06T02:23: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": "9107d3baf063... |
19c482a8-b8e8-482d-84e6-e31d55da5307 | RamazanDemirci/cppAdvancedSTL | src/storeSTL/Introduction_of_Templates_5.cpp | #include <iostream>
template <typename T>
T square(T x)
{
return x * x;
}
template <typename T>
class BoVector
{
T arr[1000];
int size;
public:
BoVector() : size(0) {}
void push(T x) { arr[size] = x, size++; }
T get(int i) const { return arr[i]; }
int getSize() const { return size; }
... | TOOL | 0.926673 | 5.494998 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2020-11-24T18:13: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": "614f5c5626a... |
dfd77c8f-4bbc-417c-8f83-89735a89854f | brpapa/algorithms | solutions/uva/12484.cpp | /*
math > game theory > minimax
difficulty: medium
date: 28/Mar/2020
problem: alberto and wanderley take one of two cards at the edges of the cards sequence, alberto want maximize it
hint: fill memo table in row-major order
by: @brpapa
*/
#include <iostream>
using namespace std;
typedef long long ll;... | ALGO | 0.999986 | 4.260602 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2019-01-25T20:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "235237... |
6be1c1d9-26cc-4e1a-bd6b-62e6c3a63931 | PritomPaul99/CodesFromVScode | C++_programming/Algorithms/Sub-array_Problems/Maximum_Sum_Subarray/Maximum_Sum_subarray_n^3.cpp | #include <iostream>
#include <climits>
using namespace std;
int maxSumSubarray(int *arr, int n);
int main()
{
int arr[] = {-1, 4, -2, 5}; //MSS = 7
int n = sizeof(arr) / sizeof(arr[0]);
int m = maxSumSubarray(arr, n);
printf("Maximum subarray sum = %d", m);
return 0;
}
int maxSumSubarray(int *... | ALGO | 0.999643 | 4.978423 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2022-03-07T21:12:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac01477a7... |
4c4c2e25-2390-4878-bca2-df67bd5dd94d | Nitin-Budakoti/DSA-Revision-sheet- | graph/bfs.cpp | #include<iostream>
#include<unordered_map>
#include<list>
#include<queue>
using namespace std;
// adjacency list implementation
class Graph{
unordered_map<int,list<pair<int,int>>>adjList;
public:
void addList(int u , int v, int d , bool direction){ // d for distance between them
// connect u to v
... | ALGO | 0.999479 | 4.143158 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-05-29T14:05: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": "9b493ea3ee1... |
071a7916-2268-429d-ad93-8fe30cc373ef | saksham117/150-Questions | 5. Linked Lists/4. delete nth node from end.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<unordered_map>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<unordered_set>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), n... | ALGO | 0.999947 | 5.296742 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-02-24T16:35: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": "692653266ee9... |
3be86a79-df33-426f-9fbd-fdd8211542c0 | wonderli/Solutions | misc/LeetCodeSol/Q64_Maximum_Height_of_Binary_Tree/Q64_iter.cpp | #include <stdio.h>
#include <stack>
using namespace std;
typedef struct node {
struct node *left;
struct node *right;
int data;
} Node;
Node *createNode(int data){
Node *n = (Node *)malloc(sizeof(Node));
n->data = data;
n->left = NULL;
n->right = NULL;
return n;
}
//Post order
int max_h... | ALGO | 0.999897 | 5.139416 | {
"github_metadata": {
"branch": "master",
"commit_count": 1860,
"repo_created_at": "2012-02-17T00:32:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1c3157... |
5a593f6a-191e-48a7-872a-183b89bf3df1 | tttran67/Parallel-Programming-Lab3_SIMD | Neon/main.cpp | #include <iostream>
#include<arm_neon.h>
#include<sys/time.h>
using namespace std;
const int maxN = 500;
float32_t A[maxN][maxN];
float32x4_t va = vmovq_n_f32(0);
float32x4_t vx = vmovq_n_f32(0);
float32x4_t vaij = vmovq_n_f32(0);
float32x4_t vaik = vmovq_n_f32(0);
float32x4_t vakj = vmovq_n_f32(0);
void ReSet(){
f... | ALGO | 0.999898 | 3.204667 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-04-03T12:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2cf46211828... |
8dd9f124-6a7e-4efd-9e59-46c029d6a2ea | akrissy/C-Projects | AAlmeda_CW6_Part1.cpp | /*
* Class: CMSC 140 CRN 21090
* Instructor: <NAME>
* Classwork 6 Part 1
* Description: Write a program that allows the user to choose addition
or subtraction operations on two numbers entered from the keyboard.
* Due Date: 11/06/2022
* I pledge that I have completed the programming assignment independently.
... | TOOL | 0.987587 | 4.637676 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-12-09T00:07: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": "8fa481e2f805... |
ec978c40-1198-43bc-8541-18574edfb46d | pradyumna0104/apan-college-dsa | 30. Stacks (Part 2)/Valid_Parenthesis.cpp | #include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
bool ValidParenthesis(string str){\
stack<char> s;
int n = str.length();
for (int i = 0; i < n; i++){
if (str[i] == '(' || str[i] == '{' || str[i] == '['){
s.push(str[i]);
... | ALGO | 0.993103 | 5.816068 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2025-03-28T08:42:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87d880566e0... |
38a04990-c952-4652-b851-39f8210117cc | yuhc/LeetCode | src/lc23.cpp | /* LC ID : #23
* Type : Heap, sort
* Author: <NAME>
* Date : 04/12/2015
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
//copy the Solution class here
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* L... | ALGO | 0.999956 | 5.539427 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-10-02T03:42: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": "2682ab97d... |
0adadec9-5e3f-403e-ac5f-cf94a09160d7 | yashparmar15/Cpp-Codes | Sort_Array_By_Parity.cpp | /*Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
You may return any answer array that satisfies this condition.
Example 1:
Input: [3,1,2,4]
Output: [2,4,3,1]
The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be a... | ALGO | 0.999973 | 5.430782 | {
"github_metadata": {
"branch": "master",
"commit_count": 831,
"repo_created_at": "2020-06-30T16:20:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b767f6cd... |
95f80f67-9d7c-4c16-b8ac-78370439df8b | jakelin0fly/CPP-Design-Patterns | Composite-Pattern/Composite-Pattern.cpp | //
// Created by JakeLin on 2021/11/18.
//
#include <bits/stdc++.h>
using namespace std;
/**
* 实现一个文件管理工具,支持对文件夹和文件的创建和删除功能,并且提供 tree 接口显示文件系统结构。
* 设计类图如下:https://gitee.com/jakel-in/images/raw/master/2021-11/Composite-Pattern-Example.png
*/
// 抽象部件:抽象文件结点
class IFile {
public:
IFile(string name) : fileName(nam... | TOOL | 0.942364 | 5.546826 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-11-01T06:52: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": "9a432ac40... |
c0142b01-f4df-428c-9469-676063b3dabb | ObeWan99/SkillBoxCplus | module21/main1.cpp | #include <iostream>
#include <fstream>
#include <vector>
struct person{
std::string name;
std::string surename;
std::string date;
double amount;
};
// Функция для валидации формата даты
bool validateDate(const std::string& date) {
if (date.size() != 10) // Проверка длины строки
return fals... | TOOL | 0.913519 | 5.332218 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-05-25T05:15: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": "127fb48f46b... |
a2c616d4-1dbe-4f5b-b835-2f1b2f600d0b | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/08/22/2.cpp | #define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:64000000")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
//#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include ... | ALGO | 0.99987 | 4.149214 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "147ce9ec... |
7f949f63-b5e8-49f6-b3c5-fdacd7f3d672 | sachuverma/DataStructures-Algorithms | DSA Crack Sheet/solutions/Reorganize String.cpp | /*
Reorganize String
=================
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.
Return any possible rearrangement of s or return "" if not possible.
Example 1:
Input: s = "aab"
Output: "aba"
Example 2:
Input: s = "aaab"
Output: ""
Constraints:
1 <= s.len... | ALGO | 0.999989 | 5.923726 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1... |
60a5d45d-962e-4eed-854b-c33daacf7644 | chocono2230/competitive-programming | AtCoder/Problems/abc299/gp_230422_1/abc299_gp_230422_1.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--)
#define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--)
#define repit(itr, x) for (auto itr = x.b... | ALGO | 0.999997 | 3.681482 | {
"github_metadata": {
"branch": "main",
"commit_count": 231,
"repo_created_at": "2022-10-09T09:59: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": "142958700c... |
529f6969-1ebe-4601-a0bd-03bcd0893752 | trilinos/Trilinos | packages/ifpack/src/Ifpack_IC_Utils.cpp | /*@HEADER
// ***********************************************************************
//
// Ifpack: Object-Oriented Algebraic Preconditioner Package
// Copyright (2002) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or... | ALGO | 0.999933 | 4.48825 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
b741b2be-9af1-4b76-ad6d-087f06a5c112 | mariaaktermukti/Leetcode | Add_Binary.cpp | #include <iostream>
using namespace std;
string addBinary(string a, string b) {
string result = "";
int carry = 0, i = a.size() - 1, j = b.size() - 1;
while (i >= 0 || j >= 0 || carry) {
int sum = carry;
if (i >= 0) sum += a[i--] - '0';
if (j >= 0) sum += b[j--] - '0';
... | ALGO | 0.999972 | 6.36481 | {
"github_metadata": {
"branch": "main",
"commit_count": 147,
"repo_created_at": "2025-02-24T17:00:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf234b7e60... |
c292b281-ada1-47aa-a88c-913d9060d394 | JSeungBeom/ps | 백준/Platinum/1786. 찾기/찾기.cc | #include <bits/stdc++.h>
using namespace std;
vector<int> failure(string& s) {
vector<int> f(s.size());
int j = 0;
for (int i = 1; i < s.size(); i++) {
while (j > 0 && s[i] != s[j]) j = f[j - 1];
if (s[i] == s[j]) f[i] = ++j;
}
return f;
}
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
string s,... | ALGO | 0.999979 | 4.636525 | {
"github_metadata": {
"branch": "main",
"commit_count": 893,
"repo_created_at": "2022-03-03T18:06: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": "3f46ff6a4d... |
dea92300-db74-4841-abd9-ca5b35cda60d | maxmakovskiy/zip_text_maker | src/tree.h | #ifndef ZIP_CODER_TREE_H_
#define ZIP_CODER_TREE_H_
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <cstdint>
#include <iostream>
namespace zip_maker {
struct TreeNode;
using TreePtr = std::shared_ptr<TreeNode>;
using Symbols = std::vector<std:... | ALGO | 0.994503 | 5.508844 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-12-22T21:35: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": "71a9dea9217... |
15889817-6086-41b2-9305-867a0bffa3db | wslatts/Sorting_Algorithms_Comparison | heapSort.cpp | /*
* heapSort.cpp
*
* Data Structures & Algorithms, Project 1
* <NAME>
* 2/29/20
*
* compile: g++ -o heapSort.exe heapSort.cpp
*/
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <vector>
#include <map>
#include <iomanip>
#include <sys/time.h>
using namespace std;
/* Global Variables */
vec... | ALGO | 0.999688 | 5.01704 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-03-08T04:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3324380aaa5... |
8117136b-7efe-4d6a-853e-2ee4baebddf5 | SamDavey16/Parallel-Histogram-Equalisation | Tutorial 2/Tutorial 2.cpp | #include <iostream>
#include <vector>
#include "Utils.h"
#include "CImg.h"
using namespace cimg_library;
//Implementation explanation: Initially the program takes in a user input for the number of bins to be used in the histogram kernel. The program consists of four kernels: A simple histogram implementation which c... | TOOL | 0.981006 | 4.766502 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-05-11T11:23: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": "64a83a53192c... |
ae63821b-80c0-476b-a25c-295a8177bf34 | khadija1114/Online-Judge-Solutions | Light OJ/1080.cpp | ///using difference array as bitTree for range update
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int bit[N], n, ar[N];
string s;
int getsum (int index)
{
int sum = 0;
while (index){
sum += bit[index];
index -= (index & -index);
}
return sum;
}
void update(in... | ALGO | 0.999734 | 4.033384 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2023-07-13T13:48: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": "8dc2c2eb30e... |
30ff2ca9-b171-4e5d-84df-3075e6c37b35 | smangano/theoria | include/theoria/util/strings.h | /*
* Theoria - A C++ Application Container for the Real and Virtual World
*
* Copyright (c) 2016 theoriacpp.com
*
* This library is released under the Apache License v. 2.0. See LICENSE in top level directory of this project.
* or https://github.com/smangano/theoria/blob/master/LICENSE
*/
#pragma once
#inclu... | TOOL | 0.949249 | 6.412697 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2016-10-01T19:42:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8c567c18... |
563e31ad-2d6c-4026-baf1-87c1d2dcb0d0 | driver2000/AC | Decoder.cpp | #include "Decoder.h"
using namespace std;
//metodo che restituisce la frequenza dei caratteri
void Decoder::readInfo(string in)
{
const char* inFile = in.c_str();
ifstream ifile(inFile,ios::binary);
if (ifile.fail())
{
cerr<<RED<<"Impossibile aprire il file di input"<<endl;
exit(1);
... | ALGO | 0.9809 | 3.885465 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-05-18T17:53:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66274460fa... |
5dc6d668-1328-4449-966e-3b1a4a403841 | gameblabla/CSE2 | src/Fade.cpp | // THIS IS DECOMPILED PROPRIETARY CODE - USE AT YOUR OWN RISK.
//
// The original code belongs to Daisuke "Pixel" Amaya.
//
// Modifications and custom code are under the MIT licence.
// See LICENCE.txt for details.
#include "Fade.h"
#include <string.h>
#include "WindowsWrapper.h"
#include "Draw.h"
FADE gFade;
st... | TOOL | 0.945189 | 5.214167 | {
"github_metadata": {
"branch": "portable",
"commit_count": 2694,
"repo_created_at": "2020-11-08T03:26:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 155,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8... |
e9758798-188d-4e1f-8cda-e62a1f5b1606 | KhoiBui16/Fullhouse_Code_Online | DSA/Contest/01_DSA - LyThuyetSo/Bai_03/KiemTraSoThuanNguyenTo.cpp | #include <bits/stdc++.h>
using namespace std;
bool IsPrime(int n)
{
if (n < 2)
return false;
for (int i = 2; i * i <= n; i++)
if (n % i == 0)
return false;
return true;
}
bool IsPerfectPrime(int n)
{
long sum = 0;
while (n != 0)
{
int digit = n % 10;
... | ALGO | 0.999894 | 5.093794 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2024-01-13T13:44:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee1397565b... |
b5549212-51d8-4de3-a512-15098d9f9ad7 | ishandutta2007/codeforces-r | radal/normal/149/E.cpp | #include <bits/stdc++.h>
#pragma GCC target ("avx,avx2,fma")
#pragma GCC optimization ("O8")
#pragma GCC optimization ("unroll-loops")
#define X first
#define Y second
#define debug(x) cerr << #x << ": " << x << endl;
#define endl '\n'
#define pb push_back
#define rep(i,l,r) for (int i=l; i<r; i++)
#define repr(i,r,l) ... | ALGO | 0.99997 | 3.729775 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "049e9f131cbd... |
ae4c1de1-1b39-4161-a6bb-b3ebc631dc8c | 1001101dfs/AISD | 16-3.cpp | #pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#include <iostream>
#include <cmath>
#include <iomanip>
#include <set>
#include <algorithm>
#include <fstream>
#include <vector>
#include <string>
#include <climits>
#include <ctime>
#include <queue>
#include <map>
#include <stack>
#include <unordered_s... | ALGO | 0.999959 | 3.850479 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-03-11T13:10: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": "8ed7d853abc... |
4c6577f5-af65-4c2a-9415-d859687523d4 | ADACS-Australia/RSienaTest | src/model/effects/ContinuousEffect.h | /******************************************************************************
* SIENA: Simulation Investigation for Empirical Network Analysis
*
* Web: http://www.stats.ox.ac.uk/~snijders/siena/
*
* File: ContinuousEffect.h
*
* Description: This file contains the definition of the
* ContinuousEffect class.
*... | ALGO | 0.96927 | 7.058199 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-12-14T23:14:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "038f6c5c48... |
a273b333-c8a0-46ce-8dd6-a8dd7377a822 | fbi-octopus/biggles | include/biggles/mh_moves/mh_move_weights.hpp | #ifndef BIGGLES_MH_MOVE_WEIGHTS_HPP___
#define BIGGLES_MH_MOVE_WEIGHTS_HPP___
#include "../track_collection.hpp"
#include "../detail/fun.hpp"
#include "../detail/constants.hpp"
#include "../sampling/simple.hpp"
namespace biggles { namespace mh_moves {
typedef std::unary_function<shared_const_track_ptr, float> track_... | ALGO | 0.994382 | 7.417585 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-09-05T15:31:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8486d5dc9f2... |
dd2bf1df-3d08-45d8-be20-1c360a3d4a62 | rafa14-maker/Competitive-programming | MEX Sequences cf.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define CherryFrog ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
ll mod(ll a, ll m)
{
return (a%m + m) % m;
}
ll mk = 998244353;
long long bigmod(long long f,long long b ,long long m)
{
if(b==0)
{
return 1;
}
... | ALGO | 0.999956 | 4.034661 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-04T08:29:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f8f829f9875... |
56c1c1eb-8a8a-406a-8b1f-432e3aece57d | dune-mirrors/dune-fem | dune/fem/solver/viennacl.hh | #ifndef DUNE_FEM_SOLVER_VIENNACL_HH
#define DUNE_FEM_SOLVER_VIENNACL_HH
#if HAVE_VIENNACL
#if HAVE_EIGEN
#define VIENNACL_WITH_EIGEN
#endif
// OpenCL overrules OpenMP
#if HAVE_OPENCL
//#warning "Using OpneCL"
//#define VIENNACL_WITH_OPENCL
#elif _OPENMP
#error
#define VIENNACL_WITH_OPENMP
#endif
#include <viennacl/... | ALGO | 0.961593 | 6.903374 | {
"github_metadata": {
"branch": "master",
"commit_count": 13439,
"repo_created_at": "2017-08-03T11:55:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74edca5... |
ee030e82-7627-437f-a087-2b7aaa2fdb86 | peiyusi/Data-Structures | hdu/1040.cpp | #include <iostream>
using namespace std;
int a[1000];
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int partition (int a[], int first, int last) {
int pivot = a[last];
int i = first - 1;
for (int j = first; j <= last - 1; j++) {
if (a[j] <= pivot) {
i++... | ALGO | 0.999916 | 4.523447 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2017-07-23T14:19:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "43493b26... |
9f80d34d-6c9e-4f3c-96dc-d4368fe56a77 | LearnerBharat/CPP | Sorts/Quick_Sort_1.cpp | #include <iostream>
using namespace std;
// Function to swap two elements
void swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
// Partition function to place pivot element at its correct position
int partition(int* arr, int start, int end) {
int pivot = arr[end];
int i = (start - 1);
... | ALGO | 0.999958 | 6.48509 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-20T16:07: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": "da492713f6... |
57d79840-db74-4e95-a85f-3a141f5f1884 | alphanso/Random-Coding | competitions/codechef/Aug Long Contest/macgun.cpp | //==============================================================================
// Copyright (C) 2012 <NAME> <<EMAIL>>
// macgun.cpp is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the ... | ALGO | 0.999231 | 4.017248 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2012-05-18T19:49:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f11bc218... |
98bbbd47-91cd-4ce3-a385-d8560ef40621 | oils-for-unix/oils | vendor/souffle/profile/Table.h | /*
* Souffle - A Datalog Compiler
* Copyright (c) 2016, The Souffle Developers. All rights reserved
* Licensed under the Universal Permissive License v 1.0 as shown at:
* - https://opensource.org/licenses/UPL
* - <souffle root>/licenses/SOUFFLE-UPL.txt
*/
#pragma once
#include "souffle/profile/DataComparator.h"... | TOOL | 0.912628 | 7.575955 | {
"github_metadata": {
"branch": "master",
"commit_count": 11425,
"repo_created_at": "2016-11-15T19:19:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3156,
"forks": 165,
"issues": 544,
"pull_requests": 29
},
"file_meta": {
"content_id": ... |
2af02253-a09b-4592-aab4-109f9115ee99 | quartz-roseline/quartz | src/micro-services/sync-service/sync/huygens/SVMprocessor.cpp | /**
* @file SVMprocessor.cpp
* @brief SVM based Timestamp Processor to calculate offset and drift
* @author <NAME>
*
* Copyright (c) Anon, 2018. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are ... | ALGO | 0.946135 | 4.920116 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-16T14:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fad2e4de19... |
89a134e2-10fd-4217-9477-1842934276ce | viennacl/viennacl-dev | viennacl/linalg/host_based/misc_operations.hpp | #ifndef VIENNACL_LINALG_HOST_BASED_MISC_OPERATIONS_HPP_
#define VIENNACL_LINALG_HOST_BASED_MISC_OPERATIONS_HPP_
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Comp... | TOOL | 0.973558 | 6.514904 | {
"github_metadata": {
"branch": "master",
"commit_count": 1482,
"repo_created_at": "2013-02-22T14:47:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 288,
"forks": 89,
"issues": 85,
"pull_requests": 4
},
"file_meta": {
"content_id": "91e... |
929b490a-a944-4614-b810-05a69ae2ccaa | zoolsher/MinHeap | MinHeap.cpp | //
// Created by zoolsher on 16/4/13.
//
#include "MinHeap.h"
#include <iostream>
template <class T>
inline void swap(T *a,T *b){
T t = *a;
*a = *b;
*b = t;
}
template <class T>
MinHeap<T>::MinHeap(){
new (this)MinHeap(30);
}
template <class T>
MinHeap<T>::MinHeap(int capacity){
this->mSize = 0;
... | ALGO | 0.992896 | 3.780575 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-04-13T13:44: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": "6a225ba54... |
031d0aa0-c70f-4750-bd2b-e94777aeaa5e | SPFA-newbie/leet-code-answer | #126.cpp | #include<vector>
#include<string>
#include<queue>
#include<map>
#include<set>
using namespace std;
class Solution {
public:
map<string, vector<string>> e;
map<string, set<string>> from;
vector<vector<string>> ans;
void makeEdge(string& a, string& b) {
int diff=0;
for(int i=0;i<a.length(... | ALGO | 0.999994 | 5.212345 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2022-11-19T03:16: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": "3f337181950... |
77ab3188-3d3f-49f3-9565-213426a89881 | christopheradnel414/3D-Elastic-Solid-DCPSE-Simulation | neighbourfind.cpp | #include <vector>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <chrono>
#include "neighbourfind.hpp"
using namespace std;
void zip (vector<int> sorted,
vector<double> sorter,
vector<pair<int,double>> &zipped)
{
for (int i = 0; i < sorted.size(); i++)
{
z... | ALGO | 0.998929 | 3.935539 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-27T00:36:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f20daa671d... |
84d31bec-b77f-40d1-ab62-f26370fbf210 | henryjchen/Competitive-Programming | usaco/bronze/MilkFactory/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
int N;
int A[100], B[100], X[100];
void final_dest(int target) {
for (int j = 0; j < N-1; j++) {
if (A[j] == target) {
X[B[j]-1]++;
final_dest(B[j]);
}
}
}
int main() {
ifstream fin ("factory.in");
ofs... | ALGO | 0.999975 | 3.73071 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-12-06T17:19: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": "a4dc59344... |
64f4ee1f-a0b4-41ca-9e25-f8400881eac1 | ishandutta2007/codeforces-f | fkguyx042/normal/223/B.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#define ls (t<<1)
#define rs ((t<<1)+1)
#define mid ((l+r)>>1)
#define fi first
#define se second
#define mk make_pair
#define N 200005
#define M 200005
#define seed 23333
#define Mo... | ALGO | 0.999999 | 3.206 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01: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": "13790a07541c... |
e7eaba39-2e91-4d8a-ade6-4f72e6dcfbf3 | SkyLoaderr/xray-engine-repo | Dima/bge.root/bge/vo/EG_PVS.CPP | //////////////////////////////////////////////////////////////////////////////////
// Module : endgame solver //
// File : eg_pvs.cpp //
// Creation date : 14.02.2001 //
// Author : <NAME> //
/////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.996511 | 3.998043 | {
"github_metadata": {
"branch": "master",
"commit_count": 83977,
"repo_created_at": "2021-04-21T18:03:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1028... |
e27a166a-6c92-439c-a604-0a29a09ce435 | FORTH-ModelBasedTracker/MocapNET | src/MocapNET2/MocapNETLib2/tools.cpp | #include "tools.hpp"
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <ctype.h> //tolower
#include <string.h>
#include <stdlib.h>
unsigned long tickBaseMN = 0;
#define NORMAL "\033[0m"
#define BLACK "\033[30m" /* Black */
#defi... | TOOL | 0.938144 | 4.190548 | {
"github_metadata": {
"branch": "master",
"commit_count": 544,
"repo_created_at": "2019-07-05T11:13:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 899,
"forks": 137,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "74b6... |
b5b1d16d-06e3-4587-863b-9970b843dc45 | luatil/cppractice | competitive_programming/codeforces/703_div2/b2.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define REP(i, n) for(int i = 0; i < n; i++)
#define ll long long
const int SIZE = 1e5 + 7;
int ans(int n0, int n1, int n2, int n)
{
if(n0 == n1 && n2 == n1) return 0;
if( n0 < n2 && n1 < n2 )
{
return (n-n0) + 2*(... | ALGO | 0.999793 | 4.307335 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2021-01-29T18:25: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": "2e562b476dc... |
b31a31c6-4e9d-47f1-be30-81a783eb8c44 | Silvya292/Practicas_UCO | Segundo/Practicas_ED/P6-graph_traversals/prim_algorithm.hpp | /**
* @file prim_algorithm.hpp
*
* CopyRight <NAME> <<EMAIL>>
*
* Sólo se permite el uso de este código en la docencia de las asignaturas sobre
* Estructuras de Datos de la Universidad de Córdoba.
*
* Está prohibido su uso para cualquier otro objetivo.
*/
#pragma once
#include <exception>
#include <utility>
#... | ALGO | 0.999777 | 6.295637 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-02-15T10:04: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": "e24e81638221... |
dcdc9382-0192-414f-bb23-d6d59505dd60 | Ayush11090/program | AB/5.Memory Management/Placement Stratagy/next_fit.cpp | #include <bits/stdc++.h>
using namespace std;
void NextFit(int blockSize[], int m, int processSize[], int n)
{
int allocation[n], j = 0, t = m - 1;
memset(allocation, -1, sizeof(allocation));
for (int i = 0; i < n; i++)
{
while (j < m)
{
if (blockSize[j] >= processSize[i])... | ALGO | 0.999913 | 4.236251 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-19T02:17: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": "47b206c89261... |
e6bd97e6-7f68-470c-b06a-bc07737029f1 | kasha01/comp-programing | leetcode/_cplusplus/_675_cut_off_trees_for_golf_event.h | #ifndef _675_CUT_OFF_TREES_FOR_GOLF_EVENT_H_INCLUDED
#define _675_CUT_OFF_TREES_FOR_GOLF_EVENT_H_INCLUDED
// https://leetcode.com/problems/cut-off-trees-for-golf-event/
class Solution {
class MyComparer {
public:
bool operator() (const vector<int>& a, const vector<int>& b){
return a[2]>b[2];
... | ALGO | 0.99983 | 5.466213 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2016-06-09T02:12: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": "b792a3813... |
267652b5-e98e-458b-9f88-5d4f41342d5f | wesley-a-leung/waterloo-black-dhaka-trd | content/geometry/Plane3D.h | /**
* Author: wleung_bvg
* Description: Plane operations in 3D
*/
#include "Point3D.h"
#include "Line3D.h"
using namespace std;
struct Plane3D {
pt3 n; T d;
// ax + by + cz = d, above is ax + by + cz > d
Plane3D(T a=0, T b=0, T c=0, T d=0) : n(a, b, c), d(d) {}
// normal n, offset d
Plane3D(pt3 n, T d) : ... | ALGO | 0.998197 | 5.95101 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-23T06:32:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da3751c2392e... |
2c20d67f-bb7f-4e6e-84c3-45511e79d21f | mdarafat1819/Code-Library | tamplate_for_Process.cpp | #include <bits/stdc++.h>
#include <string.h>
using namespace std;
class Process {
public:
string p_name;
int at, bt, wt, tat;
Process() {
at = bt = wt = tat = 0;
p_name = "p";
}
void print() {
cout<<p_name<<" "<<at<<" "<<bt<<" "<<wt<<" "<<tat<<endl;
}
void input(in... | ALGO | 0.999602 | 3.756656 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2020-04-10T17:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5b9b007... |
91f5c2fb-cf73-4586-be0c-95b030a40143 | kunidesuyo/competitive-programming | src/atcoder/abc/abc315/e/abc315_e.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#include <cmath>
#define all(x) (x).begin(), (x).end()
using ll = long long;
const ll INF = 1LL << 60;
const int inf = INT_MAX / 2;
int main() {
int n;
cin >> n;
int c[n];
vector<vector<int>> p(n, vector<int>());
... | ALGO | 0.999971 | 4.081614 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2021-05-23T09:30: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": "7052098d... |
0d55cc5a-9182-4e6c-87af-18e72b3a7f4e | ayushraut2111/Datastructure | heap/heap sort descending order.cpp | #include<bits/stdc++.h>
using namespace std;
struct minheap
{
int *arr;
int cap;
int size;
minheap(int c)
{
cap=c;
arr=new int[cap];
size=0;
}
int lchild(int i)
{
return 2*i+1;
}
int rchild(int i)
{
return 2*i+2;
}
int parent(in... | ALGO | 0.999798 | 4.413274 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-04-11T19:45:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30edc8a1e1a... |
dcdd5f17-6e45-4408-93b3-1c0c9df26a00 | Ashish8449/improveYourSelf | B_AGAGA_XOOORRR.cpp | /*
*
*************************************************************
* AUTHOR : <NAME> *
* Language: C++14 *
* Purpose: - *
* IDE used: Visual Studio Code. *
**************... | ALGO | 0.9999 | 4.348234 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2021-12-06T14:41:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2de8d20b04... |
503a1ccf-83da-4470-965f-231c758734e5 | leoazevedodev/ufjf-ex06 | main.cpp | #include <iostream>
#include "Ponto.h"
#include "ListaCont.h"
using namespace std;
void particiona(ListaCont *L1, ListaCont *L2, ListaCont *L3)
{
int tam = 50;
for(int i = 0; i < tam; i++)
{
L1->insereFinal(i);
}
for(int i = 0; i < 25; i++)
{
L2->insereFinal(L1->get(i));
}
... | ALGO | 0.996123 | 4.442856 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-05-09T17:20: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": "9c0d613b6988... |
8a5f01bf-46e7-4338-aa2e-e8311a18a12b | 100sarthak100/DataStructures-Algorithms | Code/Graphs/findWhetherPathExists_DFS.cpp | // 3 0 0 0
// 0 3 3 0
// 0 1 0 3
// 0 2 3 3
// o/p = 1
// A value of cell 1 means Source.
// A value of cell 2 means Destination.
// A value of cell 3 means Blank cell.
// A value of cell 0 means Blank Wall.
// Testcase 2: The matrix for the above given input is:
// 0 3 2
// 3 0 0
// 1 0 0
// From the matrix we can ... | ALGO | 0.999901 | 4.517974 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-05-25T14:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "78bb999a9... |
c3a6163f-748b-48b7-aafe-79ef48a3d238 | hamko/procon | topcoder/log/637D1E.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mt make_tuple
template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
templa... | ALGO | 0.999851 | 4.612278 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-04-11T16:49:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b2d1160... |
0cefa33e-efd1-4c7c-a204-baaff8c47807 | PuffyShoggoth/Competitive | CCC/CCC '18 S4 - Balanced Trees.cpp | #include <bits/stdc++.h>
#define MAX 1000000
using namespace std;
const int INF = 0x3f3f3f3f;
unordered_map<int, long long int> vls;
long long int dpv[1000005];
//this differs from my wa solution on CCC by, like, an equals sign and an if statement >:-(
long long int dp(int w){
if(w==1 || w==2){return 1;}
if(w==0){ret... | ALGO | 0.999989 | 3.79194 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-12-19T18:03: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": "03ca7b313... |
f89166d2-9e5d-4bdd-9073-53bedd0ad3ee | DevBaweja/Competitive-Coding | GeeksForGeeks/Binary Tree/Symmetric Tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
/*
bool isSymmetricUtil(Node* left, Node* right){
if(!left && !right) return true;
if((left && !right) || (!left && righ... | ALGO | 0.999981 | 5.836511 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2020-10-25T07:57: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": "01ed14f47... |
6d026fae-e925-47ea-a5dd-9975ca9c6efa | esteve/gpt | src/daedalus/daeMain.cc | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
using namespace std;
#include <daedalus/daeTypes.h>
#include <daedalus/daeTokens.h>
#include <daedalus/_daeErrors.h>... | TOOL | 0.966336 | 5.103693 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2012-11-12T14:35: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": "e9c081164... |
e3a68625-d9e4-43ec-8bbe-92254dd3dc1b | autowarefoundation/autoware_universe | localization/yabloc/yabloc_particle_filter/src/common/mean.cpp | // Copyright 2023 TIER IV, Inc.
//
// 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 to i... | ALGO | 0.999462 | 6.768713 | {
"github_metadata": {
"branch": "main",
"commit_count": 8531,
"repo_created_at": "2021-11-19T02:59:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1208,
"forks": 763,
"issues": 216,
"pull_requests": 161
},
"file_meta": {
"content_id": "5... |
b56c9a5e-59c1-4754-9ca0-46ec0a66afec | will-crawford/HackerRank | Algorithms/Dynamic Programming/maxsubarray.cxx | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
// after re-reading the input definition
int T; cin >> T;
while (--T >= 0) {
int N; cin >> N;
// after looking at Wikipedia ...
int a; cin >> a;
int bestT... | ALGO | 0.999888 | 3.265257 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-02-06T01:14: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": "566ce9ba0... |
e2fa4a18-cbb1-4504-ad36-dd5411366035 | sambayless/monosat | src/monosat/core/Config.cpp | /****************************************************************************************
The MIT License (MIT)
Copyright (c) 2014, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software with... | CONFIG | 0.967737 | 6.091199 | {
"github_metadata": {
"branch": "master",
"commit_count": 1506,
"repo_created_at": "2015-01-23T19:05:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 113,
"forks": 32,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e7a... |
f7bdb980-31fc-49ba-abb3-6c8d4884979d | chauhansatyam3112/Codeforces | .vscode/scuza.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int n, steps;
cin >> n >> steps;
vector<int> apple(n);
for (int i = 0; i < n; i++)
{
cin >> apple[i];
... | ALGO | 0.999944 | 3.824356 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-19T08:02: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": "d1aee5ab03... |
f77032b1-68b7-4a04-8cff-2eb1dbbc0927 | raincross7/code-similarity | codes/train_code/problem476/problem476_1.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const int MOD = 1000000007;
template <typename T>
void print(const T &v);
ll __lcm(ll a, ll b)
{
return a / __gcd(a, b) * b;
}
ll lcm(vect... | ALGO | 0.999988 | 4.00533 | {
"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": "dba1a0d4ca2e... |
8840f1f3-0cb1-40c1-8717-3ff9ff4ea8d9 | KudeGit/elments_of_programming_interview | first_pass/ch17_old/es12.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include "../utils.hpp"
using dict_t = std::unordered_set<std::string>;
std::vector<std::string> compute_partition (const std::string &S, const dict_t dict)
{
std::vector<int> K(1 + S.size(), 0);
for (int i = 1; i <= S.size(); ++... | ALGO | 0.998481 | 4.857162 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2015-10-24T08:50: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": "8b47549ce... |
53d8dc8b-5a5f-4f1b-b6ff-572d5428139d | vrangr1/competitive-programming | contests/codeforces/other_rounds/codeguerra/b.cpp | /***************************************************
* Author : <NAME>
* Nick : vrangr
* Created : Fri Dec 22 20:05:13 IST 2023
****************************************************/
#include <iostream>
#include <vector>
#include <string.h>
#include <ctype.h>
#include <set>
#include <stdlib.h>
#include <map>
#includ... | ALGO | 0.999729 | 4.463368 | {
"github_metadata": {
"branch": "main",
"commit_count": 585,
"repo_created_at": "2021-06-02T19:31:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d7ffa808b... |
6419db1a-9565-4047-aaf5-bf282fb8e96d | chnchg/sglass | src/ising_mc_cb.cpp | #include <random>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
#include <H5Cpp.h>
#include <algorithm>
#include <string>
#include <exception>
#include <memory>
#include <sstream>
// using namespace std;
// Calculation parameters
const int warm_up_time = 10000;
const int calculation_time = ... | ALGO | 0.995796 | 3.787886 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-08-28T06:03:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8db8fa2b0b7... |
f394dfab-678e-4745-b73f-a05f72450492 | RisshabSingla/LeetCode-C-Solutions | 42-trapping-rain-water/trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
// Approach 1: Brute Force -> O(n^2)
// int size = height.size();
// int ans = 0;
// for(int i = 0; i<size; i++){
// int left_max_height = -1;
// for(int j = i-1; j>=0; j--){
// ... | ALGO | 0.999997 | 6.61537 | {
"github_metadata": {
"branch": "main",
"commit_count": 2390,
"repo_created_at": "2023-06-13T15:11:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b282a45a2... |
4f519bc8-703f-42bf-8994-fd56cc41bbdf | ishandutta2007/codeforces-c | crasysky/normal/1106/E.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#define maxn 100005
#define INF 1LL << 60
using namespace std;
struct data{
int s, t, d, w;
bool operator < (const data &x) const{
return w < x.w || w == x.w && d < x.d;
}
bool operator == (const data &x) const{
return d == x.d && w == x.w... | ALGO | 0.99995 | 3.471127 | {
"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": "a65470b0b8ce... |
2e42d667-a8dd-4cf8-b012-0c97d03703f3 | VarunPrajapatii/C_CPP_Saurabh-Shukla | DSA MySirG again/9 Stack.cpp | /*
DSA through C++
Assignment-9: Stack using arrays
1. Define a class Stack with capacity, top and ptr pointer as member variables. Implement stack using array.
2. In question 1, define a parameterzied constructor to initialise member variables
3. In question 1, define a method to push a new element on to the Stack... | ALGO | 0.999467 | 5.265267 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-11-20T17:52: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": "d31b850a7f3... |
b63c81e8-20c7-47af-91d3-f9c44a710c19 | powergee/CompetitiveProgramming | 코드포스/724 Div2/A.cpp | #include <iostream>
#include <vector>
#include <set>
std::set<int> addNumbers(std::set<int> arr) {
std::set<int> numSet(arr.begin(), arr.end());
for (int u : arr) {
numSet.insert(u);
for (int v : arr) {
numSet.insert(std::abs(u-v));
}
}
return numSet;
}
int main() {... | ALGO | 0.999897 | 4.209743 | {
"github_metadata": {
"branch": "master",
"commit_count": 834,
"repo_created_at": "2020-05-24T17:14:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d0a2a74... |
40563eb5-ecdc-4a17-8c9f-3f3a29f85b90 | ayushman-777/Coding | CycleInUndirectedGraph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
bool vis[100001];
class Solution {
public:
// Function to detect cycle in an undirected graph.
bool dfs(int node, int parent, vector<int> adj[]) {
vis[node] = true;
for (auto ele : adj[node]) {
... | ALGO | 0.999926 | 5.995798 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-03-07T20:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0ef7d057acc... |
8ba690d5-b0a0-40fe-85c7-132e0e23a076 | tbielak/AoC_cpp | sources/2015/2015_07.cpp | #include "2015_07.h"
namespace Day07_2015
{
Argument::Argument()
: immediate(true), value(0)
{
}
Argument::Argument(const string& s)
{
if (s[0] >= '0' && s[0] <= '9')
{
immediate = true;
value = (word)stoi(s);
}
else
{
immediate = false;
identifier = s;
value = 0;
}
}
Instruction::... | ALGO | 0.99225 | 5.086381 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2021-01-29T23:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c07c0e24... |
d3459a02-6833-4c35-a2c1-3acdad952919 | SamedAli/KMeans | src/main.cpp | #include "kmeansFunctions.h"
#include <chrono>
#include <filesystem>
#include <iostream>
auto kmeansIteration(const std::uint16_t nofIterations, const std::vector<std::vector<double>> &datapoints, std::vector<std::vector<double>> ¢roids, std::vector<std::uint16_t> &clusters) -> void
{
auto start = std::chrono::h... | ALGO | 0.999035 | 6.126844 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-04-04T19:47: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": "f5028fc50a... |
6c0dec3f-3c18-4b6d-9835-5bb892f91a90 | andy-yuanchang/Crowd_Simulation | crowdSimulation/environment_bvh.cpp | //
// Instructor: <NAME>
// Email: <EMAIL>
// <EMAIL>
//
// Date: 2014/12/10
//
#include <iostream>
#include <cmath>
#include <map>
#include <string>
#include "environment.h"
#include "./cs_parameters.h"
using namespace std;
void computeAABB(
vector3 &AABBmin,
vector3 &AABBmax,
const vector<CS_ENV_OBJECT*> &ob... | ALGO | 0.999505 | 4.858561 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-02-08T08:39:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5f7a854a... |
c668877c-b8c9-4bc6-84c0-ed5a4b93faf8 | jurijkos/racunalna-grafika | lab1/src/Trajectory.h | #pragma once
#include <vector>
#include "Vertex3D.h"
#include <glm/mat4x4.hpp>
class Trajectory {
public:
std::vector<Vertex3D> R;
glm::mat4x4 B;
glm::mat4x3 BDerivative;
glm::vec3 position;
std::vector<glm::vec3> pointsOnPath;
Trajectory(std::string filePath) {
//this->B = glm::mat4x4(-1, 3, -3, 1, 3, -6, ... | TOOL | 0.978154 | 3.735909 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-02T10:09: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": "bce66a3968... |
b9645691-6623-4911-b4de-caf48213ccf2 | sunefred/Gravity3D | LibMem/Include/MemGlobals.h | //==============================================================================
//
// Mixed math functions
//
//==============================================================================
#ifndef MEM_GLOBALS_H
#define MEM_GLOBALS_H
//== INCLUDES =================================================================... | TOOL | 0.992215 | 3.909752 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-01-01T21:31: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": "779414591f... |
002cf470-f087-4181-8ec4-de822f325050 | gaurav1Nn/leetcode-question | 2707-merge-two-2d-arrays-by-summing-values/2707-merge-two-2d-arrays-by-summing-values.cpp | class Solution {
public:
vector<vector<int>> mergeArrays(vector<vector<int>>& nums1, vector<vector<int>>& nums2) {
// Initialize pointers for both arrays
int i = 0, j = 0;
vector<vector<int>> result;
// Traverse both arrays with two pointers
while (i < nums1.size() &... | ALGO | 0.999949 | 6.22833 | {
"github_metadata": {
"branch": "main",
"commit_count": 2409,
"repo_created_at": "2024-09-30T07:08:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc45eabfd... |
1a2f4194-ed84-4691-b913-3171670ec2d7 | prempal-77/Assignment_25 | Assignment_25/question_10.cpp | /*Define a class Area and define instance member functions to find the area of the
different shapes like square, rectangle , circle etc.*/
#include <iostream>
#include <cmath>
using namespace std;
class Area {
public:
// Constructor
Area() {}
// Find area of a square function
double FindSquareArea(do... | TOOL | 0.992038 | 6.094708 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-18T06:03: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": "02e6ef472cc9... |
fd51c194-8825-4d4d-a37c-4cee2d7946c0 | ksercs/school_olympiads | 2017-2018/Открытая/B/B.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <string.h>
#define SZ size()
#define VEC vector
#define PB push_back
#define MP make_pair
#de... | ALGO | 0.999991 | 3.639976 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T13:25: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": "66b976df6a... |
9a0af9a1-8b7e-45a4-927d-a725a16fdd71 | Piyush289kumar/DSA | TCS/PYQ/SRIT SHEET/Q4.cpp | /* Q4: Problem Statement – Airport security officials have confiscated several item of the passengers at the security
check point. All the items have been dumped into a huge box (array). Each item possesses a certain amount
of risk[0,1,2]. Here, the risk severity of the items represent an array[] of N number of integer... | ALGO | 0.999985 | 5.091736 | {
"github_metadata": {
"branch": "main",
"commit_count": 553,
"repo_created_at": "2024-01-16T13:27:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22ed2c9c46... |
f77b93f9-4a56-468b-b8cd-856b61ed3995 | AravindXD/VIT-DAA | LPS-3/q5/q5.cpp | #include <iostream>
#include <climits>
using namespace std;
struct Result {
int startIdx, endIdx, sum, length;
};
Result calculateCrossSum(int arr[], int low, int mid, int high) {
int maxLeftSum = INT_MIN;
int currentLeftSum = 0;
int leftEndIdx = mid;
int leftStartIdx = mid;
int leftLength = 0... | ALGO | 0.999967 | 5.230904 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-18T03:35: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": "7ee99e333721... |
47a82d8b-c4e9-428d-a79c-196256c192f0 | MatthewZGong/CFTrainingArc | CF/C2000s/C2030/D.cpp | #include<bits/stdc++.h>
#include <memory>
#include <utility>
#include <vector>
// g++-14 -o main [file].cpp;
//./main < input.txt > output.txt
using namespace std;
#pragma region
#define ll long long
ll inv_mod_prime(ll a, ll MOD) {
return a <= 1 ? a : MOD - (MOD/a) * inv_mod_prime(MOD % a, MOD) % MOD;
}
// count n... | ALGO | 0.999939 | 4.994218 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-06-03T22:59: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": "ab99ed9146d9... |
22ac2f50-ebf0-4c76-91c4-ff9c391ad079 | brobat6/competitive | Lazy/Codeforces/1692/1692G.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--) {
int n, k;
cin >> n >> k;
vector <int> v(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
... | ALGO | 0.999902 | 3.947227 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-08-31T19:59:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "98ed2c803b6... |
94ebbf84-6786-4b36-8d2e-c7643817c6e3 | Avni-garg22/Python_PEP | array/linear search array/intersectionOfArray.cpp | /*
#include<iostream>
#include<limits.h>
using namespace std;
void intersectionArr(int arr[],int brr[],int n, int m){
for(int j=0;j<m;j++){
{ for(int i=0;i<n;i++)
if(arr[i]==brr[j]){
cout<<arr[i];
arr[i]=INT_MIN;
break;
}
... | ALGO | 0.999872 | 4.55508 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-02T06:56: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": "2c3a6a7c0d74... |
97e56252-bc3c-44e5-9c48-847826149443 | physicisto/CPPlabs | Лабораторная 5/5.3.1/5.3.1/main.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include "Book.h"
using namespace std;
class BookSorter {
int n;
public:
BookSorter(int n) :n(n) {};
bool operator()(Book* b1, Book* b2) {
if (n == 1)
return b1->getName() < b2->getName();
else
return b1->getAuthor() < b2->getAuthor... | ALGO | 0.998653 | 4.120604 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-02-01T20:16:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74800fde58... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.