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 |
|---|---|---|---|---|---|---|---|
75e94d11-e28b-48b6-8b65-fd9f1977e794 | mzain7/DataStructure | Test/StackL.h | #include <iostream>
template <typename T>
struct Node
{
T data;
Node *next = nullptr;
};
template <typename T>
class Stack
{
private:
Node<T> *head;
public:
Stack()
{
this->head = nullptr;
}
~Stack() {}
void push(T data);
T pop();
T peek();
void display();
bool... | ALGO | 0.971735 | 5.065165 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-03-24T16:23: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": "8c35fc1ca0f... |
51e0a15a-6d9d-4fb7-83c0-c95370c08416 | YuYuCong/Astar | 重要资料/A star pathfinder v. 1.92/Visual C++ Version/Demo 2 - Maze/main.cpp | /*
NOTE: This code was written using Microsoft's Visual C++ v 6.0.
I don't know how well it will work with other compilers.
You also will need the Direct X 7.0 SDK, and to install the lib
and include files from the SDK to your C++ lib and include
folders. You can get the DirectX 7.0 SDK (large!) here:
http://download.... | TOOL | 0.968875 | 3.305429 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-07-12T10:59:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 67,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fd4ce98... |
9997f340-a508-4ba1-864b-4acb048c1004 | dmtnikolaev/os_labs | lab4/Task_4_1_1/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <windows.h>
#include <chrono>
const int pageSize = 4096;
const int pageNum = 12;
const int blockSize = pageNum * pageSize;
int main() {
HANDLE file = CreateFile("out.txt", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_REA... | TOOL | 0.905119 | 4.219125 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-02T10:44:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7eab2507d10... |
275aa76f-0b7d-4173-9780-699ec3cb580e | hantwofish/my_leetcode | datastruct_learn/leetcode/2789.cpp | #include"../STLCOMMON.h"
#include"../COMMONALO.h"
using namespace std;
class Solution {
public:
long long maxArrayValue(vector<int>& nums_2) {
vector<long long>nums(nums_2.begin(), nums_2.end());
while(findOneChice(nums)){
MyPrintOne(nums);
}
resu = nums[0];
fo... | ALGO | 0.999911 | 4.342538 | {
"github_metadata": {
"branch": "main",
"commit_count": 353,
"repo_created_at": "2023-03-10T14:37: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": "6cf6af2872... |
e3b0d862-f645-4ceb-882d-9c7b316c5bff | sourabh8244/SystemDesign | IISc/determinant/determinant.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int determinant(vector<vector<int>> mat){
int m = mat.size();
int n = mat[0].size();
if(m!=n){
cout<<"not square matrix";
return 0;
}
if(m==2){
return mat[0][0]*mat[1][1] - mat[0][1]*mat[1][0];
}
... | ALGO | 0.999925 | 3.829718 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-04-06T15:20: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": "4747e48dca... |
da0e62ec-fac6-4717-8325-4760ca19b290 | JalajYadav/Data-Structures-and-Algo | DoublyLinkedList.cpp | #include<iostream>
using namespace std;
struct Node{
struct Node * prev;
int data;
struct Node * next;
};
struct Node* insertAtFirst(struct Node* head_ref,int val)
{
struct Node* ptr = new struct Node;
ptr->prev=NULL;
ptr->next=head_ref;
ptr->data=val;
head_ref->prev=ptr;
retur... | ALGO | 0.999577 | 4.423383 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2022-04-22T11:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e29051f3e15... |
4b5fa2fe-d182-4563-993f-0dc1dac96f27 | erichengber/Templated-Linked-List | LinkedList.h | //
// Created by <NAME> on 2/18/2023.
//
#pragma once
#include <iostream>
#include <string>
#include <vector>
using namespace std;
template <typename T>
class LinkedList{
public:
struct Node{
T data;
Node* next;
Node* prev;
};
Node* head;
Node* tail;
unsigned int nodes;
... | TOOL | 0.998535 | 6.496067 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-13T02:38: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": "ba5dca48926a... |
7bfc479d-cd16-4b55-ba11-d2426db17d35 | Wasif6418/Coding | length_of_longest_common_sub.cpp | #include <bits/stdc++.h>
using namespace std;
// Returns length of the longest
// contiguous subsequence
int findLongestConseqSubseq(int arr[], int n)
{
int ans = 0, count = 0;
// sort the array
sort(arr, arr + n);
vector<int> v;
v.push_back(arr[0]);
//insert repeated elements only once in the vector
for (in... | ALGO | 0.999862 | 3.974086 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-26T06:50: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": "968dd305d497... |
96ed9b02-6348-4d82-b353-529ce43f25fd | monolife506/problem_solving | 문자열/시계 사진들.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, c[2][200001], txt[400001], pat[200001], fail[200001];
void precomputation()
{
sort(c[0], c[0] + n, greater<int>());
sort(c[1], c[1] + n, greater<int>());
for (size_t i = 0; i < n; i++)
{
txt[i] = (i != n - 1... | ALGO | 0.999991 | 4.153517 | {
"github_metadata": {
"branch": "master",
"commit_count": 433,
"repo_created_at": "2019-09-18T12:56: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": "7673e41e... |
8da4f0e8-9a63-4296-a022-6740076532cc | DILET1/usacoarchive | Alphastar/CC35A/Miscellanious Problem Lesson/cowcrossiii.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k, r;
vector<vector<vector<int>>> blocked(101, vector<vector<int>>(101, vector<int>(4, 1))); //0 = north. 1 = south. 2 = east. 3 = west. The naming is bad, if blocked[x][y][a] is 1, we can go there.
vector<vector<int>> cl(101, vector<int>(101, -1));
vector<pair<int,i... | ALGO | 0.999932 | 4.072692 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2022-01-28T18:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc4aaf73eb... |
9d12cf6c-5631-4808-bc29-cfefaf8fb624 | gcgeng/My-Code | bzoj1002.cc | #include <cstdio>
int mod = 10;
struct data {
int a[50], len;
} f[3];
int n;
inline int min(int a, int b) { return a < b ? a : b; }
data mul(data a, int k) {
for (int i = 1; i <= a.len; i++)
a.a[i] *= k;
for (int i = 1; i <= a.len; i++) {
a.a[i + 1] += a.a[i] / mod;
a.a[i] %= mod;
}
while (a.a[a.l... | ALGO | 0.999945 | 3.195899 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-04-20T11:46:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "707a85ce80... |
471713f9-fe14-4fdd-95d2-3fa8c6b3e577 | Yuji-Itadorii/Computer-Programs | Important Questions/LinkedList/Find_pair_sum_in_DLL.cpp | // https://practice.geeksforgeeks.org/problems/find-pairs-with-given-sum-in-doubly-linked-list/1
//{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next, *prev;
Node(int val) : data(val), next(NULL), prev(NULL)
{
}... | ALGO | 0.999734 | 5.594237 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2022-04-03T05:05:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96177c6bd2... |
57b8b1a8-1cf2-4dc8-b279-15f6eb8be62c | Dima793/Fibonacci-Heap | dij_test.cpp | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <utility>
#include <queue>
#include "fib.h"
#include "dij.h"
template <class T>
using minPQ = std::priority_queue<T, std::vector<T>, std::greater<T> >;
int createGraph(int n, int pD, int pE, int pl, int* deg, int** inc, double** w) {
int curr = 0;
in... | ALGO | 0.999223 | 3.518221 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-07-05T02:57: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": "49c48da6ed7b... |
9f27cc8f-4213-4771-8338-12f9ea43288b | ivaacimic/IncompressibleNavierStokesSolver | NewGrid.cpp | #include "NewGrid.h"
/**
* @brief Calculates the local size of the grid based on the MPI rank coordinates.
*
* This function calculates the local size of the grid in both the x-direction and y-direction
* based on the MPI rank coordinates, ensuring that each process handles a portion of the grid
* that excludes ... | ALGO | 0.991809 | 5.641314 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-12T18:22:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2e905af0d29... |
a56c00ee-9078-4838-a2ac-9a417736d028 | eli-mezon/aoc2022 | day09/main.cc | #include "../day06/ReportBuilder.hpp"
#include <iostream>
#include <fstream>
#include <streambuf>
#include <vector>
#include <list>
#include <memory>
#include <algorithm>
#include <numeric>
#include <map>
#define SIZE 2000
class Map
: public IScoreCalculator
{
public:
Map(const std::string& aFileName)
{
... | ALGO | 0.984362 | 4.953945 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-12-01T06:57: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": "a95c772fadc... |
ecae5fb3-c76e-4812-9408-be0626867289 | arthurchagas1/Programming-Challenges | beecrowd/1340.cpp | #include <iostream>
#include <stack>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n;
while (cin >> n) {
stack<int> s;
queue<int> q;
priority_queue<int> pq;
bool is_stack = true;
bool is_queue = true;
bool is_pq = true;
for (... | ALGO | 0.999894 | 4.718235 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2023-12-23T01:25:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8579dab9ca... |
672448e3-6832-442d-98ce-a3e0f24292d2 | Hajrah32/Data-Structures-And-Algorithms | Queue/Day 4/First Negative In Every Window Of Size K/firstNegativeInEveryWindowOfSizeK.cpp | #include<bits/stdc++.h>
using namespace std;
long long display(queue<int>q){
while(!q.empty()){
if(q.front()<0){
return q.front();
}
q.pop();
}
return 0;
}
vector<long long> printFirstNegativeInteger(long long int A[],long long int N, long long int K){
queue<int>q;
... | ALGO | 0.99995 | 4.602495 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2024-03-11T20:38: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": "29f551d4f62... |
ffee13c0-714b-4431-a9d4-76cc2da3ac0e | WangYiBen0/wangyiben0.github.io | Resource/Archive/2025求真班/模拟赛/6.14/source/王亿犇/c/c.cpp | #include <iostream>
#include <vector>
#include <cstring>
#define int long long
using namespace std;
const int MAXN = 2000;
int n, m, len[MAXN + 5], sum[MAXN + 5], id[MAXN + 5], P[26][MAXN + 5], f[MAXN + 5][MAXN + 5];
char s[(MAXN + 5) * 500];
vector<int> p[26][MAXN + 5];
inline int next(int i, int j, const int c)
{
... | ALGO | 0.999971 | 4.086791 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-05-04T08:38:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90093394dbf... |
38cf5f34-ab8d-4729-a0aa-7e1f8a047a32 | anantsingh404/CP-files | codechef/160a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 998244353;
int main() {
int T;
cin >> T;
while (T--) {
int n;
string s;
string flag;
string temp1;
string temp2;
cin >> n ;
cin>>s;
flag=s;
reverse(flag.... | ALGO | 0.999956 | 4.212325 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-09-26T13:22:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f6b3fc4039... |
5d562e09-508c-48e1-b779-057a354da0a1 | Pperez4/C-plus-plus | ch4/personalBest.cpp | /*--------------------------------------------------------------------------------
Personal Best
Write a program that asks for the name of a pole vaulter and the dates and vault
heights (in meters) of the athlete’s three best vaults. It should then report,
in order of height (best first), the date on which each vault... | ALGO | 0.999193 | 5.634822 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-25T00:59: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": "6ca2a04eff1... |
8e3726bf-916e-41e6-8717-41021be95232 | ilrexho2011/Project-EULER-Possible-Solutions-Problems-201_to_300 | Exercise 233/Exercise 233.cpp | #include <iostream>
#include <bitset>
#include <vector>
#include <cmath>
#include <list>
using namespace std;
const uint64_t MAXPRIME=5000000;
const uint64_t CP=2235;
const uint64_t MAXN=100000000000;
const uint64_t LOG_MAXN=11;
bitset<MAXPRIME> sieve;
bitset<MAXPRIME> cvalues;
vector<uint64_t> pyth;
// Pythagorean pri... | ALGO | 0.999809 | 3.789957 | {
"github_metadata": {
"branch": "main",
"commit_count": 304,
"repo_created_at": "2023-11-29T13:18: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": "41bc3085b1... |
1b3c3c32-2cce-426f-9f91-e3e785d7feb9 | RHJihan/problem-solving | UVA/10038-Jolly_Jumpers.cpp | // https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=979
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
(void)!freopen("input.txt", "r", stdin);
(void)!freopen("output.txt", "w", stdout);
#endif... | ALGO | 0.999888 | 3.936399 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2025-02-28T06:03: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": "dcf7308d475... |
212681e4-007b-4390-bcc0-3e883ff2c15c | mattsteencpp/chess_solver | king.cpp | #include "king.h"
std::vector<board::position> king::get_possible_moves(bool evaluating_check)
{
std::vector<board::position> moves;
for (int i = -1; i < 2; i++)
{
for (int j = -1; j < 2; j++)
{
board::position new_position(my_position.pos_x + i, my_position.pos_y + j);
if (new_position == my_position |... | ALGO | 0.998018 | 4.362682 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-08-12T15:43:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcd99e084... |
76ad548e-3fb8-4006-a9d5-142895b92673 | DominikaMaciag/Algorithms-and-Data-Structures-II | 2 Kolejka priorytetowa/priority_queue.cpp | /* Implementacja minimalnego kopca binarnego, zaleznosc: rodzic mniejszy od dzieci */
#include <array>
#include <iostream>
class KolejkaPriorytetowa
{
private:
int size=0;
std::array<int, 100> table;
public:
void swap(int *ElemA, int *ElemB);
void insert(int x); //wstawia element
int Remo... | ALGO | 0.999843 | 4.964606 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-25T10:31: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": "7057e04571... |
68680515-0507-4eab-89bd-2e1231fb020d | tualatint/abstract_gym_2 | robot/TwoJointRobot.cpp | #include "TwoJointRobot.h"
TwoJointRobot::TwoJointRobot(double l1, double l2) : l1_(l1), l2_(l2) {
// Initialize the state or any other necessary variables
reset();
}
void TwoJointRobot::initialize(const State& initialState) {
state_ = initialState;
}
void TwoJointRobot::step(const Action& action) {
... | TOOL | 0.97924 | 7.067125 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-01-23T19:32:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3709d231991... |
6222e8be-beac-4418-9352-bde786bf326e | rogeryoungh/code-of-acm | archive/template/ntt-mint/eval/1.hpp | #ifndef ACM_NTT_EVAL_H
#define ACM_NTT_EVAL_H
#include "template/ntt-mint/poly/0.hpp"
#include "template/ntt-mint/inv/0.hpp"
#include "template/ntt-mint/deriv/0.hpp"
struct PolyEI {
std::vector<Poly> p;
int n, raw_n;
PolyEI(Poly a) {
raw_n = a.size(), n = get_lim(raw_n);
a.redeg(n), p.resi... | ALGO | 0.991784 | 6.275259 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2021-08-25T13:18:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3eca6ceb46... |
f916a94b-7a83-43a1-9228-94517635eabe | fazlerahmanejazi/Competitive-Programming | Codeforces/a2oj Ladders/Div 2 C/365C - Matrix.cpp | #include <bits/stdc++.h>
using namespace std ;
#define inf 0x3f3f3f3f
#define INF 1000111000111000111LL
#define mod 1000000007
#define endl '\n'
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(cc) (cc).begin(),(cc).end()
using lli = long long int ;
using pii = pair<int, int> ;
... | ALGO | 0.999337 | 4.017092 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-01-12T00:39:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "3f0b8671... |
8af6b2d7-6fdc-457b-9a0e-a91d896ecda9 | delos0/cpp | acmp_tasks/task_10.cpp | #include <iostream>
#include <cmath>
using namespace std;
void check(long long a, long long b, long long c)
{
if(a>b) swap(a, b);
if(b>c) swap(b, c);
if(a>b) swap(a, b);
if(b==c && c==101) cout << a;
else if(c==101)
{
if(a==b) cout << a;
else cout << a << " " << b;
}
e... | ALGO | 0.999838 | 3.701111 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-05-21T18:35: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": "1d595209da2... |
01622272-183e-4bf5-83e7-bce9a3abb350 | mmaddury/LeetCode | 1366. Rank Teams by Votes.cpp | class Solution {
public:
void
showTable( const vector<vector<int>>& table ) const {
cout << "--" << endl;
for( auto const& vector : table ) {
for( auto const& v : vector ) {
cout << v << " ";
}
cout << endl;
}
cout << "--" ... | ALGO | 0.999979 | 5.419021 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-06-21T14:30: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": "83da27515c... |
c47e3f45-d88c-40ae-a60c-5f928b7f112b | ilyashir/Robofootball | rf-common/util/bbox.h | //========================================================================
// This software is free: you can redistribute it and/or modify
// it under the terms of the GNU General Public License Version 3,
// as published by the Free Software Foundation.
//
// This software is distributed in the hope that it will b... | TOOL | 0.936369 | 6.747329 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2011-07-27T08:39:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3828e140b... |
8cea1d94-e79f-4362-94aa-c5017a6a82dc | ANazaret/X-INF442-Big_Data | TD6/exo-mpi/Sumofevennumbers-a-completer.cpp | #include "mpi.h"
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <iostream>
// In this exercise, you have to fill the sections *** TO COMPLETE ***
int main(int argc, char *argv[]) {
const int root = 0;
// Initialize MPI
MPI_Init(&argc, &argv);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
i... | ALGO | 0.999785 | 4.300573 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-10-17T22:27:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a15f55e1cc... |
bde82348-8abe-4f0e-a417-963cfb5de97a | purplevarun/Dynamic-Programming | Subproblems/GFG/10-Coin-Change-1.cc | // https://practice.geeksforgeeks.org/problems/coin-change2448/1
#include <bits/stdc++.h>
using namespace std;
#define vi vector <int>
#define int int64_t
int count(int coins[], int N, int Sum) {
int dp[N + 1][Sum + 1];
for (int i = 0; i < N + 1; i++) {
for (int j = 0; j < Sum + 1; j++) {
if (i == 0) // N... | ALGO | 0.999929 | 5.034156 | {
"github_metadata": {
"branch": "master",
"commit_count": 329,
"repo_created_at": "2021-04-06T08:36: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": "37f56aeb... |
6f6d6171-e72f-4cd6-8312-b53922d82172 | haoel/leetcode | algorithms/cpp/mergeTwoSortedArray/mergeTwoSortedArray.cpp | // Source : https://oj.leetcode.com/problems/merge-sorted-array/
// Author : <NAME>
// Date : 2014-06-20
/**********************************************************************************
*
* Given two sorted integer arrays A and B, merge B into A as one sorted array.
*
* Note:
* You may assume that A has enou... | ALGO | 0.999934 | 4.760795 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2014-10-20T03:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17857,
"forks": 4931,
"issues": 26,
"pull_requests": 28
},
"file_meta": {
"content_id": ... |
12b56bd8-4ca0-4a67-9df9-061bd2a05cd3 | jackie-han/Coding-Interview | 55二叉树的深度/源.cpp | struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) :val(x), left(nullptr), right(nullptr) {}
};
int TreeDepth(TreeNode* root)
{
if (root == nullptr)
return 0;
int LeftDepth = TreeDepth(root->left);
int RightDepth = TreeDepth(root->right);
return LeftDepth > RightDepth ? (LeftDepth +... | ALGO | 0.999869 | 5.075429 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-28T14:36: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": "e125e2576d... |
f965042c-8915-41a6-bceb-df6bd835f73e | happy955201314/DSweb | UploadFile/105072145.cpp |
class Student{
public:
void makeMove(int Record[5][6], int Max[5][6], Color color[5][6], Color inputColor){
// alpha, beta : used for alpha-beta pruning algorithm
int alpha = -1000000;
int beta = 1000000;
// store the best choice (x,y)
x = -1;
y = -1;
minimax(0, Record, Max, colo... | ALGO | 0.998862 | 4.645826 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-07-08T13:35: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": "c7f223c79... |
72cdfa54-e16a-493e-834c-560e190f842c | NaskoIT/SDA_2022-2023 | 02_Sorting_Algorithms/Nasko/quickSort.cpp | #include <iostream>
using namespace std;
void swap(int arr[], int i, int j) {
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
int partition(int arr[], int low, int high) {
int pivot = arr[high];
int i = low;
for (int j = low; j < high; j++) {
if (arr[j] <= pivot) {
s... | ALGO | 0.999993 | 6.076274 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-10-02T19:47:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cc33a2d0a7... |
eefafb57-cb05-4ab5-8ea6-1d14a0eb9f32 | sherlockor/LeetCode | LeetCode/LinkList.cpp | #include "LinkList.h"
void DisplayLinkList(ListNode* p_head)
{
if (p_head == NULL)
{
return;
}
cout << p_head->val;
p_head = p_head->next;
while (p_head != NULL)
{
cout << "->" << p_head->val;
p_head = p_head->next;
}
cout << endl;
}
ListNode* Append(ListNode* p_head, int value)
{
ListNode* new_node =... | ALGO | 0.996934 | 4.276919 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-10-29T01:48: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": "9570ce594... |
70c4c4d1-e2da-4bbd-aeca-91fd31e5a0cf | mohammadamanpatel/recursion | mergeSort.cpp | #include <iostream>
using namespace std;
void merge(int *arr,int s,int e)
{
int m = (s+e)/2;
int len1 = m-s+1;
int len2 = e-m;
int *a1 = new int[m-s+1];
int *a2 = new int[e-m];
int k = s;
for(int i=0;i<len1;i++)
{
a1[i] = arr[k++];
}
k = m+1;
for(int i=0;i<len2;i++)
... | ALGO | 0.999996 | 5.12669 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-03-31T11:19:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8219941366... |
3a711730-08f7-48c4-8b02-b074373ef4b5 | akshay090703/gfg-practice-problems | Day 141/minDaysToMakeMBouquets.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isDaysPossible(vector<int> &bloomDay, int n, int days, int m, int k)
{
int count = 0;
int noOfBouquets = 0;
for (int i = 0; i < n; i++)
{
if (bloomDay[i] <= days)
{
... | ALGO | 0.999993 | 5.155577 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2024-02-06T08:01: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": "93159bcf05... |
f77d9dd0-152d-4114-bbe7-40cb3345546d | RiyaadHossain/XPSC-Practice | Contest/Codeforces/Round - 938 (Div 3)/B_Progressive_Square.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ye "YES"
#define no "NO"
// Data Type
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pai... | ALGO | 0.9999 | 4.90203 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-03-15T10:41: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": "e924bdd5c6f... |
216ca562-5f05-4c1e-ab55-8da9eea2b9c9 | ishandutta2007/codeforces-p | peti1234/normal/1542/E1.cpp | #include <bits/stdc++.h>
using namespace std;
const int c=505, k=c*c;
long long n, n2, ans, dp[k], kom[k], mod;
int main()
{
ios_base::sync_with_stdio(false);
cin >> n >> mod;
//n=6, mod=100000;
n2=n*(n-1)/2;
dp[0]=1;
for (int i=0; i<=n2; i++) {
kom[i]=1;
}
for (int i=0; i<n-1; ... | ALGO | 0.999953 | 4.123715 | {
"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": "afadc0ae1d5a... |
262d0b9e-dcab-4580-bfce-40378083c048 | OrderLab/violet-static-analyzer | dependencyAnalysis/squidanalyzer.cpp | //
// Created by yigonghu on 6/22/20.
//
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Constants.h"
#include "llvm/Analysis/CallG... | TOOL | 0.927593 | 7.575906 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-11-26T05:08:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3be0f2df70... |
535bb791-7536-45f5-9005-b79b95c77d02 | RainerKuemmerle/g2o | g2o/examples/sba/sba_demo.cpp | // g2o - General Graph Optimization
// Copyright (C) 2011 <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notic... | ALGO | 0.936215 | 6.404796 | {
"github_metadata": {
"branch": "master",
"commit_count": 1617,
"repo_created_at": "2012-01-12T10:18:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3276,
"forks": 1126,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "6... |
d13b5f9e-11a0-40f5-b196-b0926307c180 | AnishMahto/Competitive-Programming-Code-and-Solutions | VM7WC/vmss7wc16c6p3.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int timer = 0, disc[100001] = {0}, low[100001] = {0}, root = 1;
bool visited[100001] = {0}, articulation[100001] = {0};
vector <int> articulationPoints;
vector < vector <int> > graph(100001);
int solve (int pos, int par... | ALGO | 0.999918 | 4.388766 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-03-13T02:25: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": "cb57196e7b... |
eed4b751-b789-441a-9e98-e07a26faef10 | rawan-sleem/LeetCode | 1023-time-based-key-value-store/time-based-key-value-store.cpp | // Time
// Space
/* trace =>
set("foo", "bar", 1): This inserts the key-value pair ("foo", "bar") with timestamp 1 into the mp unordered map.
set("foo", "baz", 2): This inserts the key-value pair ("foo", "baz") with timestamp 2 into the vector associated with the key "foo".
set("foo", "qux", 4): This inserts the key-v... | ALGO | 0.999622 | 6.776171 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-02-04T22:35: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": "9b675631d7d... |
6856344f-f545-4d3d-b10a-b492459e040f | softarts/myoj | ojcpp/leetcode/1000/1006_m_clumsy.cpp | //
// Created by rui.zhou on 3/10/2019.
//
/*
* Normally, the factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.
We instead make a clumsy factorial: using the integers in decreasing order, we swap ou... | ALGO | 0.999965 | 6.326057 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-09-26T01:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75c170d3a... |
768ad682-6fb8-4b99-8a7f-c5967a2aa126 | aperez32/OpenGLDiffusion | main.cpp | #include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <GL/gl.h>
#include <iostream>
#include <string>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>
void DistanceTransform(GLuint, int, int, GLuint[2]);
void Diffusion(GLuint, GLuint, GLuint... | ALGO | 0.992107 | 4.905087 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-07-14T18:10: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": "7bb814c5fda... |
4f3156c2-3627-4e49-aabf-12d2b387c359 | ivosokoloski/StrukturnoProgramiranje | Exercises/Exercise16.cpp | //Од тастатура во низа се внесуваат N позитивни цели броеви (N <= 100), а потоа се внесува и цел број ind (ind >= 0).
//Да се напише функција sum_pos која ја прима низата, бројот ind (кој претставува индекс во низата) и бројот на валидни елементи во низата.
//Функцијата треба да врати сумата на сите елементи почнувајќи... | ALGO | 0.999761 | 4.195558 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-10T15:24: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": "ad7229c5d3... |
3b5a0ab3-7e53-453c-b0f1-cf231b38c6ec | mariumgk/tsp_project | tsp.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <limits>
#include <cmath>
#include <cctype>
#include <chrono>
using namespace std;
using namespace chrono;
// Function to convert string to lowercase
string toLowerCase(const ... | ALGO | 0.994879 | 3.856869 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-29T05:03: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": "1f4b7b514ea... |
b46c1da1-43bf-4aae-bd3b-0de5bee5a3db | luqmanarifin/cp | 0-unclassified/gameletter.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 5;
char a[N][15], s[N];
int cnt[26], alen[N];
long long score[N];
int main() {
int t;
scanf("%d", &t);
while(t--) {
memset(cnt, 0, sizeof(cnt));
memset(score, 0, sizeof(score));
int n;
scanf("%d %s", &n, s);
int len = s... | ALGO | 0.999919 | 3.422685 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "76839115... |
1ca0471b-0a47-471b-922e-c430567e74c5 | david-perez/competitive-programming | UVa/011237.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <stack>
#include <list>
#include <forward_list>
#include <algorithm> // max...
#include <utility> // pair
#in... | ALGO | 0.999987 | 3.601457 | {
"github_metadata": {
"branch": "master",
"commit_count": 707,
"repo_created_at": "2015-10-28T23:24:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "281cfb8... |
8b89f922-4ea8-43cc-974a-d6a178be2657 | trinhminhtriet/leetcode | solutions/3200-3299/3292.minimum-number-of-valid-strings-to-form-target-ii/Solution.cpp | class Hashing {
private:
vector<long long> p;
vector<long long> h;
long long mod;
public:
Hashing(const string& word, long long base, int mod) {
int n = word.size();
p.resize(n + 1);
h.resize(n + 1);
p[0] = 1;
this->mod = mod;
for (int i = 1; i <= n; i++)... | ALGO | 0.99998 | 5.600038 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef86ca... |
69c76826-6f14-45cf-9c01-d83c269a8829 | 56-13/CDK3 | client/src/CDK/Sources/Graphics/Geometry/Collision/CSCollision+Sphere.cpp | #define CDK_IMPL
#include "CSCollision.h"
#include "CSRay.h"
#include "CSPlane.h"
#include "CSSegment.h"
#include "CSTriangle.h"
#include "CSABoundingBox.h"
#include "CSOBoundingBox.h"
#include "CSBoundingSphere.h"
#include "CSBoundingCapsule.h"
#include "CSBoundingMesh.h"
float CSCollision::SphereGetZ(const CSBound... | ALGO | 0.994458 | 3.480416 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-11-01T02:55: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": "b3cfbd2286... |
a97ad349-f6e6-4cf6-97bd-faa724d17b5e | MynameisKoi/CS360 | Lab4_3.cpp | #include <iostream>
using namespace std;
// class HugeInteger that uses a 40-element array of digits to store integers as large as 40 digits each
class HugeInteger{
private:
int digits[40];
public:
// default constructor
HugeInteger(){
for(int i = 0; i < 40; i++){
... | ALGO | 0.997953 | 3.760581 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2022-05-18T06:57: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": "546d06747b1... |
f352d093-a945-41ec-86f7-bdf04e75d11b | funprograming/leetcode-most-interv | leetcode242. Valid Anagram.cpp | /* leetcode242. Valid Anagram
Given two strings s and t , write a function to determine if t is an anagram of s.
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: false
Note:
You may assume the string contains only lowercase alphabets.
Follow up:
What if the ... | ALGO | 0.999955 | 5.961026 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-10-07T12:46: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": "6ffbcafe0... |
54f52508-f3e8-4d81-84fc-5df09d520840 | Saiteja-1234/30DaysCodingChallenge | 1/GFG/Day 28/Longest Common Subsequence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
const int mod = 1e9+7;
using namespace std;
class Solution
{
public:
int solve(string &a,string &b,int i,int j,vector<vector<int>> &dp)
{
if(i == a.length() or j == b.length())
{
return 0;
}
if(dp[i][j] != -1)
... | ALGO | 0.999994 | 5.444688 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-07-14T06:21: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": "0d9cf7f56fe... |
faec9ce5-4528-49b7-9f58-690fbc66ed34 | Nagisa12321/CPP-Primer | exercises/ch8/ex8_13.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <cstdio>
#include <algorithm>
#include <map>
#include <sstream>
#include <fstream>
using namespace std;
class person_info {
public:
person_info(const string &name) : name(name) {}
void add_phone(const string &phone) {
this->phones.push_... | TOOL | 0.910215 | 4.86801 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-09-11T04:25:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b28185ae8... |
c21255a1-6841-48cf-9a48-e6577d4fdbf8 | shashipk/interview-1 | leetcode/subsets_II.cpp | class Solution {
public:
void subset(int start, int n, vector<int> &S, vector<int> &cur, vector<vector<int> > &ans) {
if (start == n) {
ans.push_back(cur);
return;
}
for (int i = start; i < n; ++i) {
if (i > start && S[i] == S[i - 1]) continue;
... | ALGO | 0.999905 | 5.23262 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2016-12-31T17:45: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": "8d1050e6... |
53caee82-26b3-493e-ae86-9a6d15129699 | IvanRenison/ProgrammingProblems | ICPC contests/Brazil Subregional 2023-2024/H.cpp | // https://codeforces.com/gym/104555/problem/H
#include <bits/stdc++.h>
#define fst first
#define snd second
#define pb push_back
#define fore(i,a,b) for(int i=a,gmat=b;i<gmat;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define FIN ios::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define mset(a,v)... | ALGO | 0.999964 | 3.949192 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2022-11-24T13:05: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": "f6e2e6be07... |
2d0337f6-d9b6-46e5-89a2-5fee41394190 | avnish0900/Solutions-for-Competitve-Problems | Long Number.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define all(xs) xs.begin(), xs.end()
#define rall(xs) xs.rbegin(), xs.rend()
#define sz(x) (int)((x).size())
#define pb push_back
#define mp make_pair
#define prec(n) fixe... | ALGO | 0.999861 | 3.323752 | {
"github_metadata": {
"branch": "main",
"commit_count": 245,
"repo_created_at": "2021-01-11T16:17: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": "e375b71141... |
0ab3de9a-d1d7-40b2-a5c0-65e4907dda08 | EEA-sensors/julia-tutorial | kf-benchmark/kf_benchmark.cpp | /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Modified from the following example file.
%
% Track car state with Kalman filter and Rauch-Tung-Striebel
% smoother as in Examples 4.3 and 8.3 of the book
%
% <NAME> (2013), Bayesian Filtering and Smoothing,
% Cambridge University Press.
%
% Last... | ALGO | 0.998818 | 5.815175 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2015-11-01T13:52:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c194d6bdfb... |
bf41f2bf-350f-46d2-bed1-fc4f23cadd23 | actium/codeforces | 1900/70/1976b.cpp | #include <iostream>
#include <vector>
using integer = unsigned long long;
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(integer x)
{
std::cout << x << '\n';
}
void solve(const std::vector<unsigned... | ALGO | 0.999965 | 4.935503 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2020-06-17T16:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33e3038... |
61de53da-bc4e-4b42-bee8-8020d7a7f027 | andrewwang2015/Caltech-CS156a | Week1_Perceptron.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <time.h>
using namespace std;
#define MIN -1.0
#define MAX 1.0
#define NUMTRAININGPOINTS 100
int numIterations = 0;
typedef struct _point
{
double x;
double y;
int score;
} point;
typedef struct _line
{
double slope;
} line;
... | ALGO | 0.999342 | 4.993575 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-03-02T05:42:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "323694ea02... |
130479bf-1e28-4763-8d90-99a306baec15 | Archeleus/relativistic-render | src/core/shrots.cpp |
/*
pbrt source code Copyright(c) 1998-2010 <NAME> and <NAME>.
This file is part of pbrt.
pbrt 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 2 of the License, or
(at your... | ALGO | 0.995407 | 4.837635 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2010-11-04T07:14:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf3f5e862... |
193876cf-5e90-46c9-9b96-834540f0100e | EasonDongH/MyPAT | PAT_AdvancedLevel/1004 Counting Leaves/Solution.cpp | //#include <bits/stdc++.h>
//using namespace std;
//
////测试点1、3过不去,可能是该算法对输入的先后顺序敏感,而测试点1、3是乱序输入的
//int main() {
// int N, M, K, Id, child, p;
// vector<int> parent(105, -1);
// map<int, pair<int, int>> m_ip;
// parent[1] = 0;
// m_ip[1] = make_pair(1, 0);
//
// cin >> N >> M;
// for (int i = 0; i < M; ++i) {
// cin >... | ALGO | 0.999974 | 3.608712 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-11T04:07: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": "525e4b663c... |
4b42b490-9c60-4410-b1b1-6d0162b86f1b | happasuke/find-seiro | findCrossPoint.cpp | #include "findCrossPoint.h"
pos findCrossPoint(intervalTag *tatesen, intervalTag *yokosen,int tatei,int yokoi){
myline lineBox[2];
pos mixpoint;
findTwoLine(tatesen, yokosen,tatei,yokoi,lineBox);
mixpoint = findMixPoint(lineBox);
return mixpoint;
}
void findTwoLine(intervalTag *tatesen, intervalTag ... | ALGO | 0.99519 | 3.698245 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2014-10-09T04:37: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": "29e76bee2... |
02546172-4157-4f30-8751-c49af0554383 | kodel-dev/Unpam-IT-Cpp-Learning-Journey | 06-Learn-C++/Arrays_and_Basic_Statistics.cpp | #include <iostream>
using namespace std;
int main() {
const int JUMLAH_NILAI = 10;
int nilai[JUMLAH_NILAI];
int total = 0;
int tertinggi, terendah;
float rata_rata;
cout << "Masukkan 10 nilai ujian (0 - 100):" << endl;
for (int i = 0; i < JUMLAH_NILAI; ++i) {
cout << "Nilai ke-" <<... | TOOL | 0.990062 | 4.568658 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2025-05-14T14:27: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": "46b4c88adbe... |
18181db8-99cb-4bf3-bcf4-daedd1567907 | nhhoang14/CodePTIT_Source | CodePTIT - DSA/DSA06035.cpp | //https://code.ptit.edu.vn/student/question/DSA06035
//<NAME>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int checkRoot(const vector<int>& a, int i) {
if ((i == 0 && a[i] > a[i + 1]) || (i == a.size() - 1 && a[i] > a[i - 1])) return 1;
return (a[i] > a[i - 1] && a[i] > a[i + 1]) ? 1 : 0... | ALGO | 0.999156 | 4.357268 | {
"github_metadata": {
"branch": "main",
"commit_count": 646,
"repo_created_at": "2024-04-19T11:42:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c18aaa2cb9... |
6cff51ac-1722-47a8-934d-668665cf1c6e | vermilion00/eclipse | Aufgabe3-2/src/Aufgabe3-2.cpp | #include <iostream>
#include <time.h>
using namespace std;
struct DataListNode{
int data;
DataListNode *ptr2next;
DataListNode *ptr2prev;
};
time_t t;
DataListNode *anchor = NULL;
DataListNode *ptr2first = NULL;
DataListNode *runptr = NULL;
int new_data;
DataListNode *new_node, *node2delete;
void InsertAtBeginnin... | ALGO | 0.997434 | 4.292776 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-07-06T08:17: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": "27d4b148bc... |
c9b9fe83-492a-4918-a5bb-415a3760adb2 | Extazy-b/numerical | T3/main.cpp | #include <iostream>
#include <fstream>
#include "../T5/libs/math.cpp"
#include <functional>
using namespace std;
pair<vector<double>, vector<double>> Euler(
function<double(double, double)> equation,
double ragngeStart,
double rangeEnd,
double startValue,
double sizeOfCrushing)
{
pair<vector... | ALGO | 0.999996 | 5.389422 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-05-07T02:59: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": "13d9f719d6f... |
3647b22f-28a4-4241-bcf8-c5781378346c | ishandutta2007/codeforces-b | bidzilya/normal/518/F.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cstdio>
using namespace std;
const char kOccupied = '#';
const char kFree = '.';
void Rotate(vector<vector<char> >& a)
{
int n = a.size();
int m = a[0].size();
vector<v... | ALGO | 0.999889 | 3.877595 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b026fa7aaf5... |
6d41154c-e0ac-4eb7-9380-83052a3ae09a | wenhaofang/LeetcodeSolution | leetcode31.cpp | /*************************************************
Author: wenhaofang
Date: 2021-06-12
Description: leetcode31 - Next Permutation
*************************************************/
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue... | ALGO | 0.999995 | 5.93866 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2021-05-07T11:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9221e3995c... |
ed2fa545-03d8-43cd-a6f7-b17056213707 | sdkl/LeetCode | 164. Maximum Gap/main.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
void radixSort(vector<int>& nums)
{
vector<vector<int>> buckets(10,vector<int>());
for (int r = 0; r < 10; r++)
{
for (int i = 0; i < buckets.size();i++)
buckets[i].clear();
int n = pow(10, r);
for (auto j : nums)
... | ALGO | 0.99944 | 4.320782 | {
"github_metadata": {
"branch": "master",
"commit_count": 145,
"repo_created_at": "2016-07-09T15:40: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": "2690b8b7... |
da919521-6cb7-4b53-be44-8e2e272ebc50 | sagarladla/everyting_c-cxx | gradient-descent/gradient-descent.cpp | /**
* @author : <NAME>
* @program : Batch Gradient Descent
* @date : Oct 20 2024
* @ref : https://github.com/sagarladla/mini-projects-archived/blob/main/Batch_Gradient_Descent/main.py
* @writeup : https://sagarladla.github.io/post/batch-gradient-descent/
* */
#include <iostream>
#include <fstream>
#include <sst... | DATA | 0.983287 | 5.551979 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-04T19:42: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": "9a33d3310bce... |
e6ff7889-3669-4aa6-9535-259aea0c34c5 | nicolopedrani/my_exercises | exercise_10/parallel_GA/ex1.cpp | //module load mpi/mpich-3.2-x86_64
//mpicxx ex1.cpp
//mpiexec -np 4 ./ex1.out
//plot 'picture_path0.txt' u 2:3 w l, 'picture_path3.txt' u 2:3 w l, 'picture_path2.txt' u 2:3 w l, 'picture_path1.txt' u 2:3 w l
#include "funz.cpp"
#define square
//se voglio usare solo p=1 non uso swap
#define swap
using namespace std;
... | ALGO | 0.999979 | 4.059299 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-03-29T14:27: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": "377bedc27... |
0ad33467-f6cf-44c8-b4a9-407e91ee8432 | netxpto/QuantumMiningSMC | lib/huffman_decoder_20180621.cpp | #include <algorithm>
#include <iostream>
#include <Windows.h>
#include "netxpto_20180418.h"
#include "huffman_decoder_20180621.h"
using namespace std;
void HuffmanDecoder::initialize(void) {
outputSignals[0]->setSymbolPeriod(inputSignals[0]->getSymbolPeriod());
outputSignals[0]->setSamplingPeriod(inputSignals[0]->... | ALGO | 0.987597 | 3.415028 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-19T09:45:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09289e45e3... |
d3e838c0-ce3a-448b-ab70-4b34cef41fcf | professormarcosp/AprendaCParaGamesUE4 | Matrizes/Matrizes.cpp | #include <iostream>
int main()
{
/*Declarei uma variável do tipo Matriz com 5 linhas
e 5 colunas
como o C++ o indice começa com zero as linhas e colunas vão de 0 a 4*/
int Matriz[5][5];
//Percorremos a Matriz pelas suas linhas e colunas
//i vai de 0 até 4 pois quando atingir 5 5< 5 (f) e ai sai do loop
for (in... | ALGO | 0.994812 | 4.055409 | {
"github_metadata": {
"branch": "master",
"commit_count": 220,
"repo_created_at": "2018-08-23T17:55:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22b5b8... |
7031cc52-930f-4d32-88c0-05caf12a9404 | Xu-Xihe/codes-and-docs-xxh | Docs/data数据结构/树状数组.assets/erwei.cpp | #include <cstdio>
const int maxe = 5e2 + 9;
int n, m, q, tree[maxe][maxe];
inline void add(int x, int y, int val) //注意不能直接调用y,双重循环
{
for (int i = x; i <= n; i += i & -i)
{
for (int j = y; j <= m; j += j & -j)
{
tree[i][j] += val;
}
}
}
inline int sum(int x, int y)
{
i... | ALGO | 0.999337 | 4.718942 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-10-09T14:34: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": "d56689698f06... |
43094826-e238-4155-b213-cd8a5e18c794 | AronDK/FPGA-Matrix-Inversion-Accelerator | inver_aug/solution3/syn/systemc/inverse_2.cpp | #include "inverse.h"
#include "AESL_pkg.h"
using namespace std;
namespace ap_rtl {
void inverse::thread_ap_clk_no_reset_() {
if ( ap_rst_n_inv.read() == ap_const_logic_1) {
ap_CS_fsm = ap_ST_fsm_state1;
} else {
ap_CS_fsm = ap_NS_fsm.read();
}
if ( ap_rst_n_inv.read() == ap_const_logi... | ALGO | 0.920001 | 3.020954 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-10T05:57:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef33640154b7... |
c5c97129-7523-4ded-aa9e-827414a382eb | alexander050211/problem-solving | atcoder/abc-372/f.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef unsigned long long ll;
#define F first
#define S second
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define mod 998244353
ll n, m, k;
ll dp[400005];
pll brr[55];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(... | ALGO | 0.999988 | 4.433479 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-09-02T08:06: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": "c261cb87089... |
ed5aed98-565d-4de4-8873-cead4f2f4a41 | ethz-asl/maplab | algorithms/loopclosure/vocabulary-tree/include/vocabulary-tree/simple-kmeans.h | // Original code Copyright Willowgarage as part of ROS, adapted here (BSD).
// http://ros.org/wiki/vocabulary_tree
#ifndef VOCABULARY_TREE_SIMPLE_KMEANS_H_
#define VOCABULARY_TREE_SIMPLE_KMEANS_H_
#include <algorithm>
#include <functional>
#include <limits>
#include <memory>
#include <random>
#include <vector>
#inclu... | ALGO | 0.997844 | 7.327633 | {
"github_metadata": {
"branch": "master",
"commit_count": 895,
"repo_created_at": "2017-11-27T21:58:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2745,
"forks": 730,
"issues": 113,
"pull_requests": 8
},
"file_meta": {
"content_id": "3a... |
d0936bee-b56f-4d7a-8154-63ccc579189a | filipemsilv4/CompetitiveProgramming | NepsAcademy/AC/fusions.cpp | //AC
#include <iostream>
#include <vector>
using namespace std;
vector<int> parent;
int find(int i){
if (parent[i] == i) return i;
return find(parent[i]);
}
void merge(int i, int j){
i = find(i);
j = find(j);
parent[j] = i;
}
int main(){
/*The first line contains two integers N and K,
... | ALGO | 0.999879 | 4.648582 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2024-02-13T12:48: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": "9f30a25437... |
7a902770-9017-4fa4-ad69-c04bf285da31 | GaurishIIITNR/CP-Problems-III | B_Helmets_in_Night_Light.cpp | // हर हर महादेव
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define F first
#define S second
#define dbl double
#define pb push_back
#define ll long long int
#define uset unordered_set
#define umap unordered_m... | ALGO | 0.999917 | 3.86441 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-26T03:13: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": "f2c7fde784a1... |
81dbfb3e-8b2b-4d0c-a931-ed82d20f4642 | JopGomes/ProgComp | IMEpp/Homework3/D.cpp | #include <bits/stdc++.h>
using namespace std;
vector<long long int> factor(long long int n)
{
vector<long long int> fact;
for (int i = 2; i * i <= n; i++)
{
while (n % i == 0)
{
n /= i;
fact.push_back(i);
}
}
if (n != 1)
{
fact.push_back(n... | ALGO | 0.999823 | 3.810867 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-05-24T00:47: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": "767ce8f57a9b... |
47b803de-01c8-451d-a50c-c0565d8f3f44 | Junak12/My-code-book | Graph Theory/Depth_of_a_tree.cpp | #include <bits/stdc++.h>
using namespace std;
#define opt() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
const int mx = 1e5 + 123;
vector<int> adj[mx];
vector<int> depth(mx, 0);
void dfs(int u, int par)
{
for (au... | ALGO | 0.999962 | 4.351107 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2024-09-15T13:06: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": "77226f8d77f... |
5bfebfe1-ed3c-4de3-b399-a4ffb61c2a47 | DAN2407/projectTest | Etapa IV/main.cpp | #include "function.hpp"
#include <iostream>
#include <unordered_map>
#include <queue>
using namespace std;
// Estructura para comparar nodos basándose en sus probabilidades
struct CompareNodes {
bool operator()(TreeNode* left, TreeNode* right) {
return left->probability > right->probability;
}
};
// F... | ALGO | 0.999992 | 5.039074 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-10-29T03:51: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": "6b0d46d1f6e... |
7a9401de-6e91-4f76-9e2f-d6f83bfae457 | linwenb/leetcode | clone-graph.cpp | /*
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each node, and , as a separator for node label and each neighbor of the node.
As an example, consider the serialized ... | ALGO | 0.999938 | 6.318348 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-08-20T19:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e41255ba87... |
d258478e-b7f4-4300-8662-32e09852a817 | Shekharrajak/competitve-programming | hackerrank/world cup hackerrank/WorldCupGame/main.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define MAX 50005
vector<int>v[MAX];
long long int a[MAX];
long long sum[MAX],S,SA;
long long rec(int x,int fr){
long long m= 0;
sum[x]=a[x];
for(int i=0;i<v[x].size();i++){
if(v[x][i] != fr){
rec(v[x][i],x);
... | ALGO | 0.999723 | 3.637918 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2015-03-21T16:37:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4776ccc8f... |
188e3345-9ab5-4992-a2bb-dad3aa8fd87f | alexromanelli/TSPsolver | TSP_GLS/TSPsolver.cpp | /*
* TSPsolver.cpp
*
* Created on: 20/09/2016
* Author: romanelli
*/
#include "TSPsolver.h"
#include <stdlib.h>
#include <cstdio>
#include <algorithm>
#include <cfloat>
#include <time.h>
#include <string>
#include <cmath>
TSPsolver::TSPsolver(int nv, double** c, double lambda, int iteracoes, int opcao) {
... | ALGO | 0.999962 | 4.845381 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-14T20:19: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": "325d29911f... |
aee559ed-5270-4dc4-948a-d566ef3febef | Tsuyopon-1067/atcoder | abc/abc192/c.cpp | #define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define reps(i, s, n) for (int i = (s); i < (int)(n); ++i)
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<double> l(n);
vector<double> r(n);
rep (i, n) {
int t;
cin >> t >>... | ALGO | 0.999589 | 4.02059 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-02-08T09:36: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": "fc7e77bc5d... |
3e9de4ad-8628-44b9-832d-2beee94984f9 | bernardolk/Ravenous | src/Engine/Collision/ClGjk.cpp | #include "ClGjk.h"
#include "CollisionMesh.h"
#include "engine/utils/colors.h"
#include "engine/render/ImRender.h"
vec3 DebugColors[] = {
COLOR_RED_1,
COLOR_GREEN_1,
COLOR_BLUE_1,
COLOR_PURPLE_1,
};
/* -----------------------
GJK Support Functions
----------------------- */
GjkPoint ClFindFurthestVertex(RCollision... | ALGO | 0.999159 | 4.914758 | {
"github_metadata": {
"branch": "master",
"commit_count": 661,
"repo_created_at": "2021-01-15T21:39: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": "ddbeb288... |
661a6ce3-8108-4a90-b5a8-61e5f4a1e1ba | Ankit-Dhattarwal/DSA | Linked_list/delete_recurcive/delete_main_file.cpp | #include<iostream>
using namespace std;
#include "delete_class.cpp"
Node *takeInputBetter(){
int data;
cin>>data;
Node *head = NULL;
Node * tail = NULL;
while(data != -1){
Node * newNode = new Node(data);
if(head == NULL){
head = newNode;
tail = newNode;
... | ALGO | 0.999775 | 3.765476 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-04T11:29: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": "b9afb1705eea... |
c5d20b63-93e3-44dc-8318-3ccd6c0d90e2 | sents/stickfight | bezier.cc | #include "bezier.h"
//Beznode class functions
Beznode::Beznode(): mVec(0,0),mX(0),mY(0),mAngle(0),mTangent1(0),mTangent2(0)
{}
Beznode::Beznode(float nX,float nY,float Angle,float Tangent1,float Tangent2) : mVec(nX,nY),mX(nX),mY(nY),mAngle(Angle),mTangent1(Tangent1),mTangent2(Tangent2)
{
}
float Beznode::getAngle(... | ALGO | 0.997691 | 4.426849 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2017-03-21T15:16: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": "b8e45e38e... |
41eadbbc-0a21-4e3e-b904-9fd8ce96b0a7 | hameem008/Competitive_Programming | Codeforces_and_others/SumofSubstrings.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define gap ' '
typedef long long ll;
ll calcSum(string &str)
{
ll sum = 0;
for (int i = 0; i < str.size() - 1; i++)
{
if (str[i] == '1' && str[i + 1] == '1')
{
sum += 11;
}
else if (str[i] == '0' &&... | ALGO | 0.999947 | 4.271813 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-02T07:22: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": "2070d75acce4... |
0ce41a44-9d66-4edc-bc51-2da43e0d02c2 | arifsptra/Al-Pro2022 | Tugas/Lab01/Kasus3.cpp | // Tebak Output
#include <iostream>
using namespace std;
int main(){
// Deklarasi
int n=8;
int A[n]= {12, 3, 12, 34, 10, 11, 9, 10};
int foo = 0;
// Perulangan untuk menjumlahkan semua nilai array A kemudian dimasukkan ke variable foo
for (int i=0; i<n; i++){
foo = foo+A[i];
}
... | ALGO | 0.999164 | 3.022506 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2022-03-03T03:22:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1b92bb1e... |
3f0ab578-0a3f-4a36-89c7-f95c5ec31ff6 | pavel-ryzhov/global_vars | runs/006742.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <queue>
#include <fstream>
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
class Graph
{
public:
Graph(int s): graph(s), size(s), color(s, WHITE), parents(s, 0), in_time(s), out_time(s) { for(int i = 0; i < s; i++) grap... | ALGO | 0.999986 | 4.343155 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20:43:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a1f6520daf1... |
7dca823c-3877-4761-a900-95f2143af1d9 | jnsturgis/hard_discs2 | Classes/polygon.cpp | /**
* @file polygon.cpp
* @author <NAME>
* @date December 30, 2019
* @version 1.0
* \brief Implementation file for the polygon class.
*
* @class polygon polygon.h
* @brief The polygon class.
*
* The unit test programme is in ../tests/polygon_test.cpp to
* test the va... | ALGO | 0.989003 | 5.163299 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-04-23T20:32:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a526716e... |
e1db8300-d513-4e8a-8e13-d3c92220eb1b | brlivsky/VRP | VehicleTypeCostSD.cpp | /*
* Params set are different
* Vehicle type, vehicle cost, vehicle capacity based heuristics
* Reads a single text file.
* PD pairs are sorted based on largest round trip distance and earliest deadline and used only least cost
* Timestamp
*/
#include <iostream>
#include <unordered_map>
#include <iomanip>
#inclu... | ALGO | 0.998998 | 3.562345 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-16T11:11: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": "7a458cc795b7... |
97be7918-36db-4e17-b2a0-3b08ffcd6e8b | Garyxud/melodic-all | src/cob_control/cob_twist_controller/include/cob_twist_controller/inverse_differential_kinematics_solver.h | /*
* Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
*
* 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... | ALGO | 0.999564 | 6.869949 | {
"github_metadata": {
"branch": "melodic-all",
"commit_count": 1,
"repo_created_at": "2020-09-14T02:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "75d61... |
406ce80f-9991-4151-9927-a718b7b20c65 | beratkirik/CPP-Programming-for-Financial-Engineering | Lectures/Level9/Level9Code/VI.6/BinomialLatticeStrategy.cpp | // BinomialLatticeStrategy.cpp
//
// Strategy pattern for creating binomial lattice. Note
// that there is a built-in Template Method pattern built
// in here.
//
// For convenience all data is public and all code is inline.
// Furthermore, classes have minimal functionality. We can make
// production code from this ... | ALGO | 0.999089 | 5.736245 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-30T12:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 69,
"forks": 44,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d7049f5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.