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 |
|---|---|---|---|---|---|---|---|
8fa91f2e-23bb-41b1-8102-8401321b7a3b | askeySnip/OJ_records | UVa/10759.cpp | /*
ID: leezhen
TASK: practice
LANG: C++11
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <bitset>
#include <list>
using namespace std;
typed... | ALGO | 0.999599 | 4.053303 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2018-01-18T08:36:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6fbb211... |
af816d71-9e4d-44bf-a788-8b3f525be97d | Gorjess/LeetCode | graph-theory/common/graph.h | //
// Created by gorjess on 5/4/2022.
//
#ifndef GRAPH_THEORY_COMMON_GRAPH_H
#define GRAPH_THEORY_COMMON_GRAPH_H
#include <iostream>
#include <array>
#include <algorithm>
#include <queue>
#include "alias.h"
#include "random_engine.h"
/*
* An Undirected graph.
*
* An adjacency matrix is used to represent the grap... | ALGO | 0.992969 | 6.014127 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-01-01T14:39: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": "62de888ee... |
4c6ac3a2-9375-4d8a-b170-c182b66b4f36 | pettni/smooth_feedback | tests/ocp.hpp | // smooth: Lie Theory for Robotics
// https://github.com/pettni/smooth
//
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
//
// Copyright (c) 2021 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the... | TEST | 0.968595 | 7.09256 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2021-07-12T13:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 11,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ade885... |
300c0b81-90b9-4169-966b-febbf9481b12 | SatyamTank07/DSA | TREE/postfixevalution.cpp | #include <iostream>
#include <conio.h>
#include <cstring>
#include <math.h>
using namespace std;
char postfix[30];
int top = -1;
float s[10];
// void push(char ch);
// char pop();
void push(float ch)
{
top++;
s[top] = ch;
}
char pop()
{
float ch;
ch = s[top];
top--;
return ch;
}
int main()
{
... | ALGO | 0.999763 | 3.703136 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-03T18:26: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": "7bc0e4ed34fd... |
cc5c7901-787d-4dae-b810-d954ac687cfc | dhrubajyotinath6/Preparation | LEETCODE-QUESTIONS-main/98-validate-binary-search-tree/98-validate-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999969 | 5.695487 | {
"github_metadata": {
"branch": "master",
"commit_count": 465,
"repo_created_at": "2022-01-24T17:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcf59944... |
ae7029f5-74a4-4287-9c6d-f3f70eca2ec4 | Nikhil034/DsaWork | pascal.cpp | #include <iostream>
#include <vector>
std::vector<std::vector<int>> generatePascalsTriangle(int numRows) {
std::vector<std::vector<int>> triangle(numRows);
for (int i = 0; i < numRows; ++i) {
triangle[i].resize(i + 1);
triangle[i][0] = triangle[i][i] = 1; // First and last element in each ... | ALGO | 0.999851 | 6.996601 | {
"github_metadata": {
"branch": "main",
"commit_count": 326,
"repo_created_at": "2023-08-05T15:55:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d35393bc8d... |
f5aa9fd7-9be1-41b3-ba97-03832f141ad3 | mindspore-ai/mindspore | mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_ops/cpu_kernel/ms_kernel/lgamma.cc | /**
* Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | TOOL | 0.943637 | 6.879838 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
b871e80b-5338-4f1d-a89f-94ea2bbeab7d | work-fw/algorithms | Old/180325_permutations.cpp | #include "stdafx.h"
#include <iostream>
#include <vector>
using namespace std;
// 우선 갯수가 n팩토리얼 개이므로 최소 시간 복잡도도 마찬가지겠네요.
// n진법 수로 생각한 후에 하나씩 더할 수 있을까 생각했는데 이건 중복이 있어 순회가 아니고
// for 루프를 n번 반복해서 사용하면 구할 수 있겠는데, 우리가 for 루프를 타이핑 할 수는 업스니까
// for 루프를 재귀적으로 호출하면서 출력해 보겠습니다.
// 근데 또 찾아야 되는 부분이니까 result에 저장을..?
// 재귀적으로 for ... | ALGO | 0.999415 | 3.867049 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-07-09T11:15:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "004616f0b... |
c6bb725e-c0bb-47ba-9454-14564d261b93 | Yu-Lingrui/myself | opencv/官方课程opencv4/exam2.cpp | //#include <opencv2/opencv.hpp>
//#include <iostream>
//
//using namespace std;
//using namespace cv;
//
//void method_one();
//void method_two();
//
//int main(int argc, char** argv) {
// // Read the video
// method_one();
// return 0;
//}
//
//void method_one() {
// VideoCapture capture;
// capture.open("D:/Visual St... | ALGO | 0.978874 | 4.372524 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2021-10-17T14:21:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4abe4369... |
c835ac2e-b2bd-4448-b172-dd58e3600aa0 | Microduino/Microduino_Tutorials | Microduino_Joypad/Joypad_TVout/Joypad_mali/poofy_adventure2/snake.cpp | #include <avr/pgmspace.h>
#include <TVout.h>
#include "snake.h"
#include "snake_bitmap.h"
#include "bitmap_funcs.h"
#include "room.h"
#include "level.h"
#define SIZEOF_SNAKE_RECORD 10
#define SNAKE_VELOCITY 2
RoomElement snake_move(RoomElement element)
{
char facing = 0;
char tile_adjust;
//erase the old... | ALGO | 0.997274 | 5.593899 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2014-03-11T15:53:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 56,
"forks": 100,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "caaae... |
8edabcbc-6898-45d0-a924-019a6c8cee36 | OpenSees/OpenSees | SRC/system_of_eqn/linearSOE/bandSPD/BandSPDLinLapackSolver.cpp | /* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** ... | TOOL | 0.997356 | 4.50599 | {
"github_metadata": {
"branch": "master",
"commit_count": 8721,
"repo_created_at": "2018-09-12T00:49:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 667,
"forks": 719,
"issues": 42,
"pull_requests": 23
},
"file_meta": {
"content_id": "a3... |
0cab65aa-dd05-4002-9209-1b69735ad361 | TimeDA/TimeDA | dataset/cpp_12_18/gcj2013/cos/2433487_2846487_cos_observationwheel.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);... | ALGO | 0.997353 | 3.420706 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2022-10-24T06:47: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": "60caadfe21b... |
335a444e-dc85-4666-bc3a-e90968031060 | itsme3030/codeForces | codeforces/1980/E.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define inf (1LL<<60)
#define prDouble(x) cout << fixed << setprecision(10) << x
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef tree<int,null_type,less<int>, rb_tree_tag,tree_order_statist... | ALGO | 0.999961 | 3.763742 | {
"github_metadata": {
"branch": "master",
"commit_count": 678,
"repo_created_at": "2024-07-27T14:50: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": "ed9a3fb5... |
4773a2ef-0a11-4784-888f-895e95ba2403 | rusted-dreams/DSA | 006stack and queue/medium/04_gfg_prefix to infix conversion.cpp | // problem - Prefix to Infix Conversion
// link - https://www.geeksforgeeks.org/problems/prefix-to-infix-conversion/1
#include <bits/stdc++.h>
using namespace std;
string preToInfix(string exp) {
// Initialize an empty stack to store intermediate results
stack<string> st;
// Iterate through the prefix ex... | ALGO | 0.999799 | 5.361851 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2023-06-26T21:20: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": "47fe5465c9b... |
7a6a5431-78fd-415a-8e3d-cba62242c469 | UPenn-RoboCup/UPennDev2 | Modules/bhwalk/Tools/Math/EigenDecomposition.h |
#pragma once
#include "Tools/Math/YaMatrix.h"
/**
* Eigen decomposition for symmetric matrices. Adapted from JAMA.
*/
template<class V>
class YaEigenDecomposition
{
const YaMatrix<V>& matrix;
public:
YaMatrix<V> eigenVectors;
YaMatrix<V> eigenValues;
YaEigenDecomposition(const YaMatrix<V>& matrix)
: ... | ALGO | 0.999983 | 6.599262 | {
"github_metadata": {
"branch": "master",
"commit_count": 14909,
"repo_created_at": "2015-01-13T21:23:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ba822b... |
44c5b78a-1300-4872-8565-59bf43699b79 | KimSeonBin/algo_practice | acmicpc/2150.cpp | #include <stdio.h>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
/*
http://jason9319.tistory.com/98
Strongly Connected Component
Kosaraju's Algorithm
1. 그래프와 원래 그래프의 역순으로 된 역그래프를 구한다.
2. 그래프를 DFS로 탐색, 더 이상 탐색할 선분이 없는 정점을 저장.
3. 모든 탐색을 끝나면 DFS 결과를 저장한 array를 역순으로 바꿈
4. 3번 array순으로 역그래... | ALGO | 0.999995 | 4.295309 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2017-06-26T11:24: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": "883b5d24... |
3236273a-726b-497e-a046-72dd0d55f36e | ishandutta2007/codeforces-s | saketh/normal/590/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1024;
const int INF = 0x7f7f7f7f;
const int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int N, M;
char grid[MAXN][MAXN];
int dist[3][MAXN][MAXN];
bool seen[3];
int first[3][2];
int spath[3][3];
int main() {
ios_base::sy... | ALGO | 0.999744 | 3.968693 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "ea1b7f4081a1... |
5f1c9135-57e8-4af1-bbac-50c73c4a0a79 | Sebastian-Marginean/CollegeStuff | C l C++/Laboratorul-9/Marginean.Sebastian-2116-lab09-pb1/pb1.cpp | /*1. Sa se scrie un program care citeste de la tastatura un sir de caractere, apoi elimina din sir
caracterele care se repeta si afiseaza in final sirul obtinut, folosind pointeri.*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define DIM 100
void eliminaCar(char* p, int x, int& l);
int ma... | ALGO | 0.998695 | 3.327297 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-07-08T18:25:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdda9ba43a0... |
706eb42e-a79d-4731-9627-2cb35dc45f19 | bjones777/adventofcode | 2021/Day03/Day03.cpp | #include <cassert>
#include <cstdint>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int64_t bin2Dec(const string& s)
{
int64_t res = 0;
int numBits = static_cast<int>(s.size());
for(int i = 0;i < numBits;++i) {
res *= 2;
if(s[i] == '1')
{
... | ALGO | 0.999785 | 5.455286 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2019-11-29T01:59: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": "82b45469... |
9880a1f8-5152-466f-9cc6-737cbb5544e9 | Laojiao1/VsCode_ | 洛谷/20.二叉堆与ST表/建筑抢修.cpp | // https://www.luogu.com.cn/problem/P4053
// 贪心 + 优先队列
// 不怎么难(竟然还是蓝题)
#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
int n, ans = 0;
int t1 = 0; // 已经经历过的时间
struct Node {
int w;
int t;
} a[N];
priority_queue<int> q;
bool cmp(Node a1, Node a2) {
return a1.t < a2.t;
}
int main() {
fr... | ALGO | 0.999987 | 3.996969 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-18T02:46: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": "dd1a3d47c8... |
2fe57f25-0a10-42d3-9964-9979f4cfddf3 | yihui-hu/advent-of-code-21 | day21/adventday21.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <bits/stdc++.h>
#include <sstream>
#include <deque>
using namespace std;
void play_turn(int *player, int *dice, int *score, int *rolls);
int main(int argc, char *argv[])
{
string filename = argv[1];
ifstream input_fil... | ALGO | 0.997237 | 3.827512 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2021-12-01T14:14:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fcb2479db1... |
74352cf6-a6b2-4aaa-8a2d-155a4ed9299b | chishiya2309/DSA | Sinh/Bai18_TimBoiSo.cpp | /*
Một số được coi là số đẹp nếu nó chỉ bao gồm 2 số là 8 và 0. Bạn được cấp một số nguyên dương X, nhiệm vụ của bạn là tìm bội dương nhỏ nhất của X thỏa mãn bội này là số đẹp.
Gợi ý : Sinh ra xâu nhị phân gồm 2 chữ số 0 và 8 với độ dài đủ lớn, đủ để có hết các bội tới số 300. Sau đó chuyển chuỗi thành số.
Đầu vào
Dò... | ALGO | 0.998163 | 4.721183 | {
"github_metadata": {
"branch": "main",
"commit_count": 648,
"repo_created_at": "2024-07-05T12:31:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6149c8feeb... |
51cc522c-fab2-4739-91e6-338bebb55d38 | gourdine/cpp | zyBooks/5. Loops/5.7 Loops and Strings/5.7.2: Iterating until done: Replacing all occurrences of a word.cpp | /*
Iterating until done with a while loop
A programmer commonly wishes to iterate through a string until something is done.
The example below replaces all occurrences of "U.S.A." with "USA".
Because the number of iterations is not known beforehand, a while loop is used.
*/
#include <iostream>
#include <string>
usi... | TOOL | 0.982894 | 4.848107 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2018-10-11T05:06: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": "d9073d29... |
adb51579-4637-422f-939d-23b8bb863093 | steve-cw-chung/codewars_CPP | BinaryTree/143.InorderTraversal.cpp | /* Given the root of a binary tree, return the inorder traversal of its nodes' values.
Example 1:
Input: root = [1,null,2,3]
Output: [1,3,2]
Example 2:
Input: root = []
Output: []
Example 3:
Input: root = [1]
Output: [1]
Constraints:
The number of nodes in the tree is in the range [0, 100].
-100 <= Node.val... | ALGO | 1 | 6.854657 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2020-07-03T03:37:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a234911e... |
373b3d68-d398-44d5-a5af-0e41ebaf91a3 | kohnaga/ProgrammingContest | src/AOJ/CGL_2_C.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <climits>
using namespace std;
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
//点
class Point {
public:
double x, y;
Point (double x = 0, double y = 0):x(x), y(y){}
Point operator... | ALGO | 0.999826 | 4.676881 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-01-30T02:54:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd823a03e... |
8066006d-ba48-4e74-bf0f-7cd7f13eb5d7 | evantimms/arduinoChatProgram | chatprogrampartone.cpp | #include <Arduino.h>
int anaPin = 13;//varaible is used later for random number gernerator
void setup(){
init();
Serial.begin(9600);
Serial3.begin(9600);//this must be included to allowed for transfer
// between Arduinos
pinMode(anaPin, INPUT);
}
//computes a 16-bit private key for each Arduino
uint32_t getPriv... | ALGO | 0.927465 | 3.885797 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-12-27T18:52: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": "9e02d21aab... |
d1373bf3-6187-43d8-830f-826bb4450eb2 | alexoverride/causality | Source/Frontier/Relations/CausalityLattice.cpp | // Copyright 2025 <NAME> dba Causality Games.
#include "CausalityLattice.h"
#include "Action/BaseClasses.h"
// Each of the recursive traversal algorithms assumes:
// - `Actions` is ordered such that reactions come after their triggers.
// - `Actions` is ordered such that all reactions to the same trigger are contiguo... | ALGO | 0.924478 | 7.10317 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-01-24T19:11:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bd142931227... |
306d4067-0393-47e2-93de-a4abb58e3f9d | UT-LCA/VL_uBMK | apps/network/pipeline.cpp | #include <iostream>
#include <thread>
#include <chrono>
#include <atomic>
#include <vector>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include "threading.h"
#include "timing.h"
#include "utils.hpp"
using std::thread;
using std::chrono::high_resolution_clock;
using std::chrono::du... | TOOL | 0.953904 | 4.374275 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-07T16:35:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30a52ac7328... |
8d162095-3c4c-465f-9d28-8d5630ccb590 | SVCH3R/algo_term_2 | contest_2/2C.cpp | #include <algorithm>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
const int kMinNum = 1111;
const int kInf = 2147483647;
struct DistAndPath {
std::vector<int> dist;
std::vector<int> path;
DistAndPath(const std::vector<int>& constr_dist, const std::vec... | ALGO | 0.99997 | 4.892425 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-13T19:04: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": "744db125ae52... |
4ad9c6bb-dec9-4e8f-a9e0-73afbf6d0071 | wilkinsdr/raytrace_cpu | src/include/gramschmidt_basis.h | //
// Created by drw on 01/03/18.
//
#ifndef CUDAKERR_GRAMSCHMIDT_BASIS_H
#define CUDAKERR_GRAMSCHMIDT_BASIS_H
#include "kerr.h"
#include <cmath>
template <typename T>
class BasisVectors
{
public:
T vectors[4][4];
};
template <typename T>
class GramSchmidt_Basis : public BasisVectors<T>
{
private:
T g[4][4];
pub... | ALGO | 0.99557 | 3.199559 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2019-03-07T23:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "caf5ce11... |
6839e6dd-dc15-4ee5-8467-572c00f592e2 | voidcs/Comp_Programming | CSES_Solutions/05_Range_Queries/02_Range_Minimum_Queries_I/First_Accepted/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
int main(){
int n, q;
cin>>n>>q;
ll a[n];
for(int i = 0; i < n; i++)
cin>>a[i];
int ql, qr;
ll st [n*4];
function<void(int, int, int)> build = [&](int index, int ss, int se){
if(se == s... | ALGO | 0.999988 | 4.921283 | {
"github_metadata": {
"branch": "master",
"commit_count": 582,
"repo_created_at": "2020-05-27T04:31:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0eb07a19... |
e2a125bb-32fe-465d-9ff0-7a57d6d7a639 | maharshi95/competitive-programming | codeforces/482/A.cpp | /**
* Author: maharshi95
*/
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define fup(i, a, b) for(int i=a; i<=b; i++)
#define fdown(i, a, b) for(int i=a; i>=b; i++)
#define sz(a) ((in... | ALGO | 0.999935 | 3.599739 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-07-17T10:08: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": "95ef831fb9... |
7923ead1-fdeb-4399-a783-44edf989c962 | rhasspy/rhasspy-speech | openfst/src/script/shortest-path.cc | // Copyright 2005-2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the 'License');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | ALGO | 0.997255 | 7.517115 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2024-11-18T21:07:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50,
"forks": 1,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5dfe039c... |
4a972b80-4959-48a7-b11e-caf3fe23fb63 | yadavvishal/DSA-Problems | Array/FirstandLast.cpp | #include <bits/stdc++.h>
using namespace std;
// To find the index of first and Last occurence of given element
// Time COmplexity of O(N)
int main()
{
int arr[] = {1, 3, 5, 5, 5, 5, 67, 123, 125};
int n = 9; // arr length
int x = 5;
// given
vector<int> v;
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999889 | 4.770817 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-08-08T18:41: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": "447ceb0a7c... |
0cabd5d9-a341-472a-97cd-87e61b5cd3a2 | protarie125/BOJ_19572 | src/main.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
double d1, d2, d3;
cin >> d1 >> d2 >> d3;
// a + b = d1
// a + c = d2
// b + c = d3
// -> b - c = d1 - d2
// -> 2b = d1 - d2 + d3
const auto& b = (d1 - d2 + d3) / 2... | ALGO | 0.999687 | 4.342979 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-20T23:47:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee74cdadcd... |
1025d571-ed12-4c60-802e-9590bd689837 | greenheartgames/greenworks | src/greenworks_zip.cc | // Copyright (c) 2014 Greenheart Games Pty. Ltd. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
/*
minizip.c
Version 1.1, February 14h, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
... | TOOL | 0.977182 | 5.885805 | {
"github_metadata": {
"branch": "master",
"commit_count": 650,
"repo_created_at": "2013-11-07T00:00:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1547,
"forks": 158,
"issues": 62,
"pull_requests": 3
},
"file_meta": {
"content_id": "983... |
8954d06d-0485-4d89-9290-885093bbd8f7 | shas9/codehub | Codeforces/Round/Round 501/New folder/59-B.cpp | #include <bits/stdc++.h>`
#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)
#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)
#define ss(... | ALGO | 0.999978 | 3.817452 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T17:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f03a2f150... |
d3392d5e-302d-4962-9382-c7a8001886da | PiePrashant/CompetitiveProgramming | CompetitiveProgramming/ParkingLot.h | #include<iostream>
#include<vector>
#include<string>
#include<stdio.h>
#include <string>
#include <string>
#include<unordered_set>
#include<unordered_map>
#include<math.h>
#include<queue>
#include<stack>
using namespace std;
enum VehicleType {mini, sedan, suv, bus, truck};
class VehicleSlot {
public:
int id;
Veh... | ALGO | 0.953138 | 3.993519 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-07-26T13:23: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": "a7e175cea1... |
1f737cad-b31b-4bc6-a88a-2447340c23b1 | aakhoja/FinalProject | BonusProblems/bonus1.cpp | #include <stdio.h>
#include <math.h>
int x;
double f;
#define PI 3.14159265
double log_fact (int n);
int main(void)
{
printf("Enter an integer :");
scanf("%d" , &x);
for(int i = 1;i<=x;i++)
{
double stirling_res;
double exact_res;
exact_res = log_fact(i);
stirling... | ALGO | 0.995146 | 3.294364 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-12-17T17:45: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": "901cb09914... |
2fab195a-263b-4bfd-bf9e-d2e65adf14e8 | ishandutta2007/codeforces-a | atreus/normal/1320/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const int maxn = 2e5 + 10;
const int mod = 1e9 + 7;
string s;
int pw[maxn], par[maxn];
struct node{
int cnt1;
int cnt0;
int hsh;
node(){
cnt0 = cnt1 = hsh = 0;
}
} seg[4 * maxn];
node merg... | ALGO | 0.999928 | 4.338646 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5122c3dba18d... |
17d87243-126d-4348-9578-a7fc5ddfb5e0 | niozhao/vlc-3.0.11-VS2019 | contrib/libprojectM/projectM-2.0.1/MilkdropPresetFactory/Parser.hpp | /**
* projectM -- Milkdrop-esque visualisation SDK
* Copyright (C)2003-2007 projectM Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or ... | TOOL | 0.905047 | 3.931002 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-01-15T10:46:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 31,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca784e2... |
8e6e1ff0-cfac-48e3-9122-f76255b63fcb | Chanwoongs/Algorithm_Studies | 코딩테스트복습/11658_구간합구하기3.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
int a, b, c, d, e;
int nums[1030][1030], bit[1030][1030];
void update(int y, int x, int value)
{
while (y <= n)
{
int j = x;
while (j <= n)
{
bit[y][j] += value;
j += (j & -j);
}
y += (y & -y);
}
return;
}
... | ALGO | 0.999523 | 4.828416 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2023-01-03T13:30: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": "caa65d3da2... |
7dd6458e-c076-4202-a59c-a2df6094cce0 | dvd0904/CPP | string/tong 2 so nguyen lon.cpp | #include<bits/stdc++.h>
using namespace std;
string daoNguoc(string s){
string t;
for(int i = s.length()-1; i >= 0; i--)
t += s[i];
return t;
}
string tong(string a, string b){
a = daoNguoc(a); b = daoNguoc(b);
int da = a.length(), db = b.length();
string c = string(da+1, '0');
a = a + "0";
for(int i = db; ... | ALGO | 0.999988 | 3.988813 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-25T13:42:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb070b1130a4... |
d52f2c7e-7163-4de0-b668-c95b7353263e | cbsheng/fun_acm | hihocoder/1032.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define maxn 1000005
#define maxm maxn * 2
char input[maxn];
char str[maxm];
int p[maxm];
int longest_plalindrome(char *s)
{//p[i] = min{p[2 * id - 1], mx - i}
int len = strlen(s);
int id = 0, mx = 0, max = 0;
for (int i = 1; s[i] !=... | ALGO | 0.99934 | 3.656019 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2015-03-25T12:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b33c14f4... |
1cf14aa2-3009-4ec1-99f5-fb7af0a41eab | SsageParuders/Android_Native_Surface | my_android_opencv/modules/core/include/opencv2/core/hal/intrin_cpp.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TOOL | 0.910557 | 4.90418 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-07-02T15:46:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 297,
"forks": 89,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "abf3e8a... |
e880672a-d21a-4f90-9422-7e5ae100fa0e | ishandutta2007/codeforces-w | wzyyn/normal/379/G.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)... | ALGO | 0.999902 | 3.480691 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1f3b833b3f4... |
eb5c8c30-224a-4598-9497-1a61c48c0947 | adamaripici/LeetCode | EvaluateReverse PolishNotation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
// ["2","1","+","3","*"]
stack<int> stack; //create a stack to store integers
// loop through vector and check if its an operand or an integer
for (int i = 0; i < tokens.size(); i++ ){
string nums = tokens[i];... | ALGO | 0.999937 | 6.000776 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-02-07T04:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abf3627fad3... |
3769ced4-eaac-428e-b62c-e4982d03d6a5 | rapidsai/cudf | cpp/include/cudf/detail/sorting.hpp | /*
* Copyright (c) 2019-2024, 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.998874 | 7.921692 | {
"github_metadata": {
"branch": "branch-25.08",
"commit_count": 41228,
"repo_created_at": "2017-05-07T03:43:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9049,
"forks": 958,
"issues": 999,
"pull_requests": 95
},
"file_meta": {
"content... |
ee5281c2-d304-49e2-af68-72c2baa8dab0 | alexandraback/datacollection | solutions_5766201229705216_1/C++/forest/b.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>
#include <fstream>
#include <map>
#include <set>
#include <queue>
#include <memory.h>
using namespace std;
typedef vector<int> VI;
typedef pair<int, int> PI;
typedef vector<PI> VPI;
#define FOR(i,a,n) fo... | ALGO | 0.9984 | 4.469563 | {
"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": "70bb0eeb5... |
38c4e196-f1c2-4b46-97c0-43f00230f5d1 | AI-Planning/autoscale | planners/ipc2018-opt-delfi1/src/search/merge_and_shrink/miasm/merge_tree.h | #ifndef MERGE_TREE_H
#define MERGE_TREE_H
#include "subset_info.h"
#include "../../ext/tree.hh"
#include <cstdlib>
#include <memory>
#include <vector>
#include <set>
class AbstractTask;
namespace causal_graph {
class CausalGraph;
}
namespace merge_and_shrink {
/** @brief \link #DECLARE_ENUM_OPT Enum-Option-Struct... | ALGO | 0.992372 | 5.705288 | {
"github_metadata": {
"branch": "main",
"commit_count": 1270,
"repo_created_at": "2021-07-13T08:45:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "747ef4f144... |
0e712551-434f-4ac6-bb05-eb4ed58933fc | wanghuqiang123/data | BinaryHeap.h | #pragma once
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
namespace Wanglib
{
template <typename Comparable>
class BinaryHeap
{
public:
BinaryHeap()
{
curruentSize = 0;
array.resize(100);
}
BinaryHeap(int capacity )
{
curruentSize = 0;
array... | ALGO | 0.999566 | 4.394711 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-04-06T14:54: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": "035b3db09... |
40bacc60-16a5-4104-b7c1-2da34ae438d1 | tlemsl/DynamicsLearning | Bspline/cpp/bspline_example.cpp | // pangolin_bspline_example.cpp
#include <iostream>
#include <memory>
#include <pangolin/pangolin.h>
#include "sim/BsplineSE3.h"
#include <Eigen/Dense>
// Helper function to draw the coordinate frame
void drawCoordinateFrame(const Eigen::Matrix4d& pose) {
glPushMatrix();
glMultMatrixd(pose.data());
// Dra... | ALGO | 0.935957 | 6.735525 | {
"github_metadata": {
"branch": "devel",
"commit_count": 35,
"repo_created_at": "2024-08-23T05:10:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b59a7dd1e5... |
4b40edf5-7fea-46f5-a432-51749deabedb | DenRen/BabichevAlgo | H9/H9.01-insider/full_solve.cpp | #include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <random>
#include <complex>
// g++ -DHOST -std=c++17 main.cpp
#define NDEBUG
// #define HOST
#ifdef HOST
#include "../../libs/print_lib.hpp"
#define DUMP(obj) std::cerr << #obj ": " << o... | ALGO | 0.999566 | 5.748224 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2021-12-04T21:42: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": "4fae70c5ff... |
c6863275-381d-406d-9dc3-18c0ca82b9c3 | Diegores14/CompetitiveProgramming | Lightoj/1056 - Olympics/solution.cc | #include <bits/stdc++.h>
using namespace std;
double ration;
bool check( double W ) {
double L = ration*W;
double R = sqrt( W*W + L*L )/2;
double arc = 2*R*acos((2*R*R-W*W)/(2*R*R));
return 400 <= arc + 2*L;
}
int main() {
//ios_base::sync_with_stdio(false); cin.tie(NULL);
int t;
char c;
... | ALGO | 0.999382 | 3.431494 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2018-06-08T22:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a258efdd... |
5e77b096-5f33-4398-8f9a-5580d38ad2cd | abrari/struktur-data | doubly_linked_list.cpp | #include <iostream>
using namespace std;
struct node {
int value;
struct node *prev;
struct node *next;
};
typedef struct node NODE;
class DLL {
NODE *head;
NODE *tail;
public:
DLL() {
head = tail = NULL;
};
void push_front(int newvalue) {
NODE... | ALGO | 0.999459 | 4.04763 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-06-23T09:08:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a90fbfe597... |
eb278bbe-50af-48bb-8a7a-426389148128 | AanyaPanigrahi/GFG-Solutions | Difficulty: Medium/Set Matrix Zeroes/set-matrix-zeroes.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
void setMatrixZeroes(vector<vector<int>> &mat) {
// code here
int n = mat.size(), m = mat[0].size();
bool firstRowZero = false, firstColZero =... | ALGO | 0.996533 | 6.337306 | {
"github_metadata": {
"branch": "main",
"commit_count": 271,
"repo_created_at": "2024-08-20T04:42:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e7b2f31b1... |
73db33b8-b1ba-4ed1-ae05-8bf0c1141ef0 | shaduk/algorithms-datastructures | hackerrank/balancedParam.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <algorithm>
using namespace std;
bool isMatch(char a, char b)
{
if(a == '(' && b == ')')
return true;
else if(a == '[' && b == ']')
return true;
else if(a == '{' && b == '}')
retur... | ALGO | 0.999581 | 5.221203 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2015-04-12T20:44: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": "d37e8fab... |
b5db46f5-78e3-40e2-be47-7393e62f529a | m1n5eo/Baekjoon | solution/16xxx/16987 - 계란으로 계란치기/16987.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define FASTIO cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false);
int n, result;
void egg(int idx, int cnt, vector<int> durability, vector<int> weight) {
result = max(result, cnt);
for(int i = 0; i < n; i++) {
i... | ALGO | 0.999984 | 3.898364 | {
"github_metadata": {
"branch": "main",
"commit_count": 1513,
"repo_created_at": "2021-12-30T15:26: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": "d38bcbda5... |
1e122cae-c6da-44c9-9683-587dafd543b1 | VladimirBalun/algoexpert.io | strings/LongestPalindromicSubstring.cpp | std::pair<size_t, size_t> palindromePosition(const std::string& str, int left, int right)
{
while (left >= 0 && right < str.size()) {
if (str[left] != str[right])
break;
--left;
++right;
}
return { left + 1, right };
}
bool compare(const std::pair<size_t, size_t>& lhs, const std::pair<size_t... | ALGO | 0.99994 | 6.757845 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2022-08-10T11:39:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9da128484... |
65033207-e7a7-49d9-aa5e-044d3893f15c | liandd/Competitive_programming_2020_2024 | RPC/RPC_05_18_05_2024/Madcoders/I_natatoriumMadcodersAccepted.cpp | #include<bits/stdc++.h>
using namespace std;
pair<int, int> encontrar_lados_piscina(long long superficie, int num_primos, vector<int>& primos) {
unordered_set<int> primos_set(primos.begin(), primos.end());
for (int p1 : primos) {
if (superficie % p1 == 0) {
long long p2 = superficie / p1;... | ALGO | 0.999952 | 4.403086 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-05-05T01:44: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": "b542f3d1fbf... |
0a679b72-c839-40ae-a152-d669370d9852 | AHSumon78/Com_Designing | ComD2.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
vector<string> splitString(string st, char delimiter)
{
vector<string> words;
int f = 0, l = 0;
for (int i = 0; i < st.length(); i++)
{
if (st[i] == ' ')
{
words.push_back(st.substr(f, i - f));
... | ALGO | 0.999733 | 4.01373 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-11-10T17:58: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": "040ed1d007... |
a5e74c44-6904-4a38-b0bc-efbca23e8a02 | wcysai/CodeLibrary | Codeforces/Contests/Goodbye2021/H.cpp | #include<bits/stdc++.h>
#define MAXN 150005
#define INF 1000000000
#define MOD 998244353
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll,int> P;
int T,n,k,a[MAXN];
int p2[MAXN];
vector<int> id;
void add(int &a,int b) {a+=b; if(a>=MOD) a-=MOD;}
void dec(int &a,int b) {a-=b; if... | ALGO | 0.99993 | 4.393086 | {
"github_metadata": {
"branch": "master",
"commit_count": 1109,
"repo_created_at": "2018-05-21T06:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fb6b55... |
1dc06b2f-f826-481f-a84c-2c55cf04c44d | yalewoo/cpp-data-structure | Vector.h | #ifndef MY_VECTOR_H
#define MY_VECTOR_H
#include <cstdlib>
using std::rand;
#define DEFAULT_CAPACITY 20
enum sort_method{
BUBBLE, INSERT, QUICK, MERGE
};
template <typename T> class Vector{
protected:
int _size; //当前元素个数
int _capacity; //最大容量
T* _elem; //存放向量元素
void expand(); //扩容为原来的2倍
void decrease(); /... | ALGO | 0.982903 | 3.448215 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2015-03-07T12:02:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b342b213... |
2659f396-abb6-463a-875a-a4d51b1c4908 | YUSIFABOOD/CS2Project | UserSearchBST.cpp | #include "include/UserSearchBST.h"
#include <algorithm>
#include <cctype>
#include <stdexcept>
#include <iostream>
UserSearchBST::UserSearchBST() : root(nullptr) {}
std::shared_ptr<UserNode> UserSearchBST::insert(std::shared_ptr<UserNode> node, const std::string& username) {
if (username.empty()) {
throw ... | TOOL | 0.975356 | 6.496429 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-07-07T07:52:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0e0397e838a... |
10109e82-0858-4a68-bf45-e5d17a75fb61 | NguyenKhoiDinh/CompetitiveProgramming | Codeforces/CodeforcesRound/Round928/b.cpp | #include <iostream>
#include <string>
#include <vector>
int numTest;
int n;
std::vector <std::string> a;
int main () {
std::cin >> numTest;
for (int testCase = 1; testCase <= numTest; testCase++) {
std::cin >> n;
a.clear();
a.resize(n);
for (int i = 0; i < n; i++) {
std::... | ALGO | 0.999545 | 4.903791 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2021-03-25T18:48:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1534dfc6... |
2df3963c-5c19-4666-8e93-6fb840bce1fd | Leganyst/msuec | homework/5.1/b.cpp | /*
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Южный Федеральный Университет
Институт Компьютерных Технологий и Информационной Безопасности
Кафедра МОП ЭВМ ... | ALGO | 0.999962 | 3.692096 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-01T18:18: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": "b5d07ee5df15... |
e5b4c165-e15c-4819-acd0-e4e963439f80 | fmoeran/CP | problemsets/problemWithRandomTests.cpp | #include<bits/stdc++.h>
#define ll long long
#define mn(x) const ll int N = x
#define ito(n) for(int i=0; i<n; i++)
#define jto(n) for(int j=0; j<n; j++)
#define all(v) v.begin(), v.end()
#define YES cout << "YES\n"
#define NO cout << "NO\n"
using namespace std;
mn(1e6+1);
int n;
string s;
void solve(){
cin >>... | ALGO | 0.999982 | 3.674567 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-12T17:53:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "497159caea87... |
3cbd4546-1291-4664-a7ec-c85020a568fd | sehernandezce/my_Notebook_ICPC | math/Math.cpp | //MATH
//combinatorics, permutations and others
//Algorithm or Logic: number of digits for factorial
//Complexity: O(n)
//n = 1 + floor(log10(n) + log10(n-1) + log10(n-2) + ... log10(1))
//Algorithm or Logic: Given array find the subarray with the largest possible sum
//Complexity: O(n)
ll arr[MAXN];
ll sumTMax(ll... | ALGO | 0.999789 | 3.57249 | {
"github_metadata": {
"branch": "main",
"commit_count": 423,
"repo_created_at": "2022-07-16T17:42:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30f2e3b5ae... |
429815eb-9aa5-409a-8bdd-2209d91f2ff8 | Parth-Kavathiya/Object-Oriented-Programming | Assignment/Module 4.2/Question_5.cpp | /* Write a program of Addition, Subtraction, Division, Multiplication using
constructor. */
#include <iostream>
using namespace std;
class calculator // class
{
public:
calculator(int x, int y) // parameterized constructor..
{
cout << "Addition of " << x << "+" << y << "=" << x + y << endl; // a... | TOOL | 0.99518 | 5.292178 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-02T10:39: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": "8a168dd0b6... |
1b187011-dc69-4e91-b02c-68eea5ae8be7 | apapadakuni/EC327-Hws | blokusident.cpp | // Copyright 2017 <NAME> <EMAIL>
// Copyright 2017 <NAME> <EMAIL>
// Copyright 2017 <NAME> <EMAIL>
// Copyright 2017 <NAME> <EMAIL>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <math.h>
using std:: string;
using std:: ifstream;
using std:: ofstream;
using std:: cin;
using std:: c... | ALGO | 0.99861 | 3.884552 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-02-26T22:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03494bbbc9... |
30a1f7aa-fe8d-48db-9d36-e8d187c2fc33 | nikhilhassija/CompetitiveProgramming | SPOJ/HORRIBLE.cpp | #include <bits/stdc++.h>
#define lli long long int
#define mset(x) memset(x, 0, sizeof(x))
#define left(x) (2 * x)
#define right(x) (2* x + 1)
using namespace std;
const int MAX_N = 1e5;
lli T[4 * MAX_N];
lli L[4 * MAX_N];
void update (lli, lli, lli, lli, lli , lli);
lli query (lli, lli, lli, lli, lli);
void pr... | ALGO | 0.99953 | 4.300092 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2015-09-19T22:09: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": "15fa8fd6... |
db274006-2c74-4570-8b52-8dc1166a3feb | ZobaerZihad/Codeforces_sol | C_Thermostat.cpp | #include <bits/stdc++.h>
#define f(i, a, n) for (long long i = a; i < n; i++)
#define fr(i, n) for (long long i = 1; i <= n; i++)
#define py cout << "YES" << endl
#define pn cout << "NO" << endl
#define D(x) cout << #x " = " << (x) << endl
#define nl "\n"
#define ff first
#define ss second
#define pb push_back
#include... | ALGO | 0.999451 | 3.895808 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-18T17:17: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": "78c2db7215a9... |
055ae455-7a61-4353-aba6-223f16840506 | zabir-nabil/Competitive-Programming | acm hust/Aizu/2783/7525676_AC_0ms_4476kB.cpp |
/****************************************
Zerus97
*****************************************/
#include <bits/stdc++.h>
#define loop(i,s,e) for(int i = s;i<=e;i++) //including end point
#define pb(a) push_back(a)
#define sqr(x) ((x)*(x))
#define CIN ios_base::sync_with_stdio(0); cin.tie(0);
#define ... | ALGO | 0.999308 | 3.501608 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2017-03-03T19:04:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b0309276... |
50424a78-a572-4e0f-a34c-9d4af0f90ba6 | Tokazama/rft | src/resels.cpp | #include <Rcpp.h>
// [[Rcpp::export]]
RcppExport SEXP resels(Rcpp::IntegerVector m, Rcpp::NumericVector fwhm, Rcpp::IntegerVector DIM)
try
{
int D = DIM.size();
Rcpp::NumericVector resels(4);
int dimx = DIM(0);
int dimy = DIM(1);
int dimz;
if (D == 3)
dimz = DIM(2);
double v = m.size();
double E... | ALGO | 0.999121 | 4.485892 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2015-10-24T20:38: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": "fc92265f... |
4ae8b238-24a0-400c-a101-89ddd2c07d79 | hgfeaon/leetcode | UniquePathsII.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int> > &obstacleGrid) {
vector<vector<int> >& dp = obstacleGrid;
if (dp.empty() || dp[0].empty()) return 0;
dp[0][0] = (dp[0][0] == 1) ? 0 : 1;
for (int i=... | ALGO | 0.999817 | 5.068503 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2014-03-11T02:13: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": "e8876c36... |
742b0653-f365-4e16-bd33-2e849ecba563 | lshpku/EmbeddedEarth | shader.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include "common.hpp"
using namespace std;
static string readFile(const char *path)
{
string code;
ifstream stream(path, std::ios::in);
if (stream.is_open()) {
string... | TOOL | 0.936856 | 4.802643 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-12-06T07:42: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": "17080cb00... |
4cabfae4-d0a6-480a-9fd9-1d2c9f7162d0 | allpasscool/leetcodes | leetcode40/leetcode40_my_version.cpp | class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
vector<vector<int>> output;
sort(candidates.begin(), candidates.end());
for(int i = 0; i < candidates.size(); i ++) {
vector<int> new_list;
if (ca... | ALGO | 0.999986 | 6.387755 | {
"github_metadata": {
"branch": "master",
"commit_count": 445,
"repo_created_at": "2019-01-15T03:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acd14e06... |
56e54ea6-7b2b-4d76-ac81-ae92d769fce7 | rsingla92/CPUScheduler | src/main/Algorithm.cpp | /*
* EECE 315 - Project 3 CPU Scheduler
*
* Authors : <NAME>, <NAME>
* <NAME>, <NAME>
*/
#include "Algorithm.hpp"
const int Algorithm::NO_WAITING_PROCESSES = -1;
Algorithm::Algorithm(std::vector<ProcessControlBlock> inputRawData, int quantumTime,bool aging, double alpha)
: _dataInputToAlgorithm(inputR... | ALGO | 0.999956 | 4.639292 | {
"github_metadata": {
"branch": "master",
"commit_count": 228,
"repo_created_at": "2013-02-28T01:12:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c42762f... |
386ef178-f772-4099-be57-98b8aa221d95 | MRSlothAlan/CodeForcePractice | 1462B_last_years_substring/Source.cpp | #pragma warning(disable : 4996)
#include <cstdio>
#include <cstring>
/*
operations: two num i j, remove substring i j.
turn s into 2020, <= 1 operations?
*/
const int MAX = 201;
char s[MAX];
/*
struct patterns {
int st1, st2, len1, len2;
patterns(int s1, int s2, int l1, int l2) {
this->st1 = s1; this->st2 = s2;
... | ALGO | 0.999671 | 3.935 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-06T23:20:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a27858960123... |
78ebfa26-0cf3-433a-9435-d88f7fd815f2 | HXMing/RoleSimPlus | Source Code/RoleSim_Plus/main.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include <ctime>
#include "dyhungarian.h"
#include "mst.h"
#include "rolesim.h"
#include "rolesimplus.h"
#include "matchinfo.h"
#include <fstream>
#include <unordered_map>
#include <ctime>
using namespace std;
vector<vector<int>>... | ALGO | 0.999791 | 3.657753 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-09-05T11:40: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": "4193bdeb557b... |
da7d14de-9f1b-41ad-9dc3-db7133a77de3 | wisdom-yzh/basic-training | src/eliminate-maximum-number-of-monsters.cc | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
int eliminateMaximum(vector<int> &dist, vector<int> &speed) {
vector<int> arrive(dist.size(), 0);
for (int i = 0; i < dist.size(); i++) {
arrive[i] = ((dist[i] %... | ALGO | 0.999341 | 5.072057 | {
"github_metadata": {
"branch": "master",
"commit_count": 424,
"repo_created_at": "2018-07-25T15:59:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "101c6ef8... |
168980e7-ecfb-42eb-bfeb-c36315db50eb | j-pel/tinyedit | tinyweb/LINEDRAW/C_VERS~1.CPP | ///////////////////////////////////////////////////////////////////////////////
// DrawBresenhamLine()
//
// Description:
// Routine to draw a line on the given surface from x1, y1 to x2, y2
// with the given R, G, and B color components. Uses the Bresenham
// algorithm for the line.
//
// Input:
// - Buffer to d... | ALGO | 0.925473 | 4.978497 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-06T22:31:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1885a5c4b3... |
85d1a26f-dc38-4e77-a52f-d0d866c87d5e | Markkolas/Advent23 | 5/5_extra.cpp | #include <list>
#include <array>
#include "../adventbasics.h"
template<typename T>
using Map = std::list<T>;
template<typename T>
using MapList = std::list<Map<T>>;
const int N_ORIGIN_SEEDS = 20;
const int N_COLS_IN_MAP = 3;
MapList<std::array<long int, N_COLS_IN_MAP>> map_list;
void updateValues(long int vals[N_O... | ALGO | 0.999339 | 4.629683 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-12-12T23:00: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": "0a5eb8abd33... |
39d315a5-fce2-4b71-9597-66133fb48144 | tDavidM/GPSPlotter | StepControl.ino |
// All the code related to the XY plotter is kept here
// GoToXY sets the target for the plotter to move to
// MakeStep called regularly move the XY plotter in a few steps increment and hands back control to avoid locking everyting while moving
// ComputeNewXY calculates new XY values from grid coordinates when neede... | TOOL | 0.913685 | 5.400228 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-05T20:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e69d4450eb15... |
0f1e50ed-42b1-47e2-8c84-23d49c31d6e0 | tojra/cp-snippets | Math.cpp | #define MOD 998244353
// binary exponentiation
ll binexp(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
// modulo arithmetic
auto add = [](ll a, ll b){
a%=MOD;b%=MOD;a=(a+b)%MOD;r... | ALGO | 0.999286 | 4.555259 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-12-25T06:37: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": "375190cbef9f... |
c1a0f042-08eb-4d8e-b5cc-afa417408543 | hoanxuanbach/Competitive-Programming | ICPC/Regional + Team Contest/14th Chinese Northeast Collegiate/A.cpp | // Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_sup... | ALGO | 0.999461 | 4.3837 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2025-04-19T03:31:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f292eeed72f... |
8f49882c-ab4d-4518-a40c-c50552d8efe2 | Ekam3000/CppAndDataStructure | 23_recursion_2/5_quick_sort.cpp |
/*Quick Sort Code
Send Feedback
Sort an array A using Quick Sort.
Change in the input array itself. So no need to return or print anything.
Input format :
Line 1 : Integer n i.e. Array size
Line 2 : Array elements (separated by space)
Output format :
Array elements in increasing order (separated by space)
Constraints ... | ALGO | 0.999962 | 5.404661 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-07-29T18:13: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": "0be08225d... |
baa74ed8-c124-4484-9182-cd3b4bf51737 | ufz/ogs | MaterialLib/MPL/Properties/RelativePermeability/RelPermLiakopoulos.cpp | /**
* \file
* \author <NAME>
*
* \copyright
* Copyright (c) 2012-2025, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "RelPermLia... | TOOL | 0.908265 | 6.305911 | {
"github_metadata": {
"branch": "master",
"commit_count": 27875,
"repo_created_at": "2011-05-04T14:09:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 117,
"forks": 239,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b33... |
2f029331-8a56-466a-8980-092181df7596 | wzmw-zr/Code-Archive | 2020/10/11/5.LeetCode662.cpp | /*************************************************************************
> File Name: 5.LeetCode662.cpp
> Author:赵睿
> Mail: <EMAIL>
> Created Time: 2020年10月11日 星期日 18时26分28秒
************************************************************************/
#include<iostream>
#include<string>
#include<vector>
#include<q... | ALGO | 0.999967 | 4.56318 | {
"github_metadata": {
"branch": "master",
"commit_count": 1859,
"repo_created_at": "2019-11-28T12:33: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": "bed74ac... |
7028f67b-f334-4a50-a007-ae160563d54f | BSanandu88/Coding-questions | codeforces/latoken_round/color_thr_flag.cpp | /* Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n×m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." is blank. The neighbours of a cell are those that share an edge with it (those... | ALGO | 0.999956 | 4.428779 | {
"github_metadata": {
"branch": "master",
"commit_count": 883,
"repo_created_at": "2020-06-15T11:53:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfbb927e... |
825d7075-3ce4-4725-b1e2-f61d3e08be5c | trax2703/Think_n_code | CodeForces/A/1873A_(Short_sort).cpp | /*
Question:
There are three cards with letters a, b, c placed in a row in some order. You can do the following operation at most once:
Pick two cards, and swap them.
Is it possible that the row becomes abc after the operation? Output "YES" if it is possible, and "NO" otherwise.
Input
The first line contains a single... | ALGO | 0.999986 | 4.39037 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-06-07T10:06:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f47677dc1... |
ccecff60-55a7-430f-a67e-eb77e023332a | alps-jbnu/23ALPStudy | 2023-1/Intermediate/wss0702/dive_and_conquer/1780.cpp | #include<iostream>
#include<vector>
using namespace std;
int board[2188][2188];
int N;
int ans[3];
bool check(int n, int x, int y) {
for (int i = x; i < x + n; i++) {
for (int j = y; j < y + n; j++)
if (board[i][j] != board[x][y])return false;
}
return true;
}
void func(int n, int x, int y) {
if(check(n,x,y)) ... | ALGO | 0.999661 | 4.468941 | {
"github_metadata": {
"branch": "main",
"commit_count": 2930,
"repo_created_at": "2023-02-03T06:11:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 59,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e35132e7... |
3af25c71-5f96-49b5-b2d8-745bcc5d0b58 | sork777/PortFolio | Framework/Environment/Ocean/FFTOceanSimulator.cpp | #include "Framework.h"
#include "FFTOceanSimulator.h"
// Generating gaussian random number with mean 0 and standard deviation 1.
float Gauss()
{
float u1 = rand() / (float)RAND_MAX;
float u2 = rand() / (float)RAND_MAX;
if (u1 < 1e-6f)
u1 = 1e-6f;
return sqrtf(-2 * logf(u1)) * cosf(2 * D3DX_PI * u2);
}
// Philli... | ALGO | 0.901807 | 3.989828 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-06T15:46: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": "b774b9260d... |
f7bb35a4-522f-4c93-bf30-2aadf3daa260 | Ripan-Roy/CP-DSA | CODEFORCES/ROUND 910/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
void fastIO()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void helper()
{
ll n;
cin >> n;
vector<ll> arr(n);
for (auto &it : arr)
{
cin >> it;
}
ll ans ... | ALGO | 0.999588 | 4.512324 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2022-01-31T12:35: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": "bf148e906c9... |
cc5616ba-b13f-4dcc-a591-0a59d6a32d73 | alexcodergit/commonPath | Source.cpp | #include <vector>
#include <algorithm>
#include <cassert>
#include <unordered_map>
using namespace std;
class Solution {
typedef long long ll;
void getCommonPoints(const vector<vector<int>>& paths, vector<int>& points) const {
int mlen = paths[0].size();
points = paths[0];
std::sort(points.begin(), points.... | ALGO | 0.99994 | 5.410105 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-16T17:45: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": "a9a7bcefe654... |
a4e542ec-c3c4-4463-9867-bac75f7cc337 | Terpodia/Programacion-ATS-Courses | Curso C++/Matrices/Matriz ejercicio 7.cpp | // Escriba un programa que determine si una matriz es simetrica
#include <iostream>
using namespace std;
int main() {
int numeros[3][3];
int contador = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cout << "Digite un numero[" << i << "][" << j << "]: ";
cin >> numeros[i][j];
... | ALGO | 0.999626 | 4.812021 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-11T00:01: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": "6dddea1082a9... |
ac418e45-377c-4f6f-8f7c-05adb14196c2 | bhatiaabhishek/CarND-PID-Controller | src/PID.cpp | #include "PID.h"
#include <math.h>
#include <iostream>
using namespace std;
/*
* TODO: Complete the PID class.
*/
PID::PID() {}
PID::~PID() {}
void PID::Init(double Kp, double Ki, double Kd, bool tune_param) {
this->Kp = Kp;
this->Ki = Ki;
this->Kd = Kd;
this->tune_param = tune_param;
p_error... | ALGO | 0.94947 | 5.775285 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-06-20T04:23: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": "9c242c2c9... |
8a42f05f-5c01-4a1f-8d38-59a438c9c9b7 | checkoutb/atmf | cf/ge1600/CF1694_B_1200_2022-09-22_Paranoid_String.cpp |
//#include <time.h>
//#include <windows.h>
//#include <sstream>
//#include <climits>
//#include <fstream>
//#include <cstdio>
//#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
//#include <cstdlib>
//#include <cmath>
//#include <limits.h> // INT_MAX
//#include <stack>... | ALGO | 0.999974 | 3.683738 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-08-31T13:21: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": "9bbc157beec... |
6320add4-4cc7-4792-978c-690f4a444b98 | ericpo1sh/VADS | VADS-Onboard/uart/Navio/AHRS.cpp | /**
* This code is provided under the BSD license.
* Copyright (c) 2014, Emlid Limited. All rights reserved.
* Adapted from code written by <NAME> and <NAME>
*
* Application: Mahory AHRS algorithm supplied with data from LSM9DS1.
*
*/
#include <arpa/inet.h>
#include <memory>
#include <netinet/in.h>
#include <st... | ALGO | 0.978161 | 6.989885 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2024-10-29T19:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "023fdf8f94... |
722d422e-1783-4b83-abe3-4d9bc8ee4e29 | ROCm/OpenFOAM_HMM | src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DCurve/NURBS3DCurve.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | ALGO | 0.953102 | 7.72431 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.