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 |
|---|---|---|---|---|---|---|---|
dbbae300-7d09-4c38-94b8-ff47f969e236 | suki1106/Fiduccia-mattheyses | src/fm.h | #ifndef FM_H
#define FM_H
#include <vector>
#include <unordered_map>
#include <iostream>
#include "bl.h"
#include "cell.h"
#include "net.h"
using namespace std;
// implementation of Fiduccia-Mattheyses
class Fm {
public:
Fm(string& in, string& out)
: in_file_(in) , out_file_(out), cut_size_(0), net_num... | ALGO | 0.998792 | 4.451131 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-24T14:09: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": "b251739a3058... |
6c13e812-c880-487f-a9b2-31ac7cab63f4 | SanketChheladiya/Sanket123 | Parenting Partnering Returning.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t1;
cin >> t1;
for(int t = 1; t <= t1; ++t)
{
int n;
cin >> n;
vector<pair<int,int>> activity;
int arr[n][2];
char res[n];
for... | ALGO | 0.999962 | 3.928936 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-04-04T17:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c79075e7... |
4da320b6-ecd1-49de-b89c-d6f18e6e91a8 | youssef43a/Learn-to-programming-path | Step5: 50 Problem Solving : level 3 with C++/P04-SumEachColInMatrix/P4_SumEachColInMatrix.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int ft_RandomNumber(short from, short to) {
int RandomNumber = rand() % (to - from + 1) + from;
return RandomNumber;
}
void ft_Fill_3_3MatrixWithRandomNumbers(int matrix[3][3], short Row, short Columns) {
short i = 0;
short j;
while ... | ALGO | 0.986585 | 4.364534 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2024-11-03T23:10:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29ef304e23... |
828c8f74-ed5b-43df-8224-534b5e189ceb | simonnguyen175/cp-repo | tuhoc/icpc/2023-2024/south/I.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
const int MOD = 1e9 + 7;
int n;
int l[N], f[N][N], pw2[N];
int add(int a, int b){
a += b;
if ( a >= MOD ) a -= MOD;
if ( a < 0 ) a += MOD;
return a;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
if ( fop... | ALGO | 0.99997 | 3.90403 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5d57ab279... |
63df9ca6-ad00-496e-a5d2-83c88fcd32e0 | thomascbrs/quadruped-rl | cpuMLP/cpuMLP.hpp | #include <string>
#include <vector>
#include <Eigen/Dense>
#include <cstdlib>
#include "iostream"
#include <fstream>
#include <cmath>
#include "Types.h"
template<int StateDim, int ActionDim>
class MLP_3 {
public:
typedef Eigen::Matrix<float, ActionDim, 1> Action;
typedef Eigen::Matrix<float, StateDim, 1> State;
... | ALGO | 0.998359 | 4.141406 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-03-30T13:11:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecdb81594b1... |
0a21dafb-229d-4a41-8653-069e9ac8d231 | snap-stanford/snap | snap-exp/wikinet.cpp | #include "stdafx.h"
#include "wikinet.h"
#include "trawling.h"
/////////////////////////////////////////////////
// Wikipedia Talk Network
TWikiUsr::TWikiUsr() : Usr(), Admin(false), ElecTm(), BarnStars(), MnEdCnt(), MnEdWrds(), MnTkEdCnt(), MnTkEdWrds(),
WkEdCnt(), WkEdWrds(), WkTkEdCnt(), WkTkEdWrds(), MnRevCnt(),... | ALGO | 0.990587 | 3.391905 | {
"github_metadata": {
"branch": "master",
"commit_count": 1991,
"repo_created_at": "2012-05-10T18:43:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2233,
"forks": 803,
"issues": 83,
"pull_requests": 11
},
"file_meta": {
"content_id": "c... |
8331474c-db94-4afc-8aaf-b013420e2384 | alexandraback/datacollection | solutions_1673486_0/C++/IManifold/a.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
const int MAX = 100010;
int a, b, tt;
double p[MAX];
double prob[MAX];
double solve() {
prob[0] = 1.0;
for (int i = 1; i <= a; i++) {
prob[i] = prob[i-1] * p[i];
}
doubl... | ALGO | 0.999394 | 3.466753 | {
"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": "e49512144... |
f7f9b1b2-95f4-4cf7-9a98-86c861a25eb5 | SSRS-cp/cp_library | data_structure/tree/heavy_light_decomposition.hpp | #pragma once
/**
* @brief 重軽分解
*/
struct heavy_light_decomposition{
vector<int> p, sz, in, next;
void dfs1(vector<vector<int>> &c, int v){
sz[v] = 1;
for (int &w : c[v]){
dfs1(c, w);
sz[v] += sz[w];
if (sz[w] > sz[c[v][0]]){
swap(w, c[v][0]);
}
}
}
void dfs2(vector<v... | ALGO | 0.999531 | 4.206744 | {
"github_metadata": {
"branch": "master",
"commit_count": 651,
"repo_created_at": "2020-03-01T02:40:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3c1200... |
d2a91cef-5cab-4559-9ae4-25831655b820 | textualbois/cpp01 | ex02/main.cpp | #include <iostream>
#include <string>
int main() {
std::string the_brain = "HI THIS IS BRAIN";
std::string *stringPTR = &the_brain;
std::string &stringREF = the_brain;
// Display the content of the string directly
std::cout << "Content directly: " << the_brain << std::endl;
// Display the address of the string... | TOOL | 0.909305 | 6.007555 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2024-08-31T10:40: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": "7275c740d... |
1552f097-26c6-4821-a99c-56dead64138f | shashwat0105/CPP-Data-Structures-and-Algorithms | 04 (Linked List)/Practice Problems/14) intersectionOfTwoLinkedLists.cpp | https://leetcode.com/problems/intersection-of-two-linked-lists/
https://youtu.be/u4FWXfgS8jw (Striver)
1->2-
\
8 -> 7 -> 6 // yaha wala 8 hai intersection though pehle 1, 1 value same ho chuki hai(nodes are same not just value)
/
2->8->1 -
// Brute Force
// TC = O(m*n)
// SC = ... | ALGO | 0.999847 | 5.392309 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2021-01-23T10:22:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7cf377ed... |
7773d5c6-296b-4ac3-a06a-b36cd7fddfb6 | kidw0124/PS | 백준/Silver/24840. Challenge Nine/Challenge Nine.cc | #include<bits/stdc++.h>
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
typedef long long ll;
typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
#define pb(x) push_back(x)
#define all(x) (x).begin(), (... | ALGO | 0.999916 | 4.008636 | {
"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": "d3336932c... |
746f73d8-8c48-4ddd-8ffa-90b743787f69 | kaloronahuang/KaloronaCodebase | Practices/BZOJ/BZ1101.cpp | // BZ1101.cpp
#include <bits/stdc++.h>
#define ll int
using namespace std;
const int MAX_N = 5e4 + 200;
ll mobi[MAX_N], sum[MAX_N], n;
bool vis[MAX_N];
int main()
{
for (int i = 1; i < MAX_N; i++)
mobi[i] = 1;
for (int i = 2; i < MAX_N; i++)
{
if (vis[i])
continue;
mobi[i... | ALGO | 0.999934 | 3.786804 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2018-11-02T01:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1039e2... |
59e67531-fdda-4bed-bf5e-3545f9401a33 | SJMA11723/Problem-solving | codeforces/Codeforces Round 964 (Div. 4)/F.cpp | /**
* Author: <NAME>
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
#define MAXVAL 200000
using namespace std;
const int MOD = 1e9 + 7;
int fact[MAXVAL + 1];
int bin_exp(int a, int b){
if(!b) return 1;
int tmp = bin_exp(a, b / 2);
if(b % 2) return 1ll * tmp * tmp % MOD * a % MOD;
... | ALGO | 0.999983 | 4.459181 | {
"github_metadata": {
"branch": "main",
"commit_count": 558,
"repo_created_at": "2022-10-19T22:29: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": "a4b3ecf903... |
cd5b44e1-2c73-4c0d-bc65-562a7b9ff86f | Marlin-Phone/code | cpp/luogu/P1328/Luogu_P_1328.cpp | // https://www.luogu.com.cn/problem/P1328
#include <bits/stdc++.h>
using namespace std;
#define int long long
// 剪刀 石头 布 蜥蜴人 斯波克
// 0 1 2 3 4
const int N = 200;
int a[N]; //
int b[N]; //
int n, na, nb; // n次猜拳 na周期 nb周期
int ascore = 0, bscore = 0;
int check(int a, int b) {
... | ALGO | 0.999961 | 4.130939 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2025-01-09T06:37:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cdea59e63... |
49e4e388-a713-4925-aa99-edf8dd96f980 | MRPT/mrpt | libs/poses/include/mrpt/poses/CPose3DQuatPDFGaussian.h | /* +------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| https://www.mrpt.org/ |
| |
| Cop... | ALGO | 0.986029 | 6.694838 | {
"github_metadata": {
"branch": "develop",
"commit_count": 9818,
"repo_created_at": "2013-10-19T21:09:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2056,
"forks": 644,
"issues": 26,
"pull_requests": 2
},
"file_meta": {
"content_id": "3... |
51ea483a-6694-400a-9bb2-42f793aca92a | Karikari1234/coding | July 2020/Week 2/Day 2/2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for (i = a; i < b; i++)
#define REP_ITER(it, v) for (it = v.begin(); it != v.end(); it++)
#define FASTIO \
ios::sync_with_stdio(false); \
cin.tie(0)
#define TEST(test) \
int test; \
cin >... | ALGO | 0.999899 | 3.224481 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2020-05-20T09:03:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "232abb71... |
8c757e09-550b-4073-a66b-f05c5c289bb5 | anuraganand/ICPC-Codes | Treap.cpp | struct node {
int key, prior, size;
node * l, * r;
node() {}
node() (int k, int p) : key(k), prior(p), l(NULL), r(NULL) {}
inline void update() {
size = 1 + l->size + r->size;
}
};
typedef node * pNode;
void split(pNode x, int key, pNode & l, pNode & r) {
if(!x)
l = r = NU... | ALGO | 0.999993 | 4.472773 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2016-04-29T12:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "608ecda... |
f7dbf61d-9299-4889-b519-0896602b0652 | Grdsznt/DMOJ-Solutions | GoodStrategy.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
/* TYPES */
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define mii map<int, int>
#define si set<int>
#define sc set<char>
#pragma GCC optimize "Ofast"
#p... | ALGO | 0.999916 | 3.627085 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-09-24T14:12: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": "31afa1ae50b... |
106e7b0f-05b3-437b-9be6-2bd03fe972ef | drwolf1999/algorithm_team_project | doyeop.h | #ifndef __doyeop__
#define __doyeop__ 1
#include "utils.h"
#include "file_manager.h"
typedef Pair<int, bool> Node;
/**
* This Algorithm is based by string matching (Aho-Corasick)
* 1. Insert S[1..k-1](prefix) and S[2..k](suffix) into prefix, souffix Aho-Corasick for k-mer S
* 2. Connect Edge when S.prefix == T.suf... | ALGO | 0.996795 | 3.881114 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-06-02T13:58:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2451145de... |
d17ffabd-9044-4d93-820b-3f73e4ada823 | aksamota/geeksforgeeks_practice | linked_list/reverse_a_doubly_linked_list.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node *next, *prev;
node(int x)
{
data = x;
next = NULL;
prev = NULL;
}
};
struct node *update(struct node *start, int p);
int main()
{
int t;
... | ALGO | 0.999858 | 5.133091 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-04-12T05:45: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": "5a80e5bf... |
3afe471d-e27f-44f8-a151-c022995d9995 | WiseCow/algorithm | BOJ/멤용액.cpp | #include <iostream>
using namespace std;
void marge_sort(int *arr, int left, int mid, int right)
{
int i = left, j = mid + 1, k = left;
int res[100005] = { 0 };
while (i <= mid&&j <= right)
{
if (arr[i] < arr[j])
res[k++] = arr[i++];
else
res[k++] = arr[j++];
}
if (i > mid)
{
while (j <= right)
{
... | ALGO | 0.999951 | 3.90471 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-09-21T06:41:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5e47cdf1d... |
b5c27709-65e4-4f55-b4bc-394b5ca9e77b | dev-saad808/data-structure-lab | lab05/question01.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node* pre;
node* next;
node(int d = 0)
{
data = d;
pre = NULL;
next = NULL;
}
};
class linkedList
{
node* head;
public:
linkedList()
{
head = NULL;
}
bool isEmpty()
{
if (head == NULL)
return true;
else
return false;
}... | ALGO | 0.992398 | 3.820653 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2020-10-26T17:29:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d45c632604... |
7a593faf-9cec-4825-93d1-1374e475c0ac | nikitautiu/table | src/variants/rules_ro.cpp | #include "rules_ro.hpp"
#include "../game_core.hpp"
#include "../phase.hpp"
namespace table
{
BoardState process_board(BoardState old_board, Turn moves) {
// face un set de mutari fie ele valide sau nu si returneaza BoardState-ul la final
for(const auto checker_move : moves) {
auto mov... | ALGO | 0.990134 | 5.001978 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2014-08-24T11:25:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bc9bd82... |
ac58e588-7f20-463a-9add-e46075eced3a | mpaweria/CPP | Heaps/ReOrganiseString.cpp | #include<iostream>
#include<queue>
using namespace std;
string reorganise(string str) {
int freq[26] = {0};
for(char ch: str)
freq[ch-'a']++;
priority_queue<pair<int, char>> maxHeap;
for(int i=0; i<26; i++) {
if(freq[i] > 0) {
maxHeap.push({freq[i], i+'a'});
}
... | ALGO | 0.999986 | 4.236568 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2024-02-16T08:06: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": "0e73e7286... |
95dc5ba3-1a71-49b8-92f5-bdc0d2233833 | jamesmtexas/Rubik | OLL.cpp | #include "Cube.hpp"
#include "OLL.hpp"
#include <iostream>
#include <string>
void OLL::solveOLL(Cube &cube) {
if (!checkEdges(cube)) {
int state = findEdges(cube);
while (state == 0) {
cube.moves("U");
state = findEdges(cube);
}
solveCase(cube, state);
}
if (!checkOLL(cube)) {
int... | ALGO | 0.999704 | 3.735854 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2017-01-16T14:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 3,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcadd8bb... |
0d7707e1-9dc1-4aae-b55d-f675434dcac8 | parissashahabi/Algorithm-Design-Cpp | Algorithm/D&Q/basteBandi.cpp | #include <iostream>
using namespace std;
bool is_fit(int arr[], int low, int high, int m, int k,int n) {
int tempk = k , i = low;
high = n-1;
while((m >= 1) && (i <= high)) {
label:
k -= arr[i];
if(k >= 0) {
i++;
if(i>high)
break;
... | ALGO | 0.999979 | 3.991529 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-05-12T15:20: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": "f0ba9a5bbb3... |
f42c4999-3ec5-40a6-9b36-6666a203a340 | Kibiandkimi/stu | Problem/YDXY/WF-Train/Day2-1/expr.cpp | //
// Created by kibi on 24-10-4.
//
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <stack>
#include <stdexcept>
#include <string>
#include <sys/types.h>
#include <tuple>
#include <vector>
using namespace std;
using ull = unsigned long long;
template<typename T>
T read() {
T s = 0, w = 1, c = g... | ALGO | 0.999624 | 4.570127 | {
"github_metadata": {
"branch": "master",
"commit_count": 250,
"repo_created_at": "2022-08-17T09:51: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": "b73828a1... |
d9a11135-af97-4933-926d-7f51b304b267 | RaiyanMahin/Online_Judge_Solve | CodeForces/GNU C++14/1353B | Two Arrays And Swaps/184264600.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
ll t; cin >> t;
while(t--)
{
ll n, k; cin >> n >> k;
vector < ll > a(n);
vector < ll > b(n);
for(ll i = 0; i < n; i++)
cin >> a[i];
for(ll i = 0; i < n; i++)
cin ... | ALGO | 0.999989 | 3.555201 | {
"github_metadata": {
"branch": "main",
"commit_count": 1726,
"repo_created_at": "2023-04-09T19:34: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": "8716099a1... |
07f77426-e20a-4c3f-86a1-3e97f125f6a7 | yigitcankzl/Algorithm-Competition-Winter-Camp-2025 | altay_who_whispers_to_arrays.cpp | #include <bits/stdc++.h>
using namespace std;
void printvec(const vector<int>& vec) {
for (int x : vec) {
cout << x << " ";
}
cout << endl;
}
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<pair<int, int>... | ALGO | 0.999994 | 3.743325 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-02-04T10:04:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13a2c7830908... |
40ec7c41-b08e-402f-9eda-6993bfff3135 | MJYCo-Ltd/VersionMath | Src/SatelliteToolKit/Src/SatelliteToolKit_Angle.cpp | #include <cmath>
#include <GisMath/GisMath.h>
#include <SatelliteToolKit/SatelliteToolKit.h>
/// 计算两个卫星和地面站的夹角
std::vector<double> Cal2SatGroundAngle(const std::vector<PV>& vAx,
const std::vector<PV>& vBx,
const Pos& rGroundStation)
{
std::vector<... | ALGO | 0.997948 | 4.454934 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2021-03-18T17:36:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7f4f0b7e3... |
b260fcd4-1b0a-4a1c-8ff8-0f856f6b4eef | DrC0okie/HEIG_PRG1_Labos | HEIG_PRG1_Labo22/VanHove_Labo22_5.24.cpp | // File: VanHove_Labo22_5.24.cpp
// Author: <NAME>
// Date: 11.11.2021
// Compiler: g++ 11.2.0
// Options: -std=c++20 -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -pedantic
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void display(const vector<int> &... | TOOL | 0.988173 | 5.741201 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-03-09T08:36: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": "90d805deb693... |
00638e02-9ff9-41ed-b5db-54071865c350 | peacewang017/leetcode_cpp | graph/lc200.cc | #include <vector>
using namespace std;
class Solution {
private:
void remove_all_near_char1(vector<vector<char>>& grid, int i, int j) {
int m = grid.size(), n = grid[0].size();
if (i < 0 || i >= m || j < 0 || j >= n) {
return;
}
if (grid[i][j] != '1') {
re... | ALGO | 0.999956 | 6.095549 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-12-23T13:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebd39a14e0... |
9e76b8e8-259c-4cce-80bb-f0dab5119076 | QMCPACK/qmcpack | src/Platforms/OMPTarget/ompBLAS.cpp | //////////////////////////////////////////////////////////////////////////////////////
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2020 QMCPACK developers.
//
// File developed by: <NAME>, <EMAIL>, Argonne N... | ALGO | 0.913375 | 6.837992 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28915,
"repo_created_at": "2017-01-11T19:02:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 345,
"forks": 147,
"issues": 438,
"pull_requests": 16
},
"file_meta": {
"content_id": ... |
27381df1-010d-4488-bc82-5e6d03524823 | kss418/BOJ | 백준/Gold/10216. Count Circle Groups/Count Circle Groups.cc | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define fastio cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
#define all(x) (x).begin(... | ALGO | 0.999777 | 5.127138 | {
"github_metadata": {
"branch": "main",
"commit_count": 1502,
"repo_created_at": "2022-09-09T06:57:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39efcf75b... |
238a7635-07a0-428c-a8df-f5d961ace1a7 | rafim19/bootcamp-korban_dunia_nyata_i | Number_3.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
// #include <math.h>
// #include <unistd.h>
// #include <conio.h>
struct node {
int dt;
struct node* next;
};
void printMiddle(struct node* head);
void push(struct node** head_ref, int new_data);
void printList(struct node* ptr);
int main() {
st... | ALGO | 0.999577 | 5.147048 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-12-22T12:04: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": "3f4e08db527b... |
b13dd626-cea2-40c8-bc23-a37c40a0ac7a | joao-conde/competitive-programming | online-judges/csa/adaptive-binary-search.cpp | // https://csacademy.com/contest/archive/task/adaptive-binary-search/
#include <bits/stdc++.h>
using namespace std;
/* TIL:
* 1 - binary search algorithm for problems like this, well explained at:
* https://www.quora.com/What-is-the-correct-approach-to-solve-the-SPOJ-problem-Aggressive-cow
*
* 2 - we kno... | ALGO | 0.999877 | 3.574383 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2020-10-16T23:57:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4412472d... |
87097a28-b522-4bf0-bbd3-802f3695d91a | ishandutta2007/codeforces-i | i_love_tanya_romanova/normal/370/A.cpp | /*
Destiny, feel disgrace.
I'm the one that's fallen.
I'm the one in pain.
I'm the one that's going.
Forces decay in pain, by the light.
The suffer is cold.
There's colors
Searing his face.
Drifting through the sorrow.
The visions yet display.
It strips the soul completely empty.
Sirens rage in vain.
Drifting throug... | ALGO | 0.999775 | 3.220256 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "bbe21818e456... |
24436ecb-beae-4cfa-96b6-bbc82a62cb35 | Alberto-SC/Competitive-Programming-solutions | Codeforces/CwD Educational Graph Mashup/j.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define __ ios_base::sync_with_stdio(false),cin.tie(NULL);
const int maxn = 200007;
vector<int> graph[maxn];
vector<int> disc(maxn),low(maxn),vis(maxn),bridge(maxn),value(maxn);
int idx;
void dfs(int u,int p = -1){
disc[u] = idx++;
vis[u]... | ALGO | 0.999923 | 3.985187 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-07-20T03:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d80e67611219... |
d5f4f6f3-7f3b-4e6b-ac80-b44fe26c8be8 | callmePicacho/Data-Structres | 编程作业/37.KMP 串的模式匹配.cpp | /*#include<iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef int Position;
#define NotFound -1
using namespace std;
void BuildMatch(char *pattern,int *match){
int i,j;
int m = strlen(pattern);
match[0] = -1;
for(j=1;j<m;j++){
i = match[j-1];
while((i>=0) && (pattern[i+1] != pattern[j])... | ALGO | 0.999881 | 4.142076 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-05-08T11:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3576,
"forks": 513,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd2b... |
d223c80d-db23-4c50-8ec3-bb824e658624 | mavenlin/cuda-convnet | thirdparty/thrust/system/omp/detail/copy.inl | /*
* Copyright 2008-2012 NVIDIA Corporation
*
* 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... | ALGO | 0.994412 | 7.591837 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2014-02-21T06:51:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 23,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "b47d511... |
7e9ec1f2-72bc-4b05-9a0f-3333e82d5964 | I3J03RN/ProgrammingChallenges | OnlineJudge/388 Galactic Import/galacticImport.cpp | #include <cmath>
#include <forward_list>
#include <iostream>
#include <queue>
#define getIndex(x) (x - 'A')
#define getId(x) (char)(x + 'A')
using namespace std;
struct Planet {
uint8_t index;
bool end;
double value;
forward_list<Planet*> dests;
};
ostream& operator<<(ostream& os, const Planet& plan... | ALGO | 0.999555 | 4.170044 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2019-06-23T16:17: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": "b77e7b11... |
2a84a210-0055-42ca-8ec8-cde5c6d370ea | Taebee00/CodingTest | Inflearn_7/Baekjoon_1344.cpp | #include <bits/stdc++.h>
using namespace std;
double A,B,ret;
// 1~18까지 소수가 아닌 수로 배열 선언
int arr[11]={1,4,6,8,9,10,12,14,15,16,18};
int main()
{
cin >> A >> B;
// 2차원 배열을 통해 18 combination n을 구현
for (int i=0;i<11;i++){
for (int j=0;j<11;j++){
double A_com=1,B_com=1;
double ... | ALGO | 0.999675 | 4.007089 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2023-02-27T15:59: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": "cb21d04e7a... |
0d977016-aa5b-415a-8ad9-3888dd7079fb | Jun2-Lee/AlgorithmStudy | Junhee/week2/1446_지름길.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct road {
int start;
int end;
int len;
};
int dp[10001];
vector<road> fast_road;
int main() {
int n, d;
cin >> n >> d;
for (int i = 0; i < n; i++) {
road temp_r;
cin >> temp_r.start >> temp_r.end >> temp_r.len;
fast_r... | ALGO | 0.999741 | 3.888555 | {
"github_metadata": {
"branch": "main",
"commit_count": 317,
"repo_created_at": "2024-03-11T12:32:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abb559b5a5... |
156ecbd1-2123-41c0-a147-9ca26181575c | jianzhi-1/algorithm | misc/hashing.cpp | #include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
using namespace std;
#define ll long long
ll mod = 1e9 + 9;
ll p = 41;
string s;
ll running_hash[50];
ll inv[50];
ll power(ll a, ll b){
if (b == 0) return 1;
if (b == 1) return a;
ll half = power(a, b/2);
half *= half;
half %= mod;
if ... | ALGO | 0.999979 | 4.55197 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2020-05-14T15:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21baa1f2... |
9d5080a6-f8a9-4e0b-823b-179d89ac0110 | aFleetingTime/MySmallTarget | Day20/BinaryTree/BinaryTree.hpp | #pragma once
#include <iostream>
#include <string>
#include <stack>
using namespace std;
template<class D_Type> struct BinaryNode;
template<class D_Type> struct ThreadedBinaryNode;
template<class D_Type>
struct ThreadedBinaryNode
{
public:
ThreadedBinaryNode(BinaryNode<D_Type> *left, BinaryNode<D_Type> *right, boo... | ALGO | 0.999108 | 4.340389 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2018-01-15T10:37: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": "23399a79... |
9a6391cd-c613-463d-abee-c59118ccad0f | Nikita12200/C- | circular_queue.cpp | #include<iostream>
using namespace std;
int insert_in_cqueue(int[],int);
void display_cqueue(int [], int,int);
int del_from_cqueue(int []);
const int size=7;
int CQueue[size], front=-1, rear=-1;
int main()
{
int Item , result, num;
do
{
cout<<"\t\t\t MENU FOR CIRCULAR QUEUE:\n";
cout<<"\t 1.Insert\n";
c... | ALGO | 0.997793 | 4.021505 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-30T06:00: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": "91719a9dec5f... |
59bd6693-6518-41dd-8e59-24146665f959 | Yu0727Harada/pro_con | ABC/diverta2019/c.cpp | //
// Created by 原田 on 2021/09/29.
//
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cs... | ALGO | 0.999929 | 4.187645 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-08-09T08:23: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": "b7a2a43f... |
119cfc7a-48be-4035-b914-76e21c8be460 | mikeTerentev/Labs | Discrete Math/KOMB/nextperm.cpp | #include <iostream>
#include <vector>
using namespace std;
void out(vector<int> a, int p) {
for (int i = 0; i < p; i++) {
cout << a[i] << " ";
}
for (int i = a.size() - 1; i >= p; i--) {
cout << a[i] << " ";
}
cout << endl;
}
void fall(int n, vector<int> a) {
for (int i = 0; i... | ALGO | 0.999994 | 3.728129 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-24T10:07:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "936478b308... |
68e6e5d4-7d18-434d-ba59-b5179aaafaeb | stachu3478/sort_universe | sort_algorithms/quick/quick.cpp | #include <stdlib.h>
#include <cstdio>
#include <iostream>
using namespace std;
typedef int pivot_getter(int maxx);
int random_pivot(int maxx) { return rand() % (maxx + 1); };
int right_pivot(int maxx) { return maxx; };
// Quick sort - recurences - pivot as first element
int* quick_sort(int* arr, int length, pivot_get... | ALGO | 0.999865 | 4.770197 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-03-04T21:02: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": "19ca1ad03... |
c5a07f1c-a677-41fa-9d53-0e8c84b8ecc3 | YttriumWillow/OI | ContestData/NFLS CSP-S-20221001/.origin/C1.cpp | #include <bits/stdc++.h>
using namespace std;
const int base[] = { 131, 13331 }, mod[] = { 1000000007, 998244353 };
char a[100005];
long long h0[2][100005], h1[2][100005], pw[2][100005], res[27][100005], cf[100005];
inline long long ha0(int k, int l, int r) {
return ((h0[k][r] - h0[k][l - 1] * pw[k][r - l + 1]) % m... | ALGO | 0.999988 | 3.645376 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2023-08-30T03:08: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": "0c1002ee906... |
f1820c2b-1b82-4a35-996a-d58097fa61a7 | MAA-web/CS221 | Labs/lab_I_dynamic_array_pointer_III.cpp | #include <iostream>
using namespace std;
int main() { // Main function
cout << "\n\t\tThis program stores values in a dynamic array and then displays them in reverse\n";
int size{0};
cout<<"\nType the value of the size of the array: ";
cin >> size;
int *arr = new int[size];
cout << "\... | ALGO | 0.951872 | 4.022254 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-21T05:51: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": "039cd75e6806... |
aa23ad05-ec49-4862-b4eb-e20fabe5989f | lxs137/leetcode_practice | algorithm/24/swap_nodes_in_pairs.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* swapPairs(ListNode* head) {
if(head == NULL || head->next == NULL)
return head;
... | ALGO | 0.999994 | 5.980247 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-07-06T15:09: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": "e4946b55d... |
5574c565-a790-4558-8144-088ae4f39653 | ManavFitter061/GFG_subs | Medium/Longest subarray with sum divisible by K/longest-subarray-with-sum-divisible-by-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int longSubarrWthSumDivByK(int arr[], int n, int k)
{
// Complete the function
map<int,int> track;
int ans=0;
track.insert({0,-1});
vector<int... | ALGO | 0.999825 | 5.564539 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2024-01-07T18:06: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": "6a9141f5e6... |
67e0797e-586a-46d5-bc15-4eb1c0147139 | patelsoham78/Soham_Sojitra-Ajmera | main.cpp | #include <bits/stdc++.h>
using namespace std;
//Function for extraction money and return the balance amount after the transaction
//returns -1 for unsuccessfull transation
int extract_money(int balance,int value)
{
if(value%500==0)
{
if(balance>=value) //checking the condition of debit amount is ... | ALGO | 0.992131 | 4.284253 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-10-06T09: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": "2c90844f8728... |
141dc7d7-8ff5-44d4-a946-ef63e3b99155 | j-silver/AdventOfCode | encoding_error.cpp | #include <filesystem>
#include <fstream>
#include <iostream>
#include <ranges>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cassert>
constexpr int window {25};
bool is_sum(unsigned long long num, std::ranges::range auto const& slice)
{
for (auto pos : std::ranges::iota_view{0UL, std::ranges... | ALGO | 0.997694 | 5.682841 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2020-12-05T17:26: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": "e2aef403c8f0... |
251a9073-9c39-45aa-96ae-5e35f81687d8 | byr-ly/leetcode | leetcode_ly/c++/Stack/VerifyPreorderSerializationTree.cpp | class Solution {
public:
bool isValidSerialization(string preorder) {
if(preorder.size() == 0) return false;
stack<string> s;
vector<string> s1;
int start = 0;
int count = 0;
int i;
for(i = 0; i < preorder.size(); i++){
if(preorder[i] != ','){
... | ALGO | 0.999272 | 5.615889 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2016-12-30T02:40:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 94
},
"file_meta": {
"content_id": "bbf9034e... |
3a71d9a3-b96b-46d1-9495-2fe936481767 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/05/0506/personal_submission/cf653c_lyxxys.cpp | /*
发现:
不可能只有 1 个位置不合法
最多只有 6 个位置不合法,超过就不可能满足条件了
只有当有 2、3 个位置不合法时,内部和外部的交换才有意义。
想要纠正这些位置,直接考虑暴力枚举内部之间的交换、内部和外部的交换。
*/
void solve(){
int n;
cin >> n;
vector <int> A(n);
for (auto &x : A){
cin >> x;
}
auto w = [&](int i)->int{
int v;
if (i%2 == 0){
... | ALGO | 0.999935 | 3.861422 | {
"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": "32a7... |
b137d291-e3cc-48d7-8963-6c8c388ee0b8 | rawat-divyanshu/Data-Structures-And-Algorithms-Implementation | 1. Linked Lists/Circular Linked Lists/6. Deletion from Beginning, Ending and Specified Position in a Double Circular Linked List.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node *prev;
Node *next;
};
Node *HEAD = nullptr;
// Function to dynamically allocate the memory for requested data
Node *makeNode(int data) {
Node *ptr = new Node();
ptr->data = data;
ptr->next = nullptr;
ptr->prev = nullpt... | ALGO | 0.995794 | 6.247605 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-07-31T19:22:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "baa1f5e6... |
e848683a-dd38-42c8-955a-7d6023c9840f | sazzyness/researchProject | strongPseudoprimeTest.cpp | #include<iostream>
#include<gmpxx.h>
using namespace std;
int main(){
mpz_t n, b, t, test, temp;
// Edit the following line to set the number you want to test
mpz_init_set_str(n, "2047", 10);
// Edit the following line to change the base
mpz_init_set_str(b, "2", 10);
mpz_inits(test, temp);
... | ALGO | 0.998919 | 4.011951 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-10-06T02:44: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": "2e0d941aa... |
53a5ddee-4b0d-4d36-8595-d80c3a92b5f1 | NHouse328/Irrigacao_ESP8266_DHT11_Chuva | Estacao_de_Irrigacao_Chuva_e_DHT11/Estacao_de_Irrigacao_Chuva_e_DHT11.ino | //Progeto Irrigacao automatica com controle de chuva e humidade
//Sensor de temperatura e umdade DHT11
#include "DHT.h" // Inclui a biblioteca DHT
#define DHTPIN D3 // Define que OUT será conectado em D3
#define DHTTYPE DHT11 // Define o modelo de sensor como DHT 11
DHT dht(DHTPIN, DHTTYPE);
//Relogio
#include <Wi... | TOOL | 0.907774 | 5.910201 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-10-27T01:05: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": "19d65a690f6f... |
57b7f1f2-193c-4c56-9347-66ab0296bb25 | AjayPratapSingh810/CompleteDSA | BST2.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
left = NULL;
right = NULL;
}
};
void insertIntoBst(Node *&root, int data)
{
if (root == NULL)
{
root = new Node(data);
... | ALGO | 0.99996 | 4.488104 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-30T12:06: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": "2f5ee50923fa... |
e0215088-61b9-4dfb-bb3d-ab25b8f0dd08 | qingfengforum/cecil_liscence | ref/DES_from_web/DES_test_main.cpp | #include <iostream>
#include <fstream>
#include <bitset>
#include <string>
using namespace std;
#include "DES.h"
bitset<64> key; // 64位密钥
/**********************************************************************/
/* 测试: */
/* ... | TOOL | 0.987749 | 3.524872 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-15T10:41: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": "9a58e77194... |
31afec1c-c8ac-48d7-b73c-9ec2a4475a8b | katherinBK/c- | procesoII.cpp | #include <iostream>
#include <random> //libreria para generar numeros de forma aleatoria
int main (){
//declaramos las variables a ser utilizadas
int lim = 0;
int num = 0;
int suma = 0;
float promedio = 0;
std::cout << "Ingrese un numero entre 0 y 10";
std::cin >> lim;
//una condicional para ve... | ALGO | 0.988571 | 3.476492 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-30T18:36: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": "da172978081e... |
fc6fbde4-02a9-450f-abe3-41b666090ec4 | rafaelsntl/.Cpp-Files | Fourth week - Interfaces/Arithmetic with fractions/Main.cpp | #include <iostream>
#include <locale>
#include <iomanip>
using namespace std;
#include "Fractions.cpp"
int main ()
{
setlocale(LC_ALL, "Portuguese");
Fracao f1, f2, fr; //Objetos da classe Fracao
//Variáveis que seram ultilizadas aqui na main
int Digitado, F1num, F1den, F2num, F2den;
//Explicando o pro... | TOOL | 0.917833 | 5.09524 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-05-26T01:07:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eaa5515c79... |
9a941555-fa6b-4166-afa6-a28e122c8b24 | viveksawant11/Code360-GFG-Problems | Intersection of Two LL-EASY(11-12-24).cpp | #include<bits/stdc++.h>
using namespace std;
class Node { // Brute force - 'Data replacement' using Stack
public: //
int data; //
Node* next; ... | ALGO | 0.999995 | 5.064409 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-11-21T05:29: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": "d0ed0920d90... |
ced1ba7f-2ad2-420f-b5f3-a0ded77f78a0 | arpitgo4/Coding-Problems | Contests/Codeforces Global Round 28/A. Kevin and Combination Lock.cpp | // <NAME> and Combination Lock (https://codeforces.com/contest/2048/problem/A)
#include <iostream>
using namespace std;
// Time: O(1)
// Space: O(1)
/**
* If x is multiple of 33 (11, 3) we can reduce it to zero by
* subtracting (33, 11, 3) from it.
*
* 33 == 0 (substract 11, 3 times)
* 33 == 0 (substract ... | ALGO | 0.998129 | 4.418577 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2023-10-23T23:35:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bbc39464d... |
c77a4e1a-ae72-4b69-aef4-cff99b0cc674 | asimali246/Spoj-solutions | 1837.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <set>
#include <cstring>
#include <iomanip>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <string>
#include <vector>
#include <new>
#include <bitset>
#include <ctime>
#include <cassert>
#i... | ALGO | 0.999313 | 3.836115 | {
"github_metadata": {
"branch": "master",
"commit_count": 347,
"repo_created_at": "2014-03-03T18:42:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "043452b5... |
0964f57e-b560-4a18-8ec4-c9fe439b7e3e | RaykoEZ/RnD_Light | RnDLights/Source/RnDLights/DistLevelDetecter.cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "DistLevelDetecter.h"
// Sets default values
ADistLevelDetecter::ADistLevelDetecter()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEve... | TOOL | 0.980077 | 4.143453 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2018-10-22T13:26: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": "4c5e703ed... |
01ea5895-a8fe-4c30-8a99-1e1ef9090f94 | ACM-TOMS/CALGO | 0965/Original-Submission/examples/brusselator_mkl/brusselator.cpp | #include <stdlib.h>
#include <omp.h>
#include <time.h>
#include <stdio.h>
#include "mkl.h" // MKL Standard Lib
#include "mkl_lapacke.h" // MKL LAPACK
#include <cmath>
#include "ridc.h"
#include "brusselator.h"
int main(int argc, char *argv[]) {
int order, nt,neq;
double *sol;
if (argc != 4) {
printf("usage... | ALGO | 0.998502 | 4.202706 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-11-17T18:24:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "50dcf6615b7... |
f8b58d44-208d-4089-95da-161d0da977e4 | raywan/rays | src/bvh.cpp | #include "bvh.h"
#include "mesh.h"
#include "world.h"
#include "metrics.h"
#include <rw/rw_th.h>
#define BOUND_MESH 0
#define DEBUG 0
uint32_t xor_shift_u32(uint32_t *state) {
uint32_t x = *state;
x ^= x << 13;
x ^= x >> 17;
x ^= x << 15;
*state = x;
return x;
}
BVHNode *bvh_leaf_node(int prim_idx, int ... | ALGO | 0.999405 | 5.756966 | {
"github_metadata": {
"branch": "old",
"commit_count": 19,
"repo_created_at": "2019-05-15T20:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7310baab445e... |
b37db805-9bf0-4072-b05e-0484dd1e503d | GenryMacros/Graph_Path_Search | GraphSearch/Graph(SearchWave).cpp | #include "Graph.h"
void Graph::SearchWave(int thisX, int thisY, int startX, int startY, sf::RenderWindow& win) {
bool** checked;
checked = new bool* [winWidth];
for (int i = 0; i < winWidth; i++) {
checked[i] = new bool[winHeight];
for (int j = 0; j < winHeight; j++) {
checked[i][j] = false;
}
}
int** w... | ALGO | 0.999248 | 3.682978 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-10T14:22: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": "aa77691b8ff5... |
054d8e85-f6ae-4d18-8f86-b94bc7f76f4e | HassnHamada/CP-Solutions | 580C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10, M = 1e6 + 10, MOD = 1e9 + 7, HV = 151, INF = 0x3f3f3f3f;
int arr[N];
vector<int> tre[N];
int dfs(int m, int n = 1, int p = 0, int c = 0)
{
if (c + arr[n] > m)
{
return 0;
}
int sz = tre[n].size() - (p ... | ALGO | 0.999909 | 3.700428 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2022-02-11T19:29: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": "25171ef89... |
53813f7e-4e38-47ce-83fb-38f8bfb46d74 | llvm/llvm-project | llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h | //===-- LVSupport.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.912545 | 6.703586 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
3aceea44-421e-43e4-abea-50d0c06cf064 | Derwin1296/USACO | 2019 December Gold/G1.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vect... | ALGO | 0.999947 | 3.541887 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2019-01-03T22:47: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": "4608f9e07... |
6f694282-c3c2-4c96-92fc-416b83fd1ff6 | alexandraback/datacollection | solutions_2645486_0/C++/LauZi/pb.cpp | #include <cstdio>
typedef long long ll;
int arr[10], n;
int e, r;
ll dfs(int j, int lc, ll acc) {
if (j == n) return acc;
ll M = 0;
int i = lc + r - e;
if (i < 0) i = 0;
for (; i <= lc; ++i) {
ll na = dfs(j + 1, lc - i + r, acc + (ll)i * arr[j]);
if (na > M) M = na;
}
return M;
}
ll jizz() {
... | ALGO | 0.99986 | 3.591764 | {
"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": "6e2833a00... |
9029a78f-6e1a-4895-8dbe-01fe50ad2383 | Algorithm-Study-20210502/Algorithm | 김혜준/백준 & 프로그래머스 문제/0523 DFS , BFS/10026 - 적록색약.cpp | #include <iostream>
using namespace std;
char board1[101][101];
int visit1[101][101];
char board2[101][101];
int visit2[101][101];
int N,ret1,ret2;
int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,-1,1};
void DFS1(int,int,char);
void DFS2(int,int,char);
int check1(int,int);
int check2(int,int);
void solve1();
void solv... | ALGO | 0.998301 | 3.093518 | {
"github_metadata": {
"branch": "main",
"commit_count": 412,
"repo_created_at": "2021-05-02T08:24:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7d66be3e39... |
bfe5ac58-9906-4ca0-a59a-6225cda361bd | MortezaHassani/codinGame | Skynet Revolution - Episode 1.cpp |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
bool delet_node(map<int, vector<int> >& graph,map<int, vector<int> >::iterator& it1,vector<int>::iterator& it2)
{
map<int, vector<int> >::iterator it=graph.find(*it2);
vector<int> ::iterator itt=fi... | ALGO | 0.999845 | 3.868264 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-01T08: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": "edff7b5557... |
4b139076-6191-4c7b-93c5-6842e74a59a5 | Ali-2605/Data-structures-and-Algorithms- | trees/queueCPP.h | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
#ifndef QUEUECPP_H
#define QUEUECPP_H
class Node
{
public:
Node *leftChild;
int data;
Node *rightChild;
};
class Queue
{
private:
int front;
int rear;
int size;
Node **Q;
public:
Queue()
{
front = rear = -1;
s... | ALGO | 0.982019 | 4.533885 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-08-26T10:46: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": "11559efb1f7... |
90aa1763-5e2b-4844-b251-ad0eb6d2587a | biug/pkunlp | common/parser/fittings/pseudo_tree.cpp | #include "pseudo_tree.h"
int PseudoTreeFitting::arcScore(const int & head, const int & pred, const CoNLL08DepGraph & goldGraph, const CoNLL08DepGraph & cGraph, const std::vector<CoNLL08DepGraph> & pGraphs, const std::vector<CoNLL08DepGraph> & nGraphs) {
bool bAppear = pGraphs.empty() && nGraphs.empty();
int scoreInd... | ALGO | 0.998273 | 4.652434 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2016-10-28T04:07:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "adeacc9c... |
967c4243-63e0-404b-8802-8d011f7cbbaa | MMSS9402/algorithm | ProblemSolving/mincode/level38/38-5.cpp | #include <iostream>
#include <queue>
using namespace std;
struct Node
{
int elsax;
int elsay;
int annax;
int annay;
int lev;
};
int n;
char map[6][6];
int result[5][5];
int used[5][5];
int direct1[8][2] = {
0,1,
1,0,
0,-1
-1,0,
1,1,
-1,-1,
1,-1,
-1,1
};
int direct... | ALGO | 0.999902 | 4.240605 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2023-12-22T09:19: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": "e7a6d737c88... |
d9fb3517-b00c-4829-9181-3ec30a3d4486 | i1red/labs-2nd-sem | other-tasks/matrix/main.cpp | #include <iostream>
using namespace std;
void ERROR(const char *log)
{
cout << "ERROR: " << log << endl;
system("pause");
exit(1);
}
class matrix {
struct node {
int DATA;
int I; int J;
node *RIGHT; node *DOWN;
node(int set_data, int set_i, int set_j)
{
DATA = set_data; I = set_i; J = set_j; RIGHT = ... | ALGO | 0.999519 | 3.82878 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-09-15T12:08: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": "98f764c43... |
a5c5b799-43cd-4b44-b1bb-fc9744586e1f | dsonyy/cpp-stuff | cli/warcaby/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include "checkers.h"
using namespace std;
int main(int argc, char** argv) {
// Domyslne wartosci wag
int wl = 1;
int wp = 1;
int wb = 1;
// Interpretowanie przekazanych do programu parametrow
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h") ... | ALGO | 0.989538 | 4.155366 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-05-02T12:34: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": "beb8bbd06... |
d1ac2e54-cb21-46f9-ba0a-4c2bf8029c1c | zhishang72/OpenLBM | src/bouncebackNode.cpp | #include <iostream>
#include <vector>
#include "latticeBase.hpp"
#include "collisionBase.hxx"
#include "streamBase.hxx"
#include "latticeModel.hxx"
#include "latticeNode.hxx"
#include "boundaryNode.hxx"
#include "bouncebackNode.hpp"
bouncebackNode::bouncebackNode
(
latticeBase &lb,
collisionBase *cb,
l... | ALGO | 0.99556 | 6.016274 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-05-15T17:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 18,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "49a3b1a... |
1836fb08-cefe-41c1-84d6-6beb27fd6e2c | Maximusthr/Programacao-Competitiva | codeforces/Questoes/Div 2/A/A_Dubstep.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0); cin.tie(NULL);
string x; cin >> x;
int tamanho = (int) x.size();
vector<string> words;
string aux;
bool ok = false;
for (int i = 0; i < tamanho; i++){
if (x[i] == 'W'){
if (i+1 < t... | ALGO | 0.999739 | 3.683456 | {
"github_metadata": {
"branch": "main",
"commit_count": 618,
"repo_created_at": "2025-02-09T20:56: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": "568adad2ec... |
23f37710-1967-427c-8a33-df6a2796e8cf | falcopt/f4d | cobra/operators/TwoTwoExchange.hpp | #ifndef _F4D_TWOTWOEXCHANGE_HPP_
#define _F4D_TWOTWOEXCHANGE_HPP_
#include "AbstractOperator.hpp"
namespace cobra {
template <bool handle_partial_solutions = false>
class TwoTwoExchange : public AbstractOperator {
public:
TwoTwoExchange(const Instance &instance_, MoveGenerators &moves_, float tol... | ALGO | 0.993751 | 5.809146 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-10-23T18:51:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a246664a626... |
b076fcd6-f557-40ac-b935-efdc3104a83b | tmastercoding/clang | USACO/Bronze/BronzePractice-C/s37-test.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int size;
cin >> size;
string cows;
cin >> cows;
int groups[300000][2];
int gSize = 0;
bool hasFound = false, hasStart= false;
for(int idx = 0; idx < size; idx++){
if(!hasFound){
if(cows[idx] ==... | ALGO | 0.999985 | 3.3507 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-10-01T10:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "06a6e9ecd44... |
2c48921a-23e4-4d5c-b71a-92f326d6c8ae | Lillard01/chatExcel-mcp | venv/lib/python3.11/site-packages/scipy/special/xsf/cephes/ellpk.h | /* Translated into C++ by SciPy developers in 2024.
* Original header with Copyright information appears below.
*/
/* ellpk.c
*
* Complete elliptic integral of the first kind
*
*
*
* SYNOPSIS:
*
* double m1, y, ellpk();
*
* y = ellpk( m1 );
*
*
*
... | ALGO | 0.999772 | 5.775121 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-06-10T01:55:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 12,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "d839f7ec2... |
0c70f8e9-66cc-4e5b-b740-b10e92776baa | jariasf/CC126-2202 | Semana 3/Hoja de ejercicios/ejercicio1.cpp | #include <iostream>
using namespace std;
// 6 5 4
// 4 5 6
// 5 6 2
int calcularMayorDe3(int num1, int num2, int num3) {
bool es_mayor1, es_mayor2, es_mayor3;
int mayor;
es_mayor1 = (num1 > num2 && num1 > num3);
es_mayor2 = (num2 > num1 && num2 > num3);
es_mayor3 = !es_mayor1 && !es_mayor2; // (num... | ALGO | 0.999927 | 4.742321 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-08-16T15:13:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bef52d78211... |
3a4fd55d-c57c-4bc6-ba35-7bba6268795b | floghos/tallerprogra | 2019_1/aceptados/Listado_1/UVa12503.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int left = -1, right = -2;
int T;
cin >> T;
for (int i = 0; i < T; i++) {
int n;
vector<int> dir;
cin >> n;
for (int j = 0; j < n; j++) {
char c;
string temp;... | ALGO | 0.999912 | 3.871836 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-08-16T17:33: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": "ec833361e... |
80c9d17f-18a7-49fd-b1df-0cc129fde68f | moodgalal/Algorithms-with-C- | sort and search/main.cpp | #include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
int binarySearch(int arr[] , int size, int number)
{
int start(0) , end(size-1); // We must specify a starting , ending and middle pointers
while(start <= end)
{
int middle = (start+end)/2; /... | ALGO | 0.999557 | 3.167822 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-04-26T17:06: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": "980306fcb2... |
ebda1ad8-50e5-4067-bf7f-cce3bfa9b35c | JasToft/BME122DataStructures-AlgorithmsProjects | doublylinkedlist.cpp | /*
Authors: <NAME> and <NAME>
Purpose: Basic operations for the class of doubly linked list
Date: Feb 15, 2024
*/
#include <iostream>
using namespace std;
typedef int DataType;
struct Node {
DataType data;
Node *prev; // a pointer pointing to the previous node in the list
Node *next;
Node(int x) : dat... | TOOL | 0.992722 | 6.006632 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-14T02:11: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": "e986fa4233ff... |
1286cc6f-2e73-450a-bde2-7a8f6dc388d8 | priyanshuN/Algorithms | codeforces/D_Program.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi pair<int,int>
#define pii pair<int,pi>
#define IMA INT_MAX
#define IMI INT_MIN
#define pl pair<ll,ll>
#define pll pair<ll,pl>
#define ff first
#define mp make_pair
#define mod 1000000007
#define ss second
#define pb push_back
#define fr(i,s,n)... | ALGO | 0.999929 | 3.922422 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-03-03T16:24: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": "521db8a58... |
d3ed549f-4d35-4aae-932a-c424fc687b39 | RighteousGong/LeetCode | LinkedLists/ClassicProblem/a01.cpp | /*
反转链表
给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。
示例 1:
输入:head = [1,2,3,4,5]
输出:[5,4,3,2,1]
示例 2:
输入:head = [1,2]
输出:[2,1]
示例 3:
输入:head = []
输出:[]
提示:
链表中节点的数目范围是 [0, 5000]
-5000 <= Node.val <= 5000
进阶:链表可以选用迭代或递归方式完成反转。你能否用两种方法解决这道题?
作者:LeetCode
链接:https://leetcode.cn/leetbook/read/linked-list/f58sg/
来源:力扣(LeetCode)... | ALGO | 0.9998 | 6.19896 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-03-31T13:40: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": "95227fbf6b4... |
599cb2a6-5865-4661-8211-6d4899523b37 | salim002/Cpp-Codes | 50_DSA/10_queue/02_ll_implementation_of_queue.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){
data = val;
next = NULL;
}
};
class queue{
node* front;
node* back;
public:
queue(){
front = NULL;
back = NULL;
}
void push(int x){
node... | ALGO | 0.998668 | 4.026963 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-12-11T13:47: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": "5e11a5734f... |
7aaca5ea-83c0-4678-ab74-96cce6965269 | KiryuJiiro/DSA-concepts | stack/infixpostfix.cpp | #include<iostream>
#include<stack>
using namespace std;
bool operandornot(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
}
bool openingornt(char c) {
return (c == '(');
}
bool closingornot(char c) {
return (c == ')');
}
int precedencelevel(char c) {
if (... | ALGO | 0.999947 | 4.968269 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-03-17T11:29: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": "2131618cf3... |
eb9a8743-9cd3-45a2-84fd-c677f91329ae | crinn8/Facultate-Informatica-Aplicata | ANUL 1/SEMESTRUL 2/Structuri de date/Teme/Tema1/Problema7/Problema7/Problema7.cpp | #include <iostream>
#include <fstream>
void CitireVector(int &dim, int*& v,int &p)
{
std::ifstream f("numar.in");
f >> dim >> p;
v = new int[dim]();
for (int i = 0; i < dim; i++)
{
f >> v[i];
}
f.close();
}
void afisare(int dim, int* nou)
{
for (int i = 0; i < dim; i++)
{
... | ALGO | 0.999154 | 4.205769 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-05-05T08:41: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": "4b513e8e9c93... |
0cc70537-25f2-47f2-b985-a29aa6d1d699 | PARTHASAKHAPAUL/oops_MA5741 | Assignment 6/main_euler.cpp | #include <iostream>
#include <cmath>
#include "AbstractOdeSolver.hpp"
#include "forward_euler.hpp"
using namespace std;
int main()
{
// Creating an instance of ForwardEulerSolver
ForwardEulerSolver euler;
// Setting the step size, time interval, and initial value
euler.SetStepSize(0.1); // we can adju... | ALGO | 0.999971 | 5.999396 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-12-04T04:23:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ef8eaa00ce... |
36e59a45-a566-4e9e-aebd-7eee7115de10 | alexandraback/datacollection | solutions_5631989306621952_1/C++/jerrylinew/solution.cpp | //
// main.cpp
// Google Code Jam - Round 1A
//
// Created by <NAME> on 4/15/16.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <map>
#include <algorithm>
#include <fstream>
using namespace std;
int main() {
ifstream f... | ALGO | 0.999938 | 4.508721 | {
"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": "7b1010d8c... |
1d1c2d5f-8407-400f-b5f5-5a29c13c571b | chinhhi102/GiaiThuat | kattis/DFS/Molekule.cpp | #include <map>
#include <set>
#include <queue>
#include <cmath>
#include <vector>
#include <cstdio>
#include <bitset>
#include <cstring>
#include <cstdlib>
#include <complex>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <list>
#include <tuple>
#include <ctype.h>
#include <stack... | ALGO | 0.999971 | 3.66582 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-12-01T05: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": "bd30281d43... |
eb8a350e-8f81-4331-92c1-be0df620b08a | ishandutta2007/codeforces-k | kevinyang/normal/1404/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int t;
cin >> t;
while(t--){
int n,a,b,da,db;
cin >> n >> a >> b >> da >> db;
vector<vector<int>>adj(n+1);
for(int i = 0; i<n-1; i++){
int x,y;
cin >> x >> y;
adj[x].push_bac... | ALGO | 0.99995 | 3.847969 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c9b1050244b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.