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 |
|---|---|---|---|---|---|---|---|
73abd226-7b65-4588-b5d9-b4321a4163eb | ankitadhakad/DSA_450 | array/27.trappingRainWater.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
// approach 1 Brute Force O(N^2)
int trappingRainWaterI(int arr[], int n)
{
int ans = 0;
for (int i = 1; i < n; i++)
{
int left = arr[i];
for (int j = 0; j < i; j++)
{
left = max(arr[j], left);
}
... | ALGO | 0.999968 | 6.010881 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-01-24T14:08:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "264963d2af1... |
67c865fd-330f-4581-9e33-c88c8f13235d | AceRog1/leetcode | 71/main.cpp | //
// Created by acerog on 18/08/24.
//
#include <iostream>
#include <string>
#include <stack>
using namespace std;
class Solution {
public:
string simplifyPath(string path) {
string cd = "CD", ud = "UD", p, dotsList;
string resultPath;
stack<string> stk;
size_t dots = 0;
... | ALGO | 0.99957 | 5.797194 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-07-08T06:01: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": "f8b67c0eb58... |
2bf9d7ff-a864-45b3-9ad9-af17e9219542 | dhirumaurya2008/programming-problems | sdesheet/SetMatrixZero.cpp | #include<bits/stdc++.h>
using namespace std;
void setZeroes(vector<vector<int> > &A) {
// Do not write main() function.
// Do not read input, instead use the arguments to the function.
// Do not print the output, instead return values as specified
// Still have a doubt. Checkout www.interviewbit.com/pa... | ALGO | 0.999817 | 4.016289 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-10T07:43: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": "a06eed1f4c3e... |
cb72569a-23b2-4680-8fd0-9d9988e6941a | pratikp2/Turing_Tasks | Task-524571/Turn3-ModelA.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
class FeedbackRecorder {
public:
void recordLoopIteration(int loopIndex) {
loopCounts[loopIndex]++;
}
const std::unordered_map<int, int>& getLoopCounts() const {
return loopCounts;
}
void reset() {... | ALGO | 0.997103 | 7.587834 | {
"github_metadata": {
"branch": "main",
"commit_count": 257,
"repo_created_at": "2024-09-24T16:12: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": "a63d623e87... |
69bbfcd1-9e75-4d34-ab52-7eae8f5a67c7 | sony-string/beakjoon | Beakjoon/10999-getSumInRange2.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <assert.h>
using namespace std;
typedef long long li;
typedef pair<int, int> Query;
typedef vector<li> vi;
typedef struct SegTreeNode {
int lbound, rbound;
li sum;
li lazy;
SegTreeNode() {
lbound = 0;
rb... | ALGO | 0.999904 | 4.990596 | {
"github_metadata": {
"branch": "master",
"commit_count": 284,
"repo_created_at": "2023-03-28T10:33: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": "5817d65a... |
4f1b5ac1-7192-4502-942a-75c02105de91 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0513/personal_submission/cf799c_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN 100
using namespace std;
typedef pair<int, int> pii;
int gao(vector<pii> &vec, int X) {
int n = vec.size();
int ret = 0;
multiset<pii> ms;
for (int i = n - 1, j = 0; i >= 0; i--) {
while (j < i && vec[i].first + vec[j].first <= X) {
ms.insert(pi... | ALGO | 0.999677 | 3.935297 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "edee... |
ddf17178-075a-4d1b-8c67-53cafd66f0e1 | codgician/competitive-programming | HDUOJ/3555/dfs_dp.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <climits>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <functional>
#include <iterator>
#define SIZE 25
using namespace std;
long lo... | ALGO | 0.999504 | 3.569563 | {
"github_metadata": {
"branch": "master",
"commit_count": 1251,
"repo_created_at": "2017-09-19T02:44:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dc8595... |
d77a12f1-420d-4a78-9f9d-bff96fc4a472 | LAIRLAB/qr_trees | src/utils/math_utils_temp.hh | #pragma once
#include <utils/debug_utils.hh>
#include <Eigen/Eigenvalues>
namespace math
{
constexpr double DEFAULT_STEP_SIZE = 0.0009765625;
template<int _rows, int _cols>
using Matrix = Eigen::Matrix<double, _rows, _cols>;
template<int _rows>
using Vector = Eigen::Matrix<double, _rows, 1>;
template<int _rows,... | ALGO | 0.999266 | 6.509547 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2016-10-20T19:31:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2292fe5... |
53661781-808f-40d0-81ad-7bb6c2f64178 | anidub/CPP | GrokkingCodingInterview/TwoPointers/SquaringSortedArray.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
using namespace std;
/*https://www.educative.io/courses/grokking-the-coding-interview/R1ppNG3nV9R
* Given a sorted array, create a new... | ALGO | 0.999828 | 5.902196 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-10-25T04:13: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": "dfd65d0a3... |
90126ecc-f734-4920-bb41-3e4a2a256fcd | ikr/algo-practice | leetcode/2020/Distinct_Subsequences/solution.cpp | template <typename T> constexpr int intof(const T x) { return static_cast<int>(x); }
using ll = long long;
struct Solution final {
int numDistinct(const string &s, const string &t) const {
if (t.empty()) return 1;
const int ssz = s.size();
const int tsz = t.size();
if (ssz < tsz) re... | ALGO | 0.999992 | 6.155759 | {
"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": "cc7b8a4... |
6182e928-77e5-435d-b785-157334c75215 | Jasleen8801/Design-and-Analysis-of-Algorithms | Lab Assignment 1/4a.cpp | // WAP to implement Merging of two arrays containing sorted data
#include <bits/stdc++.h>
using namespace std;
void mergeArrays(int arr1[], int n1, int arr2[], int n2, int res[]){
int i=0, j=0, k=0;
while(i<n1 && j<n2){
if(arr1[i] <= arr2[j]) res[k++] = arr1[i++];
else res[k++] = arr2[j++];
... | ALGO | 0.999955 | 5.375094 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-08-01T16:13: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": "eebe1571780... |
e3ddf04f-2841-41b7-8cb5-07d8518c0bde | sylvainthery/ASTex | Algo/BLTS/hv/hvVec3.h | /*******************************************************************************
* ASTex: *
* Copyright (C) IGG Group, ICube, University of Strasbourg, France *
* ... | TOOL | 0.92107 | 6.541898 | {
"github_metadata": {
"branch": "sylvain",
"commit_count": 200,
"repo_created_at": "2017-10-23T08:43:45.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "ASTex-ICube/ASTex",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
5a630712-d221-4293-a158-b020b5054431 | CatalinFetoiu/Competitive-Programming | uva11747.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#include <limits.h>
#include <list>
#include <queue>
#include <map>
using namespace std;
typedef pair<int, int> ii;
#define TRvi(c, it) \
for(vector<int>::iterator it = c.begin(); it ... | ALGO | 0.999889 | 4.3261 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-09T17:01: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": "f5dd367085... |
e689cb58-72d7-4f95-8428-7c005d9f9e15 | vikashkumr/Competitive-Programming | leetcode/1011. Capacity To Ship Packages Within D Days.cpp | class Solution {
public:
int shipWithinDays(vector<int>& weights, int D) {
int sum = accumulate(weights.begin(),weights.end(),0);
int l = 0, r = sum;
int ans = 0;
while(l <= r) {
int mid = (l + r) / 2;
int tmp_d = 1;
int l_sum = 0;
... | ALGO | 0.999987 | 5.938925 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-09-02T06:54:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6761b6b1... |
3d267dd9-e2ba-48fb-ae08-7d67695286ad | winwu1224/blackjack_calculator | blackjack_calculator/blackjack_calculator/Strategy.cpp | // Strategy.cpp
#include "Strategy.hpp"
#include <unordered_map>
#include <iostream>
std::string Strategy::BasicStrategy(Card player_card1, Card player_card2, Card dealer_card) {
int player_sum = 0;
bool has_ace = false;
bool is_pair = false;
if (player_card1.GetValue() == 'A' || player_card2.GetValue... | ALGO | 0.982893 | 6.907535 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-29T05:12: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": "2a16900d4c7e... |
4cd75992-1eea-4c2d-9624-73ccf536b400 | hs227/hs_resnet | resnet50/myResnet50/ops/fc.cpp | #include"fc.h"
//int mainfc11(void)
//{
// vector<vector<int>> data1 = {
// {1,2,3},
// {4,5,6},
// {7,8,9},
// {10,11,12}
// };
// printMat2D(data1);
// vector<vector<int>> data2 = mat2DTranspose(data1);
// printMat2D(data2);
//
// vector<vector<int>> data5 = mat2DMul(data1, data2);
// printMat2D(... | ALGO | 0.958522 | 3.317068 | {
"github_metadata": {
"branch": "mai",
"commit_count": 1,
"repo_created_at": "2024-03-01T12:06: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": "d3800493c61b0... |
9a2fa9d4-94bc-4420-8cde-82240d6bcec4 | Dutongxue/LintCode | Greedy/P187.cpp | //
// Created by enheng on 18-7-1.
//
#include "P187.h"
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
/**
* 加油站
* @param gas: An array of integers
* @param cost: An array of integers
* @return: An integer
*/
int canCompleteCircuit(vector<int> &g... | ALGO | 0.999943 | 5.041993 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-05-28T14:20: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": "66a18cd43... |
f4fb9c85-7151-4e0e-84a2-c6dc192609e4 | jonona/beginning-cpp | Sec20/Vector/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
class Person {
friend std::ostream &operator<<(std::ostream &os, const Person &p);
std::string name;
int age;
public:
Person() = default;
Person(std::string name, int age)
: name{name}, age{age} {}
bool operator<(const Person &r... | TOOL | 0.989417 | 5.300535 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-08-21T21:09: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": "61cd8cfae... |
aca508a9-8f69-425a-9e4c-a1fbca2af380 | Werewolflsp/LeetCode | valid_palindrome.cpp | /**************************************
Given a string, determine if it is a palindrome, considering only alphanumeric
characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
Note:
Have you consider that the string might be empty? This is a good... | ALGO | 0.993122 | 5.844725 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-08-15T01:42: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": "f53f3b0f8... |
761a933c-0e5f-4e63-b80f-8ea01e978f62 | GoodLadJeff/VoyageurMan | main.cpp | #include <vector>
#include <iostream>
#include "City.h"
#include "Road.h"
#include "Traveler.h"
using namespace std;
int main()
{
const int CITY_NUMBER = 5;
const int MAX = 1000000;
Road road0 = Road(0);
Road road1 = Road(1);
Road road2 = Road(2);
Road road3 = Road(3);
Road roadMax = Road... | ALGO | 0.992596 | 4.305975 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-04T11:02: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": "cc920505c9ab... |
7f00fad6-1121-4dd8-b800-159f664d4066 | nosatmcc/Cai-dat-cay-nhi-phan-tim-kiem-cac-thao-tac-va-duyet-theo-thu-tu-truoc-NLR | students.cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
struct Student {
int id;
string name;
int birthYear;
float gpa;
};
struct Node {
Student data;
Node* left;
Node* right;
};
Node* createNode(Student s) {
Node* newNode = new Node;
newNode->data = s;
n... | TOOL | 0.933048 | 4.438322 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-12T16:02: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": "371494c6993b... |
aaceb727-0e9a-4aa7-ad7c-231e69f7a51b | Geetanshi-jain/DSAGeet | Queue/pqueue.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 100; // Renamed to avoid conflict with std::max
struct item {
int data;
int p_no;
};
class Pqueue {
item p[MAX_SIZE];
int f, r;
public:
Pqueue(); // Constructor
void add_item(int, int); // Add an item wit... | ALGO | 0.999924 | 5.776517 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-06-30T16:46: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": "1b5d7137a96... |
0759afe7-153d-4968-9465-589c42303864 | issunsun1/codefor851 | Practice/Operation Of Sort/HeapSort_min.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
using namespace std;
const int N = 100010;
int h[N], size;
void down(vector<int> &a, int start, int end)
{
// 计算父结点和子结点的下标
int parent = start;
int child = parent * 2 + 1;
while (child <= end)... | ALGO | 0.99997 | 4.203408 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-06-08T12:29: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": "471c227a7c... |
c891c385-5e41-4dc0-9ec7-fd0573dc9b4f | devraghav14/DSA | AdditionalTopics/Hashmaps & Tries/SearchInTrie.cpp | #include <iostream>
#include <string>
using namespace std;
class TrieNode
{
public:
char data;
TrieNode *children[26];
bool isTerminal;
TrieNode(char d)
{
this->data = d;
for (int i = 0; i < 26; i++)
{
children[i] = nullptr;
}
this->isTerminal =... | ALGO | 0.999912 | 5.459712 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2025-02-18T05:32: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": "08873ee70c... |
a7f56ce2-ec39-4a5d-a555-902cde4a32aa | njk464/Codeforces | map.c++ | #include <iostream>
#include <string>
#include <stack>
void block_dfs(int x, int y);
char *map;
int m, n, rem;
int main()
{
int x, y, open = 0;
std::cin >> m >> n >> rem;
map = new char[m * n];
int i = 0;
for (i; i < m; i++)
{
int k = 0;
std::string s;
std::cin >> s;
for (k; k < n; k++)
{
map[i * n... | ALGO | 0.999735 | 3.302482 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-09-21T14:40:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79533cffe... |
343a979d-f67f-4d83-be47-56ecfdc45596 | GradientExplode/Ginkgo | deep-nuclei/src/library/gkg-deep-nuclei-midsagittalsurface/MidSagittalSurface_i.h | #ifndef _gkg_deep_nuclei_midsagittalsurface_MidSagittalSurface_i_h_
#define _gkg_deep_nuclei_midsagittalsurface_MidSagittalSurface_i_h_
#include <gkg-deep-nuclei-midsagittalsurface/MidSagittalSurface.h>
#include <gkg-deep-nuclei-midsagittalsurface/MidSagittalSurfaceContext2d_i.h>
#include <gkg-deep-nuclei-midsagittal... | ALGO | 0.948148 | 6.40394 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-12-04T02:39:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31dd3028f415... |
5a8464f4-e938-44d6-a7e4-537f24955686 | zerodawn1802/VS | MP/Spoj154.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char x[100005];
int a[100005], b[100005], n, i, dem = 0;
cin >> x + 1;
n = strlen(x + 1);
a[0] = 0;
for(i = 1; i <= n; i++)
{
int k;
if(x[i] == '(') k = 1;
else k = -1;
a[i] = a[i - 1] + k;
}
if(a[n] != 2 && a[n] != -2)
{
cout << "0";
retur... | ALGO | 0.999891 | 3.346187 | {
"github_metadata": {
"branch": "GitTest",
"commit_count": 39,
"repo_created_at": "2020-10-25T09:31:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d815408e... |
457c366a-ec80-4250-b8b3-6b0a669c3451 | Gidaich/RA_project_kcycle | section5.cpp | #include <bits/stdc++.h>
#include "graph.hpp"
using namespace std;
void randomly_color(map<int,int>& coloring, int k, int V){
for(int i = 0 ; i < V ; i++){
coloring[i] = rand()%k;
}
}
void acyclic_ordering(vector<int>& a_order, int V, Graph G) {
vector<int> degree(V, 0);
vector<vector<int>> b... | ALGO | 0.999867 | 5.387164 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-06T14:57: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": "e9bec2096040... |
48edc298-de3a-44d4-b551-dfe92c601613 | Connoisseur01/Graph-algorithms | src/Kruskal.cpp | #include "Kruskal.hpp"
#include "List.hpp"
#include <iostream>
Kruskal::Kruskal(int verticies){
this->verticies = verticies;
parent = new int[verticies];
rank = new int[verticies];
}
void Kruskal::make_set(int v){
parent[v] = v;
rank[v] = 0;
}
int Kruskal::find_set(int v){
if (v == parent[v])... | ALGO | 0.999603 | 5.388341 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2022-05-15T12:16:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39fc867fe... |
4b256182-24c2-494d-a5a6-357c602704f7 | soroush-tabesh/Competitive-Programming | CS-Academy/55/C.cpp | //In The Name of Allah
//Wed 10/8/96
#include <bits/stdc++.h>
#define Init ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define forar(i,n) for(long long int i = 0; i < n;i++)
#define fori(i,a,b) for(long long int i = a; i < b;i++)
#define WFile freopen("test.in","r",stdin),freopen("test.out","w",stdout)
#define... | ALGO | 0.999964 | 3.914301 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2017-10-13T16:34:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d665adf8... |
49a52bda-e2dc-4d97-ab03-8f23eb8bad70 | tksuoran/erhe | src/mango/source/mango/core/sha1.cpp | /*
MANGO Multimedia Development Platform
Copyright (C) 2012-2019 Twilight Finland 3D Oy Ltd. All rights reserved.
*/
#include <mango/core/hash.hpp>
#include <mango/core/exception.hpp>
#include <mango/core/bits.hpp>
#include <mango/core/endian.hpp>
#include <mango/core/cpuinfo.hpp>
namespace
{
using namespa... | ALGO | 0.986801 | 7.003022 | {
"github_metadata": {
"branch": "main",
"commit_count": 743,
"repo_created_at": "2021-05-01T13:29:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 744,
"forks": 73,
"issues": 36,
"pull_requests": 0
},
"file_meta": {
"content_id": "6efac5... |
c458e092-de80-4081-a073-5bbd8215fb5f | kidw0124/PS | 백준/Gold/16402. 제국/제국.cc | #include<bits/stdc++.h>
using namespace std;
#ifdef ATCODER
#include<atcoder/all>
using namespace atcoder;
#endif
using ll = long long;
using pll = pair<ll,ll>;
using tlll = tuple<ll,ll,ll>;
using ld = long double;
using pld = pair<ld,ld>;
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
#pra... | ALGO | 0.99999 | 4.364864 | {
"github_metadata": {
"branch": "main",
"commit_count": 1036,
"repo_created_at": "2022-07-01T13:48:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c8efdecc... |
9ce8a1b2-e253-4364-8667-ac10eef0dfa7 | ShammiAnand/cp-problemset | CF-1397D.cpp | //This code is written by <NAME>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define mod 1000000007
#define INF 1e9+7
#define nl ... | ALGO | 0.999929 | 3.681073 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-07-13T12:28:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c431961b6... |
cb1c824c-52d9-4a77-bf6f-ad196084d097 | lucaslgn/exame-ces11 | src/graphList.hpp | #pragma once
#include <vector>
#include <stack>
#include <algorithm>
#include <stdexcept>
#include <queue>
#include <limits>
// Lista de adjacências
// Sem arestas múltiplas
// Com peso nas arestas (por padrão é 1)
struct Edge {
std::size_t destination;
double weight;
};
class Graph {
public:
Graph();
... | ALGO | 0.992782 | 6.159991 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2022-09-03T14:35: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": "a0a8a952ba3... |
34c748d0-e28b-429a-9b13-4a73db974359 | fuchaili/CPP | algorithm/stringMatchKMP.cpp | #include <iostream>
using namespace std;
const int N = 100010, M = 10010; //N为主串长度,M模式串长度
int n, m;
int nex[M]; //next[]数组,避免和头文件next冲突
char s[N], p[M]; //s为主串, p为模式串
int main(){
cin >> n >> (s+1)>> m >>(p+1); //下标从1开始,n是s主串实际长度,m是p模式串实际长度
//求next[]数组
for(int i = 2, j = 0; i <= m; i++){
while... | ALGO | 0.999988 | 3.705728 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-15T01:32: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": "7bc6f37f7795... |
00e75f92-74d1-427a-bedc-cde80c41e2f1 | Nguyennhatthanh46/Thuc-hanh-cau-truc-tuan-6 | Bai 10.02.cpp | #include <iostream>
using namespace std;
struct PhanSo{
int tuso;
int mauso;
};
void Nhap(PhanSo &a){
cin>>a.tuso>>a.mauso;
if (a.mauso < 0) {
a.mauso = -a.mauso;
a.tuso= -a.tuso;
}
}
PhanSo Nhap(){
PhanSo b;
cin>>b.tuso>>b.mauso;
if (b.mauso < 0) {
b.mauso = -b.mauso;
b.tuso= -b.tu... | ALGO | 0.999945 | 4.629475 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-12-30T05:00: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": "ad3f5ca301f... |
734cdea8-4aa4-42b1-82f5-d2cbe250cd44 | Tianpangp/Things-locating | main.cpp | void _Rec()
{
imwrite("f:\\imgCanny.jpg",imgCanny);
imgROIs.clear();
imgROICannys.clear();
points.clear();
Mat imgCannyNew;
imgCanny.copyTo(imgCannyNew);
//将新的图复制到img,不使用imgOri
//copy new image to img in order to not using imgOri
Mat img;
imgOri.copyTo(img);
vector<vector<P... | ALGO | 0.989398 | 3.346029 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-07-04T03:10: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": "f8356efb23... |
2a8b321c-2031-4fb2-a8eb-8c152c4135a7 | ypd01018/Algorithm | BOJ/1039_notmine.cpp | #include<iostream>
#include<algorithm>
#include<queue>
#include<string>
#include<set>
#include<vector>
#define endl "\n"
#define MAX 1000000 + 1
using namespace std;
string Inp;
int K, M;
vector<int> Answer;
int Invert(string S)
{
int Sum = 0;
for (int i = 0; i < S.length(); i++)
{
Sum = Sum +... | ALGO | 0.999977 | 3.845432 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-12-27T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d33478a24... |
dd8b28c2-90c7-4fbc-99e3-186ba7250a9d | PaddlePaddle/Paddle | paddle/phi/kernels/funcs/scatter.cu.h | /* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
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... | TOOL | 0.990994 | 7.207887 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
ae89153d-2a86-4481-aa12-deda769b2e03 | loypt/games101-homework | Assignment2/Rasterizer/rasterizer.cpp | //
// Created by <NAME> on 7/17/22.
//
#include "rasterizer.h"
#include <algorithm>
#include <vector>
#include <opencv2/opencv.hpp>
#include <math.h>
rst::pos_buf_id rst::rasterizer::load_positions(const std::vector<Eigen::Vector3f> &positions)
{
auto id = get_next_id();
pos_buf.emplace(id, positions);
... | ALGO | 0.924689 | 5.94345 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-07-16T03:39:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f3323f68bed... |
87ea618a-480d-453d-8d55-1c7371ad7cc6 | intrinsicD/Engine25 | Core/Frameworks/Geometry/GraphBellmanFord.h | //
// Created by alex on 2/11/25.
//
#ifndef GRAPHBELLMANFORD_H
#define GRAPHBELLMANFORD_H
#include "Graph.h"
namespace Bcg {
/**
* @brief BellmanFord: Computes shortest paths from a source (or multiple sources)
* for graphs with possibly negative edge weights.
*/
class BellmanFord {
publi... | ALGO | 0.999925 | 7.403691 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-12-05T12:59: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": "78a1db25962... |
94eae7ba-33d1-45f3-83a7-9a18a23beb3d | Rrrinav/Raylib | game-of-life/Simulation.cpp | #include "Simulation.hpp"
#include <raylib.h>
#include <utility>
#include <vector>
void gol::Draw() { grid.Draw(); }
void gol::set_cell_value(int row, int col, int val) {
grid.set_value(row, col, val);
};
int gol::count_live_neighbours(int row, int col) {
std::vector<std::pair<int, int>> neighbour_offset = {
... | ALGO | 0.951146 | 4.95558 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-09-01T15:42: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": "8640f997d372... |
56878bf1-f5c0-4c8b-a605-dfa59511bef8 | Riverside-City-College-Computer-Science/Summer14_CSC5_46023 | dc2449175/HW/Assignment 3/Gaddis_7th_CH4_HW#7/main.cpp | /*
* File: main.cpp
* Author: <NAME>
*
* Created on July 7, 2014, 8:44 PM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
//inputs
int secs;
cout << "Enter how many seconds" << endl;
cin >> secs;
if(secs >= 60 && secs < 360... | TOOL | 0.928221 | 3.839921 | {
"github_metadata": {
"branch": "master",
"commit_count": 486,
"repo_created_at": "2014-06-23T19:38:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2f2faf67... |
12401f45-e857-47d2-8537-e21e65780864 | raincross7/code-similarity | codes/train_code/problem293/problem293_492.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> P;
LL H, W, N, a, b, ans[10];
map<P, bool> mp1, mp2;
int main()
{
cin >> H >> W >> N;
ans[0] = (H - 2) * (W - 2);
for (int i = 0; i < N; i++) {
cin >> a >> b;
a--, b--;
mp2[P(a, b)] = true;
for (int j = 0; j < 3; j++)
... | ALGO | 0.999956 | 3.32444 | {
"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": "bf0c96b44ca2... |
aceeb6bd-e2df-4386-b9e6-7246f199bbf1 | integral96/garbage_on_theme_numerical_metod | Jacobian.hpp | #pragma once
#include <boost/math/differentiation/autodiff.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptor/strided.hpp>
#include "base_func.hpp"
namespace diff = boost::math::differentiation;
template <typename X, typename Y>
struct diff_polynom {
template<size_t J>
struct iner {... | ALGO | 0.991541 | 6.031254 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-21T10:43: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": "fa29636a58cb... |
5fa1cdb2-4be1-499a-a994-58f72c9ea03e | minhajadil/Competitive-Programming-Journey | CodeForces/C++17 (GCC 7-32)/1754A | Technical Support/177551492.cpp | // Problem: A. Technical Support
// Contest: Codeforces - Codeforces Round #829 (Div. 2)
// May the provider keep us content
#include<bits/stdc++.h>
using namespace std ;
int main()
{
int t ;
cin >> t ;
while(t--)
{
int n ;
cin >> n ;
string a ;
cin >> a ;
stack<char> q ;
for(int i =0 ;i<... | ALGO | 0.984132 | 4.002907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1155,
"repo_created_at": "2024-03-09T11:34: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": "964d89d20... |
8a2b6578-b7f2-4b7d-8641-3f00f9e20770 | SonhadorKL/CppProjects | Geometry/src/Polygons.cpp | #include "Polygons.h"
#include "General.h"
#include "Ellipse.h"
#include "Primitives.h"
#include <cmath>
//////////////////////////////// POLYGON ////////////////////////////////
Polygon::Polygon(const std::vector<Point>& points) : vertices_(points) {}
double Polygon::perimeter() const {
double perimeter = 0;
f... | ALGO | 0.984638 | 6.413175 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-06T16:24: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": "5d362efdb31e... |
b1ee03a9-0eb1-4591-95b5-3f6fe25c13b1 | alexandraback/datacollection | solutions_5695413893988352_1/C++/Shulik/B.cpp | #include <bits/stdc++.h>
#include <iomanip>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int ab(int x){
return x < 0 ? -x : x;
}
ll abl(ll x){
return x > 0 ? x : -x;
}
ll to_ll(string s, bool mx, int i = 0, ll ret = 0){
for(; i < s.size(); i++){
char x = s[i];
if(... | ALGO | 0.999983 | 3.924123 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8973da2e4... |
09abaf53-3f3d-4c53-9a99-b3ea8843f460 | Dr-DFTD3/analyze_poscars | neighbors.h | #ifndef _NEIGHS_H_
#define _NEIGHS_H_
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include "common.h"
#include "mymath.h"
/*----------------------------------------------... | ALGO | 0.998749 | 4.29361 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-20T21:00:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab0145171711... |
58b7dc0a-c2b5-4bee-ae67-a4e8a7148777 | risuicpc/competitive-problem-solutions | kattis/Esej.cpp | #include <bits/stdc++.h>
using namespace std;
int an = 0, a, b;
void printcomb(char n, int k, vector<char> &v, char i)
{
if (k == 0)
{
return;
}
if (i > n)
return;
v.push_back(i);
for (char i : v)
cout << i;
cout << " ";
an++;
if (an == b)
exit(0);
... | ALGO | 0.999417 | 3.54712 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-07-30T06:50: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": "95ec0e7a89d... |
dddcbd7f-bbe0-4d5f-ad15-aa786f3e90ac | ishandutta2007/codeforces-o | oleh1421/normal/1661/E.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
mt19937 rnd(time(NULL));
#define endl '\n'
typedef long long ll;
typedef long double ld;
const int N=600010;
struct node{
int cnt;
int a[3];
int b[3];
node(){
cnt=0;
a[0]=a[... | ALGO | 0.999842 | 4.747048 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45: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": "1ecf16a88e06... |
2755c492-ad9b-4ae3-849e-667dc1a35d16 | simongog/sdsl-lite | include/sdsl/construct_bwt.hpp | /* sdsl - succinct data structures library
Copyright (C) 2010 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later... | ALGO | 0.947329 | 6.59468 | {
"github_metadata": {
"branch": "master",
"commit_count": 1969,
"repo_created_at": "2013-02-28T22:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2269,
"forks": 354,
"issues": 71,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
55bac6c4-90ae-4d85-9f4e-6be0ac27f669 | ishandutta2007/codeforces-a | angusritossa/normal/245/H.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define MAXN 5010
char s[MAXN];
bool is_palindrome[MAXN][MAXN];
int dp[MAXN][MAXN], N, Q;
int main() {
scanf(" %s", s+1); // str+1 1-indexes the string
N = strlen(s+1);
// Calculate is_palindrome
// We need to process substrings in o... | ALGO | 0.999829 | 4.626507 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "5b2631c4cb3a... |
a86f55c6-f0e9-46f8-bbab-ddfe6cb9b1fc | rishabhpandey106/js | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-1... | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int c1 = 0;
int c2 = 0;
int elem1 = INT_MIN;
int elem2 = INT_MIN;
int bound = ceil(nums.size()/3);
vector<int> v;
for(int i=0;i<nums.size();i++)
{
if(c1 == 0 && nums[... | ALGO | 0.999998 | 5.692308 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2023-07-14T12:58: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": "bc967735ca... |
a2d2afa3-fd3f-468f-9451-d3673a277bb2 | brany66/CodeSummary | Algorithm/string/NestListWeightSum_2.cpp | //
// Created by BranY on 2016/8/29.
// Contact at <EMAIL>
// Copyright (c) 2016 NJU PASA Lab All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
/**
* Given a nested list of integers, return the sum of all integers in the list weighted by their depth.
* Each element is either an integ... | ALGO | 0.999494 | 5.064768 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2016-07-23T07:13: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": "9aeaf9f1... |
e19af88c-1c51-44ef-9c20-daf103048037 | morsalin80/Codeforces-and-atcoder | codeforces/466/C.cpp | /// <NAME>
/* Author: <NAME> (aka white_space)
Dept of ICE, NSTU
*/
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define f0(n) for(int i=0;i<n;i++)
#define ms(x) memset(x,0,sizeof(x))
#define ins insert
#define ALL(v) v.begin(),v.end()
#define highest(x) n... | ALGO | 0.99999 | 3.340265 | {
"github_metadata": {
"branch": "master",
"commit_count": 1334,
"repo_created_at": "2021-05-27T07:45: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": "f2e9f07... |
578c8e45-ecc9-4ee1-824a-4164450de0eb | Ant4g0n1st/problem-solving | UVa/929 - Number Maze/LinearDijkstra.cpp | #include <forward_list>
#include <iostream>
#include <limits>
#include <memory>
#include <vector>
#include <queue>
using std::numeric_limits;
using std::forward_list;
using std::unique_ptr;
using std::ios_base;
using std::vector;
using std::queue;
using std::cout;
using std::cin;
using std::max;
typedef forward_list<... | ALGO | 0.999953 | 4.335083 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2018-01-22T01:30:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f193cb7... |
bf9991e6-b640-407c-8dc5-e475eabce168 | HughLocke/ACM-template | 数据结构/LCT.cpp | //link cut tree (LCT)
/* lct的性质
1.lct是将一棵树分为若干的Splay
每一个Splay维护的是一条从上到下按在原树中深度严格递增的路径,且中序遍历Splay得到的每个点的深度序列严格递增。
2.每个节点包含且仅包含于一个Splay中
3.边分为实边和虚边,实边包含在Splay中,而虚边总是由一棵Splay指向另一个节点(指向该Splay中中序遍历最靠前的点在原树中的父亲)。因为性质2,当某点在原树中有多个儿子时,只能向其中一个儿子拉一条实链(只认一个儿子),而其它儿子是不能在这个Splay中的。那么为了保持树的形状,我们要让到其它儿子的边变为虚边,由对应儿子所属的S... | ALGO | 0.999929 | 4.331902 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-11T06:27:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86b047899... |
676b585c-8f93-42de-86a7-061e561f388a | notepad-plus-plus/notepad-plus-plus | PowerEditor/src/MISC/Common/Sorters.h | // This file is part of Notepad++ project
// Copyright (C)2021 <NAME> <<EMAIL>>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option any late... | TOOL | 0.998759 | 6.840055 | {
"github_metadata": {
"branch": "master",
"commit_count": 6479,
"repo_created_at": "2015-03-28T00:05:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25163,
"forks": 4882,
"issues": 2664,
"pull_requests": 10
},
"file_meta": {
"content_id"... |
506cac87-12a9-4747-9423-4d1ca0705b23 | dubeyji0110/DAA-Lab-Assignments | Week11/Program3.cpp | #include<bits/stdc++.h>
using namespace std;
int memo(int i, int current, vector < vector <int> >& dp, vector <int>arr, int n) {
if (current == 0)
return 1;
if (current < 0)
return 0;
if (i == n)
return 0;
if (dp[i][current] != -1)
return dp[i][current];
return dp[i][... | ALGO | 0.999985 | 3.901707 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-11-10T10:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d46b931f23... |
1c59b7ed-f895-4f8f-8560-1494796cd67f | jshamsho/LFBayes | src/update_param.cpp | #include <RcppArmadillo.h>
#include <cmath>
#include <typeinfo>
#ifdef _OPENMP
#include <omp.h>
#endif
double gam_trunc_left(double a, double b, double cut);
void updateBeta(arma::cube &eta, arma::mat &H, arma::mat &E,
arma::mat &X, arma::mat &beta){
int q = eta.n_rows;
int qstar = eta.n_cols;
/... | ALGO | 0.999905 | 4.625683 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2018-11-14T20:50:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f074b9b3f... |
39b0dff1-e416-4ef5-aca0-c23111c628ff | LineageOS/android_bionic | linker/linker.cpp | /*
* Copyright (C) 2008 The Android Open Source Project
* 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, t... | TOOL | 0.936872 | 5.06785 | {
"github_metadata": {
"branch": "lineage-22.2",
"commit_count": 44898,
"repo_created_at": "2016-12-05T15:28:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 38,
"forks": 221,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id":... |
a132cfc4-4d33-4529-b90d-469278dbe695 | ehtesam75/LeetCode-Solutions | Binary Tree/199. Binary Tree Right Side View.cpp | //https://leetcode.com/problems/binary-tree-right-side-view/description/
//approch 1: dfs and map
//o(nlogn) time
//o(n) space
void solve(TreeNode* root, int hd, int level, map<int, pair<int, int>> &mp){
//map<level, (hd, value)>
if(root == NULL) return;
mp[level] = {hd, root->val}; //overwriting
... | ALGO | 0.999995 | 6.35026 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-12-30T15:23: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": "8220d245633... |
2db817bd-9c1d-40cc-967e-88416be9d5d8 | Andrenator/Workbench | Workbench/dice poker.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <math.h>
#include <string>
using namespace std;
#define DICENUM 6
#define TOTALCOMBOS pow(6,DICENUM)
struct numstring
{
int value;
string text;
void input(int a, string b)
{
value = a;
text = b;
}
};
void sortdice(int* myarray, int length)
{
i... | ALGO | 0.991833 | 3.666578 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2016-01-14T20:14: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": "d6be3ddef6b... |
a79a14b7-6da6-4a78-8ef6-aa9cce056f5c | hariom20singh/python-learning-codes | pairwise000006.cpp | #include <bits/stdc++.h>
using namespace std;
void maxProduct(int arr[], int n)
{
if (n < 2)
{
cout << "No pairs exists\n";
return;
}
int a = arr[0], b = arr[1];
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
if (arr[i] * arr[j] > a * ... | ALGO | 0.999714 | 4.754613 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2022-10-07T11:54:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 66,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "f3a53526... |
99811f2e-f367-4869-a3ed-4c3fa6ddb500 | nguyenhuudatcoder/cpp | Exam/quangnam9tinh24-25/cau4.cpp | /// Made by <NAME>
#include <iostream>
#include <climits>
#define ll long long
#define kien main
using namespace std;
const ll inf = LLONG_MAX;
const ll mod = 1e9 + 7;
int n;
ll a[1005][1005];
pair<ll, ll> s[1005][1005];
int m, x, y;
int getLine(int i, int j)
{
s[i][j].first = s[i][j - 1].first + a[i][j];
if (j... | ALGO | 0.999884 | 3.414152 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2025-01-08T14:32:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d1faa22f59... |
0b041a3a-fa17-4641-b1c7-14441949577a | A-Samad1206/cpp | DataStr/ABari/11LL/concise.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){
data = 0;
next = NULL;
}
Node(int x){
data = x;
next = NULL;
}
};
class List{
public:
Node *root,*last;
int length;
List(){
root=NULL;
length=0;
}
... | TOOL | 0.987479 | 3.522172 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-09-03T17:49: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": "3839143d7e... |
a34c6445-41c2-46e3-8d70-291b84674f16 | Pavzh1kV/5-279-02775-8 | GLAVA8/FORDSORT.CPP | /* **************************************************************** */
/* ТОПОЛОГИЧЕСКАЯ СОРТИРОВКА СЕТИ - МЕТОД ФОРДА. Граф ациклический */
/* Сеть представлена массивом вершин V[n] и двухмерным массивом дуг*/
/* GPO[k][2]. [36],c,125. \fordsort.cpp */
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
//#in... | ALGO | 0.99999 | 4.336074 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-08-28T10:10: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": "49575fb701... |
7a7fc7c8-baeb-455d-9816-280db0c8eb8b | MDalamin5/DS-With-Cpp | Week-8/Recape/Module-29/BFS BT/main.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int nodeID;
node *left;
node *right;
node *parent;
// int data;
node(int nodeID)
{
this->nodeID = nodeID;
this->left = NULL;
this->right = NULL;
this->parent = NULL;
}
};
class BinaryTree
{... | ALGO | 0.999484 | 4.219594 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2023-01-25T08:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "feaf31be94... |
787857da-f8c2-4140-8f79-3997568196f1 | mdarikrayhan/Competitive-Programming | codeforces/847/K.cpp | #include <iostream>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
typedef long long ll;
using namespace std;
int n, a, b, k, f;
typedef pair<string, string> pss;
vector<pss> edges;
pss get_norm(pss p) {
if(p.first < p.second) {
return p;
}... | ALGO | 0.999412 | 3.755593 | {
"github_metadata": {
"branch": "master",
"commit_count": 8052,
"repo_created_at": "2022-05-15T11:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "463b92... |
b713d6f4-b358-4c7a-a0de-0e9cc779d2ae | PADBarbosa/Tese | NVRTC/nbody.cpp | #include <nvrtc.h>
#include <cuda.h>
#include <math.h>
#include <iostream>
#include "Constants.h"
#define NVRTC_SAFE_CALL(x) \
do { \
nvrtcResult result = x; \
if (result ... | ALGO | 0.980728 | 4.301587 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2021-02-18T20:19: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": "4014e9967... |
eb611600-186b-40b7-aa68-148b05de169b | abhipray-cpu/cpp | Hashing/Hashing Functions/removingDuplicates/simple.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX_SIZE 1000
int test[MAX_SIZE];
int counter =0;
void initializeArr(int size)
{
for(int i=0;i<size;i++)
{
test[i] = rand();
}
}
void displayArray(int size)
{
for(int i=0;i<size;i++)
{
cout<<test[i]<<"\t";
}
}
//in this simple approach ... | ALGO | 0.995094 | 4.263124 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-06-16T14:51: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": "a94c9507300... |
9b558630-3a71-47c8-a7a7-b70b806e733e | AlanTheKnight/NTO | 2021-2022/i-tour/e.cpp | #include <vector>
#include <iostream>
using namespace std;
int START_P, END_P, VALUE;
bool STOP_LOOP;
int main(int argc, char const *argv[])
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int p, t;
cin >> p >> t;
a.insert(a.begin() + p, t)... | ALGO | 0.999953 | 4.209756 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-08T13:18:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4533585d8e8... |
8a56d9ca-51b0-435e-a26e-f21361038d5d | Terminus-IMRC/sve-ntt | include/sventt/transposition/sve/gather-vector-index-column-first.hpp | // SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright © 2025 <NAME>
#ifndef SVENTT_TRANSPOSITION_SVE_GATHER_VECTOR_INDEX_COLUMN_FIRST_HPP_INCLUDED
#define SVENTT_TRANSPOSITION_SVE_GATHER_VECTOR_INDEX_COLUMN_FIRST_HPP_INCLUDED
#include <cstdint>
#include <stdexcept>
#include <arm_sve.h>
#includ... | ALGO | 0.99709 | 3.953359 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-07-03T06:24:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c437d8d5456... |
520d6a21-e9f9-4831-b940-304127dc768c | bin3/leetcode | src/BalancedBinaryTree.cpp | /*
Copyright (c) 2012 <NAME>. All rights reserved.
*
@author <NAME> <<EMAIL>>
@date 2012-12-14
*/
#include <cstdlib>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//Definition for binary tree
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(i... | ALGO | 0.999556 | 5.508986 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2012-12-11T14:02: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": "45998e3a2... |
83cc80f1-6001-4262-b1e5-138fadd9199e | octopus-prime/gamma-ray | source/scene/object/surface/primitive/blob/model.hpp | /*
* model.hpp
*
* Created on: 12.05.2014
* Author: mike_gresens
*/
#pragma once
#include <boost/math/tools/roots.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace rt {
namespace scene {
namespace object {
namespace surface {
namespace primitive {
namespace blob {
typedef std::pair<vector3_t, floa... | ALGO | 0.99835 | 5.851851 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2015-02-24T17:53: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": "b85c08044... |
97bfc33e-3d50-4831-af72-0184253d38f3 | RKDH2/Algorithm-Cpp | Algorithm(C++)/2583.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int M, N, K;
int board[101][101];
bool visited[101][101];
vector<int> v;
int dx[4] = { -1, 1, 0, 0 };
int dy[4] = { 0, 0, 1, -1 };
int cnt = 0;
void bfs(int v1, int v2) {
queue<pair<int, int>> Q;
Q.push({ v1, v2 ... | ALGO | 0.999938 | 4.378271 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2024-10-04T14:10:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d68c52326e... |
0d2527d0-ad55-41ff-9699-8289eab5d902 | SrYuyo/DIS145UAI_2025_01 | Pachinco/codigo isi.ino | /* ---------------------------------------------------------
¿Cuál LDR se cubrió? → envía flags al Arduino IoT Cloud
Placa: Arduino UNO R4 WiFi
--------------------------------------------------------- */
#include "thingProperties.h"
/* --- Pines y constantes propias ------------------------- */
const byte ... | TOOL | 0.944395 | 6.12434 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2025-07-01T18:15: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": "79b5a7bbe8c... |
1af7a63b-afef-4248-b791-f8ca2c2e52f5 | ValveSoftware/source-sdk-2013 | src/game/client/c_tracer.cpp | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "cbase.h"
#include "particledraw.h"
#include "materialsystem/imesh.h"
// memdbgon must be the last include file... | TOOL | 0.956067 | 5.941944 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2013-06-26T22:21:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9165,
"forks": 2667,
"issues": 352,
"pull_requests": 507
},
"file_meta": {
"content_id": ... |
2af296da-4cae-4c7f-80a6-54f112d0f9cc | dsdeependra/CodeLearn | powerFunction.cpp | #include<iostream>
using namespace std;
int power(int x, unsigned y)
{
if (y == 0)
return 1;
else if (y%2 == 0)
return power(x, y/2)*power(x, y/2);
else
return x*power(x, y/2)*power(x, y/2);
}
int main() {
int x; int n; int d;
x = -1;
n=1;
d=20;
int res = po... | ALGO | 0.9999 | 3.72462 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-09-25T04:00: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": "4d9440519c... |
e28c0962-d800-4da9-bd85-7f2520e0d838 | chroniclesofcode/competitive-programming | codeforces/2064A-Brogramming_Contest.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAINRET(x) in##x
#define what_is(x) cout << #x << " is " << x << endl;
#define print_vec(x, n) for (int i = 0; i < n; i++) cout << x[i] << ' '; cout << endl;
#define LL long long
#define arr2 array<int,2>
#define arr3 array<int,3>
void solve();
MAINRET(t) main(v... | ALGO | 0.999954 | 4.186272 | {
"github_metadata": {
"branch": "main",
"commit_count": 822,
"repo_created_at": "2022-09-09T05:32: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": "758574ac00... |
dc754118-b1b5-4d23-9095-8bbfceeb1191 | wisdompeak/LeetCode | Sorted_Container/1912.Design-Movie-Rental-System/1912.Design-Movie-Rental-System.cpp | class MovieRentingSystem {
unordered_map<int, set<array<int,2>>>left; // movie -> {price, shop}
set<array<int,3>>rented; // {price, shop, movie}
unordered_map<int, unordered_map<int,int>> prices; // prices[shop][movie]
public:
MovieRentingSystem(int n, vector<vector<int>>& entries)
{
for (... | ALGO | 0.998546 | 5.574221 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "c... |
4dce9959-b9bd-4afe-a58e-c09a34c483a7 | linkumokunn/code_la | atcoder/abc287C.cpp | /*
=============================================================================
/\ \ / /\ |\ /| |===========
/ \ \ / / \ | \ / | |
/ \ \ / / \ | \ / | |
/ \ | / \ | \... | ALGO | 0.999994 | 4.224839 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-11-23T02:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b546d82503... |
c8cd37e3-560c-4b23-aab0-3023d4864dc8 | Hackateen-SC/Hackateen-2021 | Round-1A/silly-gradient/solutions/grizzledBasmati1.cpp | #include <iostream>
using namespace std;
string answers[4] = { "radial", "horizontal", "vertical", "angled" };
int c[3][3][3];
int d = 10;
bool equal(int x1, int y1, int x2, int y2){
if(abs(c[x1][y1][0] - c[x2][y2][0]) > d)
return 0;
if(abs(c[x1][y1][1] - c[x2][y2][1]) > d)
return 0;
if(... | ALGO | 0.999978 | 4.09582 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-04-13T03:00:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b3663b89b1a... |
52ebf43c-0b5a-4d99-b098-671c749afa45 | seap-udea/SatPack | Exercise_5_1.cpp | //------------------------------------------------------------------------------
//
// Exercise_5_1.cpp
//
// Purpose:
//
// Satellite Orbits - Models, Methods, and Applications
// Exercise 5-1: Transformation from celestial to terrestrial reference system
//
// Notes:
//
// This software is protected by nation... | ALGO | 0.996302 | 6.006143 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-10-06T21:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02a9851a10bc... |
810b6708-8bd1-40f5-b616-39d1772d93d8 | ROCm/rocSOLVER | library/src/auxiliary/rocauxiliary_bdsvdx.hpp | /**************************************************************************
* Derived from the BSD3-licensed
* LAPACK routine (version 3.10.0) --
* Univ. of Tennessee, Univ. of California Berkeley,
* Univ. of Colorado Denver and NAG Ltd..
* December 2016
* Copyright (C) 2016-2024 Advanced Micro Device... | ALGO | 0.984257 | 6.473873 | {
"github_metadata": {
"branch": "develop",
"commit_count": 816,
"repo_created_at": "2018-05-22T22:37:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 108,
"forks": 64,
"issues": 4,
"pull_requests": 23
},
"file_meta": {
"content_id": "de79... |
50692788-0364-499d-b169-503bb2ecc6c0 | Githubak2002/DSA-with-cpp-all-code | LinkedList/Doubly_Linked_List.cpp | // Doubly LL - Deletion remaning
// with no implimentation of tail/end node
#include <iostream>
#include <math.h>
using namespace std;
class node
{
public:
int data;
node *next, *prev;
// constructor
node(int data)
{
this->prev = NULL;
this->data = data;
this->next = NULL;... | ALGO | 0.999576 | 4.592354 | {
"github_metadata": {
"branch": "codespace-ubiquitous-space-robot-x7v5qp7gj7g29vrp",
"commit_count": 163,
"repo_created_at": "2023-09-14T09:05:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
... |
fc119702-ce7f-4823-8e56-2ec8945f6956 | ishandutta2007/codeforces-d | duality/normal/983/E.cpp | #define DEBUG 1
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printA... | ALGO | 0.999869 | 3.926692 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6174a44bd9a6... |
95da0c7c-c465-4e36-998b-04cf72930595 | ecoronel3/MN2022 | tp1/src/ForwardSubstitution.h | #pragma once
#include <type_traits>
#include "MatrixN.h"
#include "VectorN.h"
namespace mn
{
template <typename T, typename = std::enable_if_t<std::is_floating_point_v<T>> >
void ForwardSubstitution(MatrixN<T> const& A, VectorN<T> const& b, VectorN<T>& x)
{
for (int i = 0; i < A.rows(); ++i) ... | ALGO | 0.99888 | 5.893127 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2022-03-27T19:35: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": "bd16760823... |
e4a92bca-2c4a-4035-8bab-77e96495c024 | dsc-sookmyung/2022-02-Algorithm-Study | 08-Set-Map-Dictionary/yujin0419/C-1764.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
map<string, int> unheardOf;
vector<string> result;
int neverHeard, neverSeen;
bool neverSeenAndHeard(string personNeverSeen) {
if (unheardOf[personNeverSeen]) {
return true;
}
else {
return false... | ALGO | 0.998272 | 3.404353 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2022-09-25T15:58:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17a5aec4f2a... |
a80e4c2a-303e-433f-a3bd-90e48baacb5f | Arin016/DSA | String algorithms/LEXIsmallest_cyclicShifts.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9+7;
//amongst all the cyclic shifts find out the lexicographically smallest one
//whenever there's cyclic shifts and stuffs, always think of appending it twice!!
struct hasher {
string s;
int n, mod, p;
vector<int> fhash, rhas... | ALGO | 0.999982 | 5.000322 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-08-09T16:08: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": "b3e085cf242... |
d21dfd7c-bc02-4238-ad17-26d15f509920 | nv-0203/Data-Structures | Trees/Binary Trees/17_RootToNode.cpp | #include <iostream>
#include <string>
#include <map>
#include <unordered_map>
#include <math.h>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <set>
using namespace std;
typedef long long int ll;
struct Node
{
int key;
Node *left;
Node *right;
Node (int x)
{
... | ALGO | 0.999947 | 3.719775 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-05-21T09: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": "8c6811f6040... |
af4601f9-67e3-45f9-aac0-55284cf46a00 | xvepkj/cp_files | uva/11597.cpp | /* */
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <bitset>
#include <map>
#include <set>
const int MAX_LEN = 1010;
#define GETLINE(x) fgets(x,MAX_LEN,stdin)
using namespace std;
typedef lon... | ALGO | 0.997424 | 3.183106 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-20T04:15: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": "51f45be1548c... |
d7ead0f9-9c3b-4ac7-bb50-ea4d0571163a | clonedSemicolon/Competetive- | Spoj/multiple of 3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=100000007;
const int MX=2*100005;
struct dt{
int zero,one,two;
}tree[MX*4];
int lazy[MX * 4];
void make(int node,int b,int e)
{
if(b==e){
tree[node].zero=1;
tree[node].two=0;
tree[node].one=0;
re... | ALGO | 0.999902 | 4.317667 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-02-17T07:53: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": "4fc454600... |
08a26f04-203c-4069-85a5-78368f04dc0d | JorjeousJorje/NSU-Graphics | Project. Terrain Generation/Headers/ProcedureTree.h | #pragma once
#include <memory>
#include <QVector3D>
#include <numbers>
constexpr auto PI = std::numbers::pi_v<float>;
class TreeBranch
{
public:
TreeBranch(const float r, const float s, const float ss)
: ratio_{ r },
spread_{ s },
split_size_{ ss }
{}
TreeBranch(std::unique_ptr<TreeBranch> branch, cons... | ALGO | 0.935087 | 5.418007 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-02T06:28:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9805d08129e6... |
14886280-bb8f-409e-ae7f-0749a94c736e | AnkitVerma1232004/Smartinterview | day3/ReverseLinkedList/ReverseLinkedList(Iterative).cpp | /**
* Definition for singly-linked list.
* The ListNode class is used to represent a node in the linked list.
*/
class ListNode {
public:
int val;
ListNode *next;
// Constructor to create a ListNode with a given value
ListNode() : val(0), next(nullptr) {}
// Cons... | ALGO | 0.999956 | 6.834628 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2025-04-11T10:07: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": "299e4669b3a... |
390c7b39-6cae-42df-8944-d98105c32f55 | Kartikksaxena/Ccodechef | codechef/2021Sept/MINDIGITSUM2.cpp | #include <bits/stdc++.h>
using namespace std;
long SumDigitBase(long n, long base)
{
long sum = 0;
while (n > 0)
{
sum = sum + n % base;
n = n / base;
}
return sum;
}
int main()
{
long t, n, r;
cin >> t;
while (t--)
{
long temp = 1e11, sum = 0, count = 0;
... | ALGO | 0.999973 | 4.271011 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-11-24T14:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ac3824dd5... |
e0d3e601-015d-40d1-8bae-c40a9afcf933 | shahendahamdy/ITI-PD | 02-C/day3.6/main.cpp | #include <stdio.h>
#include <stdlib.h>
int main()
{
int arr1[3][2],arr2[2][1] ,sm=0;
int a,b,c,d;
int mul[100][100]={0};
printf("Enter the first array dimensions\n");
scanf("%d",&a);
scanf("%d",&b);
printf("Enter the first array \n");
for(int i=0; i<a ;i++){
for(int j=0;j<b;j++... | ALGO | 0.999907 | 3.047073 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-10-20T23:08: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": "62280e44c96... |
7b19daa8-3894-476d-9d6b-2ac8ef819b89 | hmazhar/physbam_public | PhysBAM_Geometry/Basic_Geometry_Intersections/BOX_LINE_2D_INTERSECTION.cpp | //#####################################################################
// Copyright 2009, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Namespace ... | ALGO | 0.997749 | 5.929115 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "f5c076a... |
26566f10-14a0-465e-a449-361a339cf891 | fengvyi/LeetCode | C++/224. Basic Calculator.cpp | class Solution {
public:
int calculate(string s) {
stack<int>stk, op;
int res = 0, sign = 1;
for(int i = 0; i < s.size(); i++){
char c = s[i];
if(isdigit(c)){
int num = c - '0';
while(i + 1 < s.size() && isdigit(s[i + 1])){
... | ALGO | 0.999976 | 5.14624 | {
"github_metadata": {
"branch": "master",
"commit_count": 1188,
"repo_created_at": "2017-08-06T09:52:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 144,
"forks": 39,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "cc2b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.