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 |
|---|---|---|---|---|---|---|---|
ca4c6a6f-7711-40e7-a04d-d689724e09d3 | gengzhenfei/LeetCode | c++/L068TextJustification.cpp | #include <string>
#include <vector>
using namespace std;
class L068TextJustification
{
private:
/* data */
public:
L068TextJustification(/* args */);
~L068TextJustification();
vector<string> fullJustify(vector<string> &words, int maxWidth)
{
int len = words.size();
vector<string> r... | ALGO | 0.9995 | 5.656053 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2022-01-03T16:18: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": "b34f23820f7... |
f005cba7-4e02-4c53-a553-aaa6a3bbc166 | Lannaie/Ladders | Similarity.cpp | #include <iostream>
#include <iomanip>
using namespace std;
typedef struct Node{
int num;
struct Node *next;
}Node, *Link;
typedef struct{
int len;
struct Node *first;
}List;
void Insert(Link &node, int num){
if(node==NULL){
node = new Node();
node->num = num;
node->next = NULL;
return;
}else{
Insert... | ALGO | 0.99897 | 3.440637 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-04-01T15:09: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": "6db0e74c6c... |
2114cb09-be86-493f-a12a-12caf5690352 | XiangyangGouUNSW/TriangleCounting | STC_code/common_structure/hashTable.h | #include<string>
#include<vector>
#include<algorithm>
#include "hashfunction.h"
using namespace std;
unsigned int (*hfunc[14])(const unsigned char*, unsigned int)=
{
BOB1,
BOB2,
BOB3,
BOB4,
PJW,
DJB,
CRC32,
OCaml,
SML,
STL,
FNV32,
Hsieh,
RSHash
};
template<class T>
... | ALGO | 0.998853 | 3.825634 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-07-01T07:52:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9080e16923... |
4711b62a-59c2-4895-9805-0f3da0a514f9 | cwza/codeforces | 416C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k;
vector<array<int, 3>> orders;
set<array<int, 2>> tables;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
cin >> n;
orders.resize(n);
... | ALGO | 0.999959 | 4.276537 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-03-29T01:08: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": "38da1315b8... |
bc993f3b-4de7-463e-a1f5-419c816e1dce | sweatpotato13/ps | AtCoder/abc209/abc209_d.cpp | #pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typede... | ALGO | 0.999985 | 4.361296 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2020-04-05T23:52:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da453ed8... |
cedebb25-3b36-4f3e-96fc-97faa62693fd | ciromazzocchi/RosDronePassivityBasedControlExample | quad_control/src/Nodes/outer_loop_node.cpp | #include "ros/ros.h"
#include <Eigen/Dense>
#include <tf/LinearMath/Matrix3x3.h>
#include <tf_conversions/tf_eigen.h>
#include <eigen_conversions/eigen_msg.h>
#include "quad_control/State.h"
#include "geometry_msgs/Wrench.h"
ros::Subscriber ol_odom_sub,ol_traj_sub, ol_est_sub;
ros::Publisher ol_mu_pub;
double m;
E... | ALGO | 0.978144 | 4.287938 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2022-02-02T18:18: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": "dcd6beae0... |
de483e8b-fd39-4465-936a-668b5ed19b61 | davidnatro/cpp-aads | hse/problems/L&RBinarySearch/main.cpp | #include <iostream>
using std::cin;
using std::cout;
int rightSideBinarySearch(const int array[], const int size, const int key) {
int left = 0;
int right = size - 1;
int mid;
int result = -1;
while (left <= right) {
mid = left + (right - left) / 2;
if (array[mid] == key) {
... | ALGO | 0.99997 | 5.134223 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2022-07-08T13:00:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93a8ac8ad9... |
b85b6d8f-babb-45f8-af88-575a3d57b9e0 | aziz-hammadi/cpp09_ | ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
PmergeMe::PmergeMe (int argc, char **argv)
{
std::vector<int> use_vector;
std::deque<int> use_deque;
int i;
i = 1;
while (i < argc)
{
check_arg(argv[i]);
use_vector.push_back(atoi(argv[i]));
use_deque.push_back(atoi(argv[i]));
i++;
}... | ALGO | 0.995793 | 5.374593 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-04-13T17:13:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46eb755c970... |
b3721fa2-7930-45a2-8984-7306ae70c900 | lilfry09/C-Homeworks | Desktop/作业/c++homework/最长连续打卡天数.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
// 加速C++的cin/cout,对于大量输入输出有帮助
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n; // 同学来图书馆的总天数
cin >> n;
// 特殊情况:如果总天数为0,则最长连续打卡天数为0
if (n == 0) {
cout << 0 << endl;
return ... | ALGO | 0.999995 | 4.722898 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-17T12:07:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b04016b49ae2... |
95460d78-c1d5-4ff2-99f2-2c91d676a0af | thcy/CSES-Solutions | Graph Algorithms/Knight's Tour (1689)/rainboy.cpp | /*
https://cses.fi/problemset/task/1689
Knight's Tour
practice with Dukkha
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int aa[8][8], hh[8][8][8], kk[8][8];
int di[8] = { -2, -2, -1, -1, 1, 1, 2, 2 };
int dj[8] = { -1, 1, -2, 2, -2, 2, -1, 1 };
int dd[8];
int compare(const void *a, const void *b)... | ALGO | 0.999664 | 3.806942 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-08-15T05:56:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 115,
"forks": 50,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "13b149... |
586c1609-6ab6-45fb-b475-6520c7fa709d | Sarah-han/Advanced-programming | t3/parser.cpp | #include "parser.h"
terminal Parser::nextToken() // read the text input
{
std::string word;
this->inputFile >> word;
if (word == "id")
return terminal(0);
else if (word == "+")
return terminal(1);
else if (word == "*")
return terminal(2);
else if (word == "(")
return terminal(3);
else if (word == "... | ALGO | 0.919045 | 3.493412 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-07-15T09:06: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": "dbddfbed26a3... |
df534a05-3d57-4400-a6f3-efa5e4555c99 | omertairi04/CppCodes | secondMidterm/EXEC3/task4.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n][n];
for (int row = 0; row < n; row++) {
for (int col = 0; col < n; col++) {
cin >> arr[row][col];
}
}
int columnSum[100] = {0};
for (int col = 0; col < n; col++) {
for (i... | ALGO | 0.999992 | 5.131392 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-04-24T12:43: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": "7106e107abd2... |
590735f0-5058-4f9b-99a6-6adb27e922de | Badalsingh07/LeetcodePractice | 3219-minimum-cost-for-cutting-cake-ii/3219-minimum-cost-for-cutting-cake-ii.cpp | class Solution {
public:
long long minimumCost(int m, int n, vector<int>& horizontalCut, vector<int>& verticalCut) {
sort(horizontalCut.begin(),horizontalCut.end(), greater<int>());
sort(verticalCut.begin(),verticalCut.end(), greater<int>());
long long total = 0;
long long horizontal... | ALGO | 0.999987 | 5.368614 | {
"github_metadata": {
"branch": "main",
"commit_count": 307,
"repo_created_at": "2024-09-24T11:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "121e448898... |
7cc74d0e-4e39-474f-855b-fc68ca0b36b4 | raincross7/code-similarity | codes/train_code/problem145/problem145_66.cpp | //agc043_a.cpp
//Thu May 28 21:14:16 2020
#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007
using namespace std;
using... | ALGO | 0.999981 | 3.97647 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e55d9f4ab2f2... |
10e2f2f2-3501-47d9-87a8-98dd6ce8228a | rmallela0426/LeetCodeProblems | Easy/1768-MergeStringsAlternatively.cpp |
/*
* Author: <NAME>
*/
/*
Problem Statement:
LeetCode 1768 Merge Strings Alternately
You are given two strings word1 and word2. Merge the strings by adding letters
in alternating order, starting with word1. If a string is longer than the other,
append the additional letters onto the end of the merged string.
Retu... | ALGO | 0.928414 | 7.396631 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2021-02-27T00:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "555b525e4... |
89ec3704-feb2-406e-a3f9-2b87aa28638a | thailnv/ANPR | ANPR/ANPR/Function.cpp | #include "Function.h"
Function::Function()
{
}
void Function::FindCharacter(std::vector<IplImage*>* LstChar, IplImage* plate)
{
std::vector<CvRect> rect;
IplImage* resizeImg, * binaryImg, * cloneImg;
if (!plate)
{
return;
}
resizeImg = cvCreateImage(cvSize(408, 70), IPL_DEPTH_8U, 3);
binaryImg = cvCreateImag... | TOOL | 0.934725 | 3.732106 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-07-20T11:26: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": "d5a951ab88... |
9a5cff4f-54e2-4726-adaa-38a4dd49354c | zzingongLog/work1 | 2169.cpp | #include <iostream>
#include <algorithm>
int a[1002][1002];
// (1, 1)에서 출발, (i, j)에 도착, (i, j)에 온 방향은 k, k = 0 : 위 k = 1 : 왼쪽 k = 2 : 오른쪽
int d[1002][1002][3];
const int inf = 100000000;
using namespace std;
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m;... | ALGO | 0.999978 | 3.469703 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2022-06-07T11:09: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": "0b828beed... |
94fcbddf-c096-43b1-951e-0cc4c887ca38 | TheMercwiththeMouth/Lab-Class-Codes | CSLR41_DAA/Lab 4/pqueue.cpp | #include<bits/stdc++.h>
#include<time.h>
using namespace std;
int n;
void random(int num[], int n)
{
int len = n, i, r, temp;
for (temp = 0, i = 1; temp < len; i++, temp++)
{
num[temp] = i;
}
srand(time(NULL));
for (i = len - 1; i > 0; i--)
{
r = rand() % i;
temp... | ALGO | 0.999414 | 3.405427 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-03-23T11:21: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": "2d31649a784... |
9836abd9-f9dc-469d-9b67-fe975b6d0189 | radoslav11/Coding-Library | old_impl/geometry/dynamic_upper_hull.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define SZ(x) ((int)x.size())
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> in... | ALGO | 0.999826 | 3.675947 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2017-08-26T18:46:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 153,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15f9f... |
952dda6c-f24a-43c4-a0a3-29cc411cc33c | syhk/codeing | algorithm/src/SyhkDataStructures/List/circle/doublelinkedlist.h | // 双向循环链表
#pragma once
#include <malloc.h>
#include <string.h>
#include "iostream"
#include "list.h"
#include "new"
using std::cout;
// 双向 list 的 prev 和 next 不会为 nullptr
// Node
template <typename T>
class Node {
public:
Node(Node<T>* prev, T element, Node<T>* next)
: prev(prev), element(element), next(next)... | TOOL | 0.956137 | 4.373407 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-20T00:02:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2df89bc3a55... |
e76ee8ef-8e79-4485-9962-d9adde2927c3 | qiaotian/CodeSprint | codejam/2008/minimum_scalar_product.cpp | /*
Problem A. Minimum Scalar Product
This contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Start Guide to get started.
Small input
5 points
Solve A-small
Large input
10 points
Solve A-large
Problemem
You are given... | ALGO | 0.999873 | 5.278929 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2016-02-12T17:26:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce0778c9... |
e400d17a-f769-4dc4-afbb-6ba028b05442 | kentakom1213/kyopro | contests/typical90/src/bin/076_CakeCut.cpp | // 076 - Cake Cut
// ---------------
// 問題
// https://atcoder.jp/contests/typical90/tasks/typical90_bx
// ---------------
// 連続した区間であるので尺取り法が使えるが、円形をどう処理すべきか
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(A) A.begin(), A.end()
#define initArray(name, h, ... | ALGO | 0.999934 | 4.351907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1421,
"repo_created_at": "2021-08-22T05:51:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dc4e6696... |
0415c91b-9263-485c-b860-5e8af9391ece | pseong/ProgramSolving | Codeforces/Codeforces Round 830 (Div. 2)/D1.cpp | #include <bits/stdc++.h>
#define all(c) (c).begin(),(c).end()
#define srt(c) sort(all(c))
#define srtrev(c) sort(all(c)); reverse(all(c))
using namespace std;
using ll=long long;
using i128 = __int128_t;
using pi=pair<int, int>;
using pll=pair<ll, ll>;
using ti=tuple<int, int, int>;
using tll=tuple<ll, ll, ll>;
templat... | ALGO | 0.999989 | 4.842767 | {
"github_metadata": {
"branch": "main",
"commit_count": 2105,
"repo_created_at": "2021-01-25T02:47: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": "a7aaae292... |
16cf4923-6e38-4b05-b7d5-13131ea46331 | LeeHyungGeol/Algorithm_BaekJoon | 백준_if문/[백준 실버 2] 1012번.cpp | // dfs, bfs문제
// connected components를 구하는 문제
#include <iostream>
#include <vector>
using namespace std;
int T, N, M, K;
int dx[] = { -1,1,0,0 };
int dy[] = { 0,0,-1,1 };
vector<vector<int>> graph;
vector<vector<bool>> visited;
int dfsAll();
int dfs(int x, int y);
int main() {
cin >> T;
for (int t = 0; t < T; ... | ALGO | 0.999982 | 5.027091 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2020-09-17T16:04: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": "82b365d6... |
a73de044-7dc2-451f-9735-97e96468afef | BebeShen/NCKU_Course-Competitive-Programming-2021 | HW3/Periodic Strings/p.cpp | #include<bits/stdc++.h>
using namespace std;
bool isComDiv(int i, int length){
if(length % i != 0) return false;
return true;
}
int main(){
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
int t;
cin>>t;
while(t--){
string s;
cin>>s;
// cout<<s;
bool... | ALGO | 0.999935 | 3.831041 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-03-23T02:44: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": "83c615e3f01... |
2d2eb30d-6606-4a6d-88e8-1e849d39119c | Towfiq379/3_2 | Graphics_Lab/Fill_Rectangle(BH).cpp | #include<bits/stdc++.h>
#include<dos.h>
#include<graphics.h>
using namespace std;
void Bresenham(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int flag)
{
int x, y, xx, yy, dx, dy, dS, dT, d;
int slope = 1;
if(x2 - x1 < 0)
slope *= -1;
if(y2 - y1 < 0)
slope *= -1;
... | ALGO | 0.964289 | 3.397689 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2019-09-14T20:51: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": "3eb2dfce5... |
dbcf0ab8-2514-400e-95cf-67394766c052 | 1091390146/algorithm | interview/17_18_shortestSeq.cpp | #include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
/*
面试题 17.18. 最短超串
假设你有两个数组,一个长一个短,短的元素均不相同。找到长数组中包含短数组所有的元素的最短子数组,其出现顺序无关紧要。
返回最短子数组的左端点和右端点,如有多个满足条件的子数组,返回左端点最小的一个。若不存在,返回空数组。
示例 1:
输入:
big = [7,5,9,0,2,1,3,5,7,9,1,1,5,8,8,9,7]
small = [1,5,9]
输出: [7,10]
示例 2:
输入:
big = [1,2... | ALGO | 0.999837 | 5.447463 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-11T01:46: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": "102627b4f8... |
dc1a28cd-9438-43fb-a68f-aa20ee72e6f3 | zydirtyfish/Coding | 92_Reverse Linked List II.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
* https://leetcode.com/problems/reverse-linked-list-ii/description/
*/
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
... | ALGO | 0.999996 | 5.863413 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-11-14T13:14: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": "f72ce1b2b... |
2ebfae45-7dfa-4be5-9e75-169f870ffcb7 | zhulingchen/SSSI | src/CurveLab-2.1.3/fdct3d_outcore/src/cpxcrvletocr.hpp | /* FDCT3D (Fast 3d Curvelet Transform)
Copyright (C) 2004 Caltech
Written by <NAME>
*/
#ifndef _CPXCRVLETOCR_HPP_
#define _CPXCRVLETOCR_HPP_
#include "numtns.hpp"
class CpxCrvletOcr
{
protected:
vector< vector<int> > _nxs, _nys, _nzs;
char _name[100];
int _maxnb;
int _count;
int _clock;
vector< v... | TOOL | 0.991501 | 4.472026 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2017-08-06T00:32:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "85f320... |
2a30385d-0de7-411b-97fe-81df91b4a473 | LSH3333/PS | programmers/혼자서하는틱택토.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
#define EMP 9
int mark[3][3];
int original[3][3];
bool Check() {
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
if(original[i][j] != mark[i][j]) {
return false;
}
}
... | ALGO | 0.999976 | 4.533032 | {
"github_metadata": {
"branch": "master",
"commit_count": 1357,
"repo_created_at": "2021-07-07T06:42: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": "52d7915... |
191026f8-347d-43bb-aca0-509b4ee6d2fa | samyam/DTCF | examples/cntr5d_3D.cc | #include "mpi.h"
#include "../grid.h"
#include "../tensor.h"
#include "../contraction.h"
#include "../redistribute.h"
using namespace std;
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
int rank,np;
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_rank(MPI_COMM_WORLD,&np);
int size = ato... | ALGO | 0.987603 | 4.212131 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2014-08-14T17:38:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78b6f6c88... |
ea437323-8702-44dc-a383-5b77fea03ba8 | UMKCRobotics/2017-2018-TokenSorter | competition-code/libraries/PID/PID.cpp | #include "PID.h"
PID::PID() {
}
PID::PID(float p, float i, float d) {
setConstants(p,i,d);
}
void PID::setConstants(float p, float i, float d) {
pConst = p;
iConst = i;
dConst = d;
}
void PID::reset() {
lastTimestamp = micros();
integral = 0;
lastError = 0;
lastValue = 0;
}
float PID::calculate(float ... | ALGO | 0.96919 | 5.584048 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2017-10-02T17:02:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d61d3beb... |
5a82e54c-730d-47a4-ae5f-24e1bdc97bad | AhmedKamal1432/MySolvedProblem | UVA/UVA_PROBLEM/3.Teqneqes/3.1Complete Search/10340 - All in All.cpp | /*
*
* solved by <NAME>
*/
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<sstream>
#include<cstring>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<bitset>
#include<queue>
#include<utility>
#include<algorithm>
#include<functional>
using namespace std;
typedef long... | ALGO | 0.999807 | 3.31017 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-05-20T21:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4195e3ccd... |
ffdf4e21-4dac-4b41-b334-b048df61e86c | rainbow-auto/rainbow-codes | Luogu/P6619.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
using i64 = long long;
#define fastread std::ios::sync_with_stdio(false); std::cin.tie(0);
const int maxn ... | ALGO | 0.999809 | 3.712355 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2024-09-07T02:10:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f20648b5... |
8afe2dc5-570f-409b-87e5-f8f138cd4f45 | star-bnl/star-sw | StRoot/StBeamBackMaker/Line.hh | /**
* @author <NAME> <<EMAIL>>
* Indiana University
* 23 September 2005
*/
#ifndef Line_hh
#define Line_hh
/**
* @brief C++ STL includes
*/
#include <utility>
using std::pair;
/**
* @brief STAR includes
*/
#include "StThreeVectorD.hh"
/**
* @brief 3D lines
*/
class Line {
public:
Line() {}
Line(const S... | TOOL | 0.933181 | 5.616068 | {
"github_metadata": {
"branch": "main",
"commit_count": 38269,
"repo_created_at": "2020-11-12T22:30:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 66,
"issues": 9,
"pull_requests": 29
},
"file_meta": {
"content_id": "9cdf3c... |
8dd206f8-c3dc-4ce0-9af9-ede87721ea2a | mapequation/infomapR | src/src/io/ProgramInterface.h | /**********************************************************************************
Infomap software package for multi-level network clustering
Copyright (c) 2013, 2014 <NAME>, <NAME>
For more information, see <http://www.mapequation.org>
This file is part of Infomap software package.
Infomap software packag... | TOOL | 0.949785 | 4.788815 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-05-25T08:51:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a462b301ea02... |
daf51878-6765-4f8f-b66c-90a5546488ba | adarshmishra1310/Coding | C++_Programming/OOPS/2_Demo.cpp | #include <bits/stdc++.h>
using namespace std;
// By default everything is private in Class
class binary
{
string s;
void check_binary();// Private function, it can be accessed through only public functions
// by nesting functions
public:
void read();
string getString();
string ones_compliment(... | ALGO | 0.998572 | 4.698985 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-01-02T11:24:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16c299c638b... |
f1bcc398-4cdb-4b2f-9442-e762db4bc4a4 | CodeP2/basic-Program-C--just-for-practice | do_math.cpp | #include <iostream>
#include <cmath>
#include "do_math.h"
double DoMath::doMathBasic(double first, double second, char op)
{
switch (op)
{
case '+':
return first + second;
break;
case '-':
return first - second;
break;
case '*':
return first * second;
... | TOOL | 0.927786 | 4.500758 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-09T17: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": "28fa777471cd... |
33eb34d3-09dc-422e-a837-f2b1485a70cb | BCLab-UNM/MPFA-ARGoS | Static_MPFA/source/MPFA/MPFA_controller.h | #ifndef MPFA_CONTROLLER_H
#define MPFA_CONTROLLER_H
#include <source/Base/BaseController.h>
#include <source/Base/Pheromone.h>
#include <source/Base/Nest.h> //qilu 09/06
#include <source/MPFA/MPFA_loop_functions.h>
#include <argos3/core/simulator/entity/floor_entity.h>
/* Definition of the LEDs actuator */
#include <a... | TOOL | 0.931635 | 5.80517 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2016-12-20T06:15:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4240d5afd... |
09263fa9-4442-4faf-809e-8dc160feda80 | adnanaziz/EPIJudge | epi_judge_cpp_solutions/is_string_permutable_to_palindrome.cc | #include <string>
#include <unordered_set>
#include "test_framework/generic_test.h"
using std::string;
using std::unordered_set;
bool CanFormPalindrome(const string& s) {
unordered_set<char> chars_with_odd_frequency;
for (char c : s) {
if (chars_with_odd_frequency.count(c)) {
// c now has appeared an e... | ALGO | 0.961886 | 6.584672 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
68f3ab8e-75ef-448b-a1fe-4bc759e7626a | Ash-codes18/Lpu-colab-CPP-DSA-Soln | CSE-205 DSA/Unit-6/Lecture-35/Shailu.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Graph {
public:
int vertices;
vector<vector<int>> adj_list;
Graph(int v) : vertices(v), adj_list(v) {}
void addEdge(int src, int dest) {
adj_list[src].push_back(dest);
adj_list[dest].push_back(src);
... | ALGO | 0.999935 | 5.67036 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-08-16T14:10:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af158349... |
e84b864e-7ff8-41b3-8d25-fbcb8c5174f6 | acodefall/algCpp | algCpp/algCpp/Median/MedianOfTwoSortedArrays.h | #pragma once
#include <iostream>
#include <algorithm>
using namespace std;
namespace MedianOfTwoSortedArraysNM
{
/*
1 2 3 6 (2) 4 6 8 10 (7)
2 3 6(3) 4 6 8(6)
3 6 4 6
5
1 12 15 26 38(15) ... | ALGO | 0.999977 | 5.74118 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2017-03-23T04:11: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": "c1f5237d... |
2e125386-02e0-4e87-85e6-fbb1bc17c1a7 | KaranKaira/Questions-Algorithms | BackTracking/PartitionSPOJ.cpp | //A partition of positive integer m into n components is any sequence a1,...,an of positive integers such that a1+...+an=m and a1<=a2<=...<=an.
//Your task is to determine the partition, which occupies the k-th position in the lexicographic order of all partitions of m into n components.
//The lexicographic order is ... | ALGO | 0.999817 | 4.771399 | {
"github_metadata": {
"branch": "master",
"commit_count": 157,
"repo_created_at": "2020-07-02T08:47: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": "70097d71... |
ada863bd-991c-4cf1-a520-c1519ff80d47 | julianyulu/STC-2016 | src/calTotalField.cc | // calTotalField.cc
#include <cmath>
#include "const.h"
#include "traps.h"
#include <iostream>
void calTotalField(traps alltraps[], double *totalField, int totSteps){
// totalField is a 2D array
double z, B, zStart;
int idx;
for(int i = 0; i < totSteps; i++){ // Loop through absolute positions
z = i * z... | ALGO | 0.96342 | 4.240081 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2016-10-27T19: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": "728f909aa... |
f9734d95-4199-4ab7-9e5c-fac0d632ad11 | wiwitrifai/competitive-programming | codeforces/401/d.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
string s[N];
int n;
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> s[i];
for (int i = n-2; i >= 0; i--) {
int j = 1;
int sz = min(s[i].size(), s[i+1].size());
while (j < sz && s[i][j] == s[i+1][j]) j++;
if (j == ... | ALGO | 0.999992 | 3.967235 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "850f31d... |
781c6201-ca05-4e6d-9200-34da49c0fdf6 | blagojivanov/FINKI | OOP/Lab/2/2.cpp | //Да се дефинира класа Film во која ќе се чуваат информации за:
//name(низа од максимум 100 карактери) -име на филмот
//rating (децимален број) - рејтинг на филмот
//revenue(децимален број) - колку заработил филмот во милиони долари
//Сите променливи внатре во класата треба да бидат приватни. Соодветно во рамките на ... | ALGO | 0.944894 | 4.841051 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2022-10-23T11:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "91a40238d7... |
91a11923-1152-4455-8ecd-dbb51193cba5 | open-goal/jak-project | game/sound/common/voice.cpp | // Copyright: 2021 - 2024, Ziemas
// SPDX-License-Identifier: ISC
#include "voice.h"
#include <array>
namespace snd {
#include "interp_table.inc"
// Integer math version of ps-adpcm coefs
static constexpr std::array<std::array<s16, 2>, 5> adpcm_coefs = {{
{0, 0},
{60, 0},
{115, -52},
{98, -55},
{... | TOOL | 0.941764 | 6.580126 | {
"github_metadata": {
"branch": "master",
"commit_count": 2816,
"repo_created_at": "2020-08-22T23:55:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3065,
"forks": 199,
"issues": 156,
"pull_requests": 18
},
"file_meta": {
"content_id": "... |
99af2be7-5b3d-4cf5-b171-4e51b74d6927 | EleonoreMizo/pedalevite | src/hiir/HalfBandSse.h | /*****************************************************************************
HalfBandSse.h
Author: <NAME>, 2021
Half-band filter, low-pass or high-pass, using SSE instruction set.
This object must be aligned on a 16-byte boundary!
The output is delayed from 2 sample, compared to the theoretical fo... | ALGO | 0.928582 | 6.848465 | {
"github_metadata": {
"branch": "master",
"commit_count": 2066,
"repo_created_at": "2016-12-30T15:37:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 99,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "acfb66... |
1649b5a7-38dc-49fd-b156-10a1f5f63797 | DalInar/energy-alpscore | main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <alps/gf/tail.hpp>
#include "alps/hdf5.hpp"
#include <tclap/CmdLine.h>
#include<gsl/gsl_sf_psi.h>
typedef alps::gf::omega_k_sigma_gf_with_tail cluster_matsubara_kspace_gf;
typedef alps::gf::two_index_gf<double, alps::gf::momentum_index... | ALGO | 0.990834 | 4.376207 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-07-08T20:51: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": "46b217bb2... |
c25bcdec-75a4-4454-b05c-2550aaf5377d | tarun2202/DSA | Two Pointers/Subarray Sum Equals K.cpp | /* Subarray with given sum
Given an unsorted array A of size N that contains only non-negative integers, find a continuous sub-array which
adds to a given number S.
In case of multiple subarrays, return the subarray which comes first on moving from left to right.
Input: nums = [1,2,3], k = 3
Output: 2
naive... | ALGO | 0.999956 | 5.519575 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2022-08-30T16:12: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": "7e4f3fd171... |
a2a53bae-84f2-4a30-ba9c-56b1fdc4f140 | jbutner/trilinos-1 | packages/moocho/src/AbstractLinAlgPack/src/serial/solvers/AbstractLinAlgPack_BasisSystemPermDirectSparse.hpp | // @HEADER
// ***********************************************************************
//
// Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
// Copyright (2003) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of thi... | ALGO | 0.93491 | 5.232616 | {
"github_metadata": {
"branch": "master",
"commit_count": 48938,
"repo_created_at": "2013-06-10T20:24:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ea7ba... |
e816c116-7b56-441e-83f3-25be4f77e500 | brunoroy/ModelBasedNDPC | src/HoudiniModelBasedNDPC.cpp | #include <UT/UT_Interrupt.h>
#include <PRM/PRM_Include.h>
#include <OP/OP_Director.h>
#include <GA/GA_Range.h>
#include "HoudiniModelBasedNDPC.h"
#include "timer.h"
void newSopOperator(OP_OperatorTable *table)
{
table->addOperator(new OP_Operator("ModelBasedNDPC",
"ModelBasedNDPC",
... | TOOL | 0.959089 | 6.24602 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-05-22T02:34: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": "483b45e22f... |
14c63a10-bf3e-4509-a095-c713ca10fceb | juancruzalvarez/blackjack | src/test.cc | #include <iostream>
#include <array>
#include "game/card.h"
#include "game/hand.h"
double get_card_probability(bj::Card c, std::array<int, 10> cards_left)
{
double total_cards_left = 0;
for (const auto &c : cards_left)
total_cards_left += c;
return cards_left[c - 2] / total_cards_left;
}
// time ... | ALGO | 0.992018 | 4.644376 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-10-29T19:17: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": "c3a60e3e3... |
cb15d6e0-54a5-4928-bddb-6bc3bb19191b | sghiassy/Code-Reading-Book | ace/tao/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.h | /* -*- C++ -*- */
// Strategy_Scheduler.h,v 1.17 2000/03/23 20:52:33 nanbor Exp
//
// ============================================================================
//
// = LIBRARY
// sched
//
// = FILENAME
// Strategy_Scheduler.h
//
// = CREATION DATE
// 22 December 1997
//
// = AUTHOR
// <NAME>
//
// ======... | ALGO | 0.983019 | 6.778439 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-06-30T17:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc0f7602... |
a9056345-015c-4b7d-a807-6059f5eaa69b | karimadel88/ProblemSolving | DSA/sorting/implementations/selection/main.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
string sortSentence(string s) {
vector<string> freq(10, "");
int siz = s.size();
int indx = 0;
for (int i = 0; i < siz; i++) {
if (s[i] == ' ') {
freq[... | ALGO | 0.999982 | 5.252487 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-02-05T13:19: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": "9e90b562fd7... |
4dfc6fd1-b1dc-41ba-9eec-275ca71c1ae2 | br0der/VsCode | codeForces/cf158/c.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,doubl... | ALGO | 0.999943 | 4.150076 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-11T20:13: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": "43ea277d504... |
5982b999-cb01-4cdc-8607-6801781e0b4c | avionicharshit-byte/bluetoothrccar | Bluetoothrccar.ino | // Starting of Program
int m1a = 2;
int m1b = 3;
int m2a = 4;
int m2b = 5;
char val;
void setup()
{
pinMode(m1a, OUTPUT);
pinMode(m1b, OUTPUT);
pinMode(m2a, OUTPUT);
pinMode(m2b, OUTPUT);
Serial.begin(9600);
}
void loop()
{
while (Serial.available() > 0)
{
val = Serial.read();
Serial.println(val);
... | TOOL | 0.931956 | 3.854743 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-08-26T14:54: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": "5b830110c75e... |
3213dedc-7dfd-4a8b-9ac5-4ef491636a8b | a1batross/Paranoia2_ancient | Paranoia2.PreAlpha/src_main/cl_dll/render/gl_frustum.cpp | /*
gl_frustum.cpp - frustum test implementation class
Copyright (C) 2014 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.... | ALGO | 0.93966 | 6.569311 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-23T10:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bb3fc399b... |
8d19d60c-ded3-4e7f-8349-f4e0cb1f8648 | mavenlin/cuda-convnet | thirdparty/thrust/system/cpp/detail/merge.h | /*
* 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.999734 | 7.105943 | {
"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": "17af85d... |
eb01e383-afc4-4327-ac03-d82a7f04b0a5 | pankaj-2503/DSA-Standard-Problems | Segment-Tree/Implementation.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lld long double
#define en endl
#define all(x) x.begin(),x.end()
#define f(i,from,to) for(ll i=from;i<to;i++)
#define fe(i,from,to) for(ll i=from;i<=to;i++)
#define fre(i,from,to) for(ll i=from;i>=to;i--)
#define fr(i,from,to) for(ll i=from;i>to;... | ALGO | 0.999984 | 5.776056 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-06-15T16:11: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": "cb5bf2bbaec... |
507e2986-f524-447a-802f-e753f7b0cb0d | ujunhwan/algorithms_cpp | BAEKJOON/DP/13392.cpp | // https://www.acmicpc.net/problem/13392
// 13392번 방법을 출력하지 않는 숫자 맞추기
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
#define precision(x) cout << fixed; cout.precision(x)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
static const int INF = 0x7f7f7f7f+1;
const int d4x... | ALGO | 0.999816 | 4.006802 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2020-02-26T12:18: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": "1afac990... |
94d1ec86-f59f-436c-9b73-d657b59cbe39 | mksaadi/Coding-Interview-Prep | CSES/Introductory Problems/Two_Sets.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using ld = long double;
#define ff first
#define nl "\n"
#define ss secon... | ALGO | 0.999671 | 4.095352 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-02-01T12:05: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": "092ab6311bb... |
45523614-dba3-40ac-b069-ae249801eda0 | linhphan98/C-_DataStructure | Interviews/Medium/SameBST.cpp | #include <iostream>
#include <list>
#include <limits>
using namespace std;
struct Node{
int data;
Node* left;
Node* right;
};
void insertNode(Node* &head, int data){
Node* newNode = new Node();
newNode -> data = data;
newNode -> left = NULL;
newNode -> right = NULL;
if(head == NULL){
... | ALGO | 0.999935 | 5.311818 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-14T22:07: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": "19a440340a... |
bae1054c-c311-4c96-92f0-2d09be7f6bf9 | chandradip2006/quick-sort | size_binaryTree.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int value){
data=value;
left=NULL;
right=NULL;
}
};
// void num(node* root , int* count){
// if(root->left==NULL&&root->right==NU... | ALGO | 0.999357 | 4.208026 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-03-22T17:37: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": "b056ade66cf... |
a5ef634e-fa7a-43c1-a8e9-e7f67cd53605 | ji-junhyuk/algo | pp/BOJ/lv4/1504.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX INT_MAX
/*
s->v1->v2->N
s->v2->v1->N
*/
int N, E;
int v1, v2;
int sToV1, sToV2, v1ToV2, v1ToN, v2ToN;
vector<pair<int, int>> v[801];
int dist[801];
int ret = MAX;
void dijkstra(int start)
{
priority_queue<pair<int, int>, vector<pair<int, int>>, greater... | ALGO | 0.999973 | 4.279142 | {
"github_metadata": {
"branch": "main",
"commit_count": 291,
"repo_created_at": "2021-10-31T16:25: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": "1fe100039a... |
17d27dc7-f172-4aa0-9c3c-5cb61a014478 | patrikdestar/2-tema | matrix.h | #ifndef MATRIX_H
#define MATRIX_H
#include <vector>
#include <omp.h>
#include <stdio.h>
#include <ctime>
#include <string>
#include <chrono>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
double elrand (unsigned /*i*/, unsigned /*j*/)
{
return 10*(rand()/(double)RAND_MAX)-5;
}
double ... | ALGO | 0.996624 | 5.087757 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-11-23T19:51: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": "f935b2b75c6... |
0fb53ea4-eb62-41c6-91f0-b1ebdac645ee | happynear/caffe-windows | src/caffe/layers/soft_contrastive_loss_layer.cpp | #include <algorithm>
#include <vector>
#include <math.h>
#include <float.h>
#include "caffe/layers/soft_contrastive_loss_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
template <typename Dtype>
void SoftContrastiveLossLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
... | DATA | 0.971133 | 7.019917 | {
"github_metadata": {
"branch": "ms",
"commit_count": 4488,
"repo_created_at": "2015-03-31T06:53:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1322,
"forks": 646,
"issues": 146,
"pull_requests": 3
},
"file_meta": {
"content_id": "db31... |
b1a59244-0143-4944-b9a0-97ce66d73044 | sandeepkumar75/DSA_HacktoberFest2K22 | KMP_code.cpp | /*
ContestName = Shinchu_itachi
" Walking on the road not taken with my own gutts.. "
*/
#include <bits/stdc++.h>
using namespace std ;
/*---------------------------------------------------------------------------------------------------------------------------------*/
const ll mod = 1e9 + 7 , mod0 ... | ALGO | 0.999752 | 4.313387 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2022-09-29T09:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 55,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "9bfc98256... |
d3054d92-574b-4378-8373-a8928aa82dfe | ishandutta2007/codeforces-s | shadowatyy/normal/555/E.cpp | #include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000007
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define st first
#define nd sec... | ALGO | 0.999981 | 4.49114 | {
"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": "25fd4a03058d... |
b0f9a347-e304-4d8e-a24c-24093a8f3fe6 | sas4eka/copypaste | segment_mx.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 100002;
int t[4*MAXN];
int mx(int v, int tl, int tr, int l, int r) {
if (l > r) {
return 0;
}
if (l == tl && r == tr) {
return t[v];
}
int tm = (tl + tr) / 2;
return max(mx(v*2, tl, tm, l, min(r,tm)),
... | ALGO | 0.999681 | 3.94557 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-10-07T12:37: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": "7dc19e273... |
093675af-2b49-4c49-ac90-767a5013313c | keshavnandan/Topcoder | UndoHistory.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cstring>
#include <climits>
#include <cstdio>
using namespace std;
typedef pair<int,int> pi;
typedef set<int> si;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> ... | ALGO | 0.999787 | 4.013995 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2014-04-21T08:52:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2820005... |
96a4ca52-17a0-449d-8682-77919126e714 | grx62203/leetcode | 1、acwing/剑指offer/acwing20用两个栈实现队列-数组模拟队列.cpp | /*
请用栈实现一个队列,支持如下四种操作:
push(x) – 将元素x插到队尾;
pop() – 将队首的元素弹出,并返回该元素;
peek() – 返回队首元素;
empty() – 返回队列是否为空;
注意:
你只能使用栈的标准操作:push to top,peek/pop from top, size 和 is empty;
如果你选择的编程语言没有栈的标准库,你可以使用list或者deque等模拟栈的操作;
输入数据保证合法,例如,在队列为空时,不会进行pop或者peek等操作;
数据范围
每组数据操作命令数量 [0,100]。
*/
class MyQueue {
public:
/** Initia... | ALGO | 0.999234 | 5.715517 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-15T15:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ff4cb32c7c2... |
25c35cd2-02ea-46b2-8d17-184060b4eca7 | LeonardoBizzoni/Codebase | math/simplex.cpp | fn f64 minMaxNewtonMethod(f64 (*func)(f64), f64 x0, f64 epsilon) {
f64 xk;
for (;; x0 = xk) {
xk = x0 - (derive(func, x0) / secondDerivative(func, x0));
if (Abs(xk - x0) <= epsilon) {
return xk;
}
}
}
template <usize Constraints, usize Variables>
fn Vector<f32, Variables> simplex(Vector<f32, Va... | ALGO | 0.999984 | 5.867173 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2024-10-07T13:03: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": "38912700... |
c5b7f855-3d84-44c0-88ed-ce284650a2ee | unixnme/essentials | src/cleanup.cc | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
void print_usage(const std::string& program_name) {
std::cerr << "clean up white space into a single space char for each line" << std::endl;
std::cerr << "Usage: " << program_name << " [filenames...]" << std::endl;
std::cerr << "\t... | TOOL | 0.935505 | 5.719698 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-19T09:02: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": "f53c137b85... |
5bd45340-b2bf-4f89-9dd9-dbd141c5e855 | RAHULCHATURVEDI000/leetcode-gfg-solutions | Difficulty: Easy/Panagram Checking/panagram-checking.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
bool checkPangram(string s) {
unordered_set<char> letters;
// Iterate through the string
for (char c : s) {... | ALGO | 0.999527 | 5.104714 | {
"github_metadata": {
"branch": "main",
"commit_count": 205,
"repo_created_at": "2023-09-13T21:03: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": "182d0c80c2... |
64040eb1-f5ea-4ab6-b0a1-11fa4e9edd9e | marcospb19/low-latency-buffer-realloc | stack-test/stack-amortized.cpp | #include <iostream>
using namespace std;
void panic(char const* const panic_message)
{
cerr << panic_message << ".\n";
exit(1);
}
const int DEFAULT_CAPACITY = 20;
const int GROWTH_RATE = 3;
template <typename T>
struct Stack {
T* m_buf;
int m_len;
int m_capacity;
Stack() : m_len{0}, m_capaci... | ALGO | 0.967009 | 5.42732 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-10-19T18:18:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d1775dba3... |
882ba71d-4ff8-46c6-a473-adaba6596b0b | Cowboy-Spike-Spiegel/Term3-Data-Structure | 实验_3/header.h | class matrix
{
public:
void create ( int row , int column , int numberSize ) ;
int row ;
int column ;
int numberSize ;
std::vector<std::vector<int>> obj ;
int* start ;
} ;
// for a matrix, get its row, column and numberSize
void getSize ( int& row , int& column , int& numberSize ) ;
// for a m... | ALGO | 0.982762 | 3.87497 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-17T06:26: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": "7efd83be769d... |
8016ca9b-a0da-4025-88a8-a266ef25a9e6 | h4wwk3ye/code | At Coder/Beginner 176/d.cpp | #pragma GCC optimize("-O3")
/*
C++
encoding: UTF-8
Last Modified: 24/Aug/20 10:28:18 AM
*/
#include <bits/stdc++.h>
#ifdef H4wk3ye
# include <prettypr.hpp>
#endif
using namespace std;
#define int int64_t
template < typename T > void print (const T& t) {
cout << t << '\n';
}
template < typename T, type... | ALGO | 0.99995 | 4.134063 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-03-12T15:34:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29364ff52b... |
75cf9222-5e45-4d8d-b5f2-eb6f1157ed1f | sillysillyman/ps | 백준/Platinum/6549. 히스토그램에서 가장 큰 직사각형/히스토그램에서 가장 큰 직사각형.cc | #include <iostream>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const int MAX_N = 100'000;
int n;
ll arr[MAX_N + 1];
pll tree[4 * MAX_N + 1];
pll init(int node, int start, int end) {
if (start == end) return tree[node] = {arr[start], start};
int mid = (start + end) / 2;
return tree[no... | ALGO | 0.999759 | 5.324353 | {
"github_metadata": {
"branch": "main",
"commit_count": 2004,
"repo_created_at": "2023-06-22T20:07: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": "4812c7166... |
e4c76fe7-ea54-4ef0-83ff-b31e4debc28e | DeepakMehta000001/Graphs | DijkstraShortest Reach 2.cpp |
/*
Author :- <NAME>
Problem:- https://www.hackerrank.com/challenges/dijkstrashortreach
Theory :- Dijkstra Algorithm
Hard work succeeded because talent was not working hard. :)
*/
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<vector>
#include<q... | ALGO | 0.999948 | 3.576615 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-03-29T15:59: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": "84abf4aa3b... |
0442e2f4-57c2-4414-b08a-ab0a9f0412b5 | nekkomoe/code | loj/3097.cpp | // luogu-judger-enable-o2
#include "bits/stdc++.h"
typedef long long ll;
using namespace std;
const int N = 1e6 + 10, M = 1e6 + 10;
const ll inf = 0x3f3f3f3f3f3f3f3fll;
int head[N], rest[M], from[M], to[M], tot = 1;
ll w[M], co[M];
void add_sig(int u, int v, ll w, ll co) {
from[++ tot] = u, to[tot] = v, :: w[tot] =... | ALGO | 0.999974 | 3.775721 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2018-02-27T02:33:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9f0d13... |
c6aedc5c-fd07-4d46-8991-228cfec60219 | ramtaruman/DSA-and-Friends | Misc Problems/Arrays/leftshiftelements.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> reverse(vector<int> arr, int low, int high) // reverses the given range of elements 1 2 3-> 3 2 1
{
while (low < high)
{
swap(arr[high], arr[low]);
high--;
low++;
}
return arr;
}
//-naive sol---
vector<int> left_shift(v... | ALGO | 0.999996 | 5.315231 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-04-02T06:23:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bd6452e96c... |
0b252e13-5935-4afc-a26b-c33b8b16002c | MagicaQuartet/algorithm | baekjoon/3176.cpp | #include<cstdio>
#include<cstring>
#include<vector>
#include<utility>
#include<algorithm>
#define pii pair<int, int>
#define INF 987654321
using namespace std;
int N, A, B, C, K, D, E;
int minVal, maxVal;
vector<vector<pii > > graph;
int parents[100010][18];
int depth[100010];
pii dp[100010][18];
void dfs(int node) {... | ALGO | 0.999984 | 4.55094 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2019-08-30T13:11: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": "f7fdcb1b... |
6c14b63d-36a7-4bb0-990e-48e7c856906d | alanhpereira/OBIPrep-2022 | solves/segTree/arranhaCeu/arranhaCeu2.cpp | #include <stdio.h>
#define MAX 100100
typedef long long ll;
ll seg[4*MAX];
ll query(int idx, int l, int r, int i, int j){
if(l > j || r < i) return 0;
if(l >= i && r <= j) return seg[idx];
int mid = (l+r)/2;
return query(2*idx, l, mid, i, j) + query(2*idx+1, mid+1, r, i, j);
}
void update(int idx, i... | ALGO | 0.999892 | 4.080705 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2022-04-29T10:26:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e2c81a3997... |
7d3e6fc8-18b0-476c-820e-7935a80e5312 | Tsugiru/codeforces | 1307A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
struct int_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9... | ALGO | 0.99998 | 4.293228 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2019-09-08T08:58:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da99fb0bd... |
640b668b-6b46-4bf8-a989-23e8411ce190 | BijoySing/Problem-Solving | DSA/doubly_Linked/Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define pp(x) cout << x << endl
#define int long long
#define Int int
#define ck(x) cout << #x << " = " << x << endl;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(i... | ALGO | 0.999785 | 4.187679 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-02-11T19:12: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": "c712a11cf3... |
752db918-3053-4931-b8d0-6fa6be1df613 | leonardoAnjos16/Competitive-Programming | Other/alexandria_library.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
const int LOG = 20;
vector<vector<int>> tree;
vector<int> depth, nodes, parent;
vector<vector<int>> up;
void init(int node = 0, int p = -1) {
nodes[node] = 1;
for (int child: tree[node])
if (child != p) {
parent[c... | ALGO | 0.999717 | 4.066208 | {
"github_metadata": {
"branch": "master",
"commit_count": 539,
"repo_created_at": "2019-12-27T05:52:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b8ee8a1... |
367a0610-335c-4a7a-bbf3-bb44fd11daf5 | niyaznigmatullin/nncontests | 2013/02/CodeChef February Challenge/WPLAY.cpp | #include <algorithm>
#include <cstdio>
int w;
int ni() {
int c = getchar();
while (c != '-' && (c < '0' || c > '9')) {
c = getchar();
}
int sg = 0;
if (c == '-') {
sg = 1;
c = getchar();
}
int ret = 0;
while (c >= '0' && c <= '9') {
ret = ret * 10 + c - '... | ALGO | 0.999981 | 4.111638 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2015-06-05T12:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e817ddc5... |
822f1ba2-1f6e-47c6-8717-9ffbe2a673c9 | bonizario/cp | problems/leetcode/856-score-of-parentheses.cpp | class Solution {
public:
int scoreOfParentheses(string s) {
stack<int> stk;
int score = 0;
for (auto c : s) {
if (c == '(') {
stk.push(score);
score = 0;
} else {
score = stk.top() + max(score * 2, 1);
... | ALGO | 0.998768 | 5.171864 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2022-10-09T15:55: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": "1635fb23837... |
6fb1e014-ecc6-4975-adaf-547bae830fb5 | AhmedSeef/BinaryTreeCreateByLevel | BT.cpp | #include "iostream"
using namespace std;
#include <queue>
struct Node
{
Node *left;
int data;
Node *right;
} * root;
void createtree()
{
Node *p;
int x;
Node *t;
root = new Node;
cout << " Enter root data" << endl;
cin >> x;
root->data = x;
root->left = root->right = NULL;
... | ALGO | 0.999683 | 4.262712 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-25T21:41: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": "842b831c0ecd... |
2819ac33-6d7e-41e1-a1b6-7ded51ffcb8c | david-perez/competitive-programming | UVa/010496.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <algorithm> // max...
#include <utility> // pair
#include <complex>
#include <climits> // int, ll...
#include <limits> // double...
#i... | ALGO | 0.999951 | 3.947869 | {
"github_metadata": {
"branch": "master",
"commit_count": 707,
"repo_created_at": "2015-10-28T23:24:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "134e0d1... |
ad385c2b-7084-495d-973f-6e25e7e203a9 | walor/yummi-c- | project in C/src/RedNeuronal.cpp | #include "../include/RedNeuronal.h"
RedNeuronal::RedNeuronal(int n_capas, int *n_neur)
{
//ctor
this->numero_de_capas = n_capas;
this->n_neuronas = new int[n_capas];
int i;
for(i=0; i<n_capas;i++)
{
this->n_neuronas[i] = n_neur[i];
}
this->CreateNetwork(NULL);
}
RedNeuronal::... | ALGO | 0.960247 | 3.761473 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-09-28T22:53: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": "e1a23d10c8... |
5b00466f-a381-4499-b6f3-5587ac03d36a | shahivaibhav/Daily-Questions-Leetcode | Arrays/Strings/Arrays/String/09/Uncommon-Words-From-Two-Sentences.cpp | /*
Problem 884- Uncommon Words from Two Sentences(Easy)
Problem Explanation:
Given two sentences s1 and s2, you are tasked with finding all words that appear exactly once in either of the two sentences but not in both. In other words, a word is considered "uncommon" if it appears in only one sentence and has a frequ... | ALGO | 0.999901 | 6.417152 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-09-16T15:08:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5dec0571631... |
ced3fec2-cbcc-400d-82ab-89f20a1945d8 | dan-kucherenko/pp-mohyla | 10Kucherenko/10Kucherenko/Simpson.cpp | //
// Developed by <NAME> on 01.12.2022
//
/*
*Default simpson algorithm, dividing on
*2 parts: S = delta/3(f(x0) + 4f(x1) + f(xn));
*4 parts: S = delta/3(f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + f(xn))
*Step is 2f(x2) + 4f(x3), n = 2k
*/
#include <cmath>
#include "Simpson.h"
double simpson(double(* const f)(double),... | ALGO | 0.999235 | 5.800851 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-09-15T13:47: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": "d93e17db99c... |
7d07bde9-0744-42bd-8c00-2c4d356eb20a | TanzWen/DataMining-Apriori-FP-growth | src/fp_tree.cpp | #include "fp_tree.h"
fp_tree::fp_tree()
{
tree_root = new node();
table_root = new node();
}
inline bool comp(const pair<string, int> &a, const pair<string, int> &b)
{
if (a.second == b.second)
{
if (a.first[0] >= 0 + '0' && a.first[0] <= 9 + '0')
return atoi(a.first.c_str()) < ato... | ALGO | 0.986413 | 3.486596 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-05-08T14:55: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": "d45da7d417... |
7c40ce0c-7b82-4f54-a4ac-67299b20dc28 | GraphicsCGJ/coding | cpp/acm/SHORTEST_PATH/1386_g3_floyd.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define MX 250000000
typedef pair<int, int> P1;
int T, N, M, W;
vector<P1> edges[501];
int dst[501][501];
int main(void) {
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> T;
while (T--) {
cin >> N >> M >> W;
... | ALGO | 0.999883 | 4.432556 | {
"github_metadata": {
"branch": "main",
"commit_count": 223,
"repo_created_at": "2021-12-03T04:35:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fd79c4337... |
3dd84959-bff2-4504-8231-0374481c88a7 | harsh6754/DSA-Problems | ImpactTrainingProgram/HotelCharge.cpp | //month [3]
//per day Room Charge[1500]
//Days stay[2]
//[1,3,2,7,8,9,10] 1500*Days
//[4,5,6,11,12] 1500+20%*Days
#include<bits/stdc++.h>
using namespace std;
int calculateRoomCharge(int daysStayed, const std ::vector<int>& daysList, int month, int perDayRoomCharge, int PercentInAnotherMonth) {
int roomCharge =... | ALGO | 0.988598 | 4.239463 | {
"github_metadata": {
"branch": "master",
"commit_count": 500,
"repo_created_at": "2023-09-17T03:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdcae800... |
f38b18bc-8e97-4fe2-b484-fdbaa4bbee9f | ManishaBose/ProblemSolving | Day12/prime_optimalApproach.cpp | // If d is a divisor of n, then n/d is also a divisor of n
// This property is symmetric about the sqrt of n, so avoid redundant iterations
#include <iostream>
using namespace std;
bool checkPrime(int n)
{
int cnt = 0;
for (int i = 1; i <= sqrt(n); i++)
{
if (n % i == 0)
{
cnt++... | ALGO | 0.999899 | 5.016924 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2025-01-04T18:24: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": "fd9bc72cb23... |
e14f73ff-39bc-41ca-beec-09050fca963c | vxl/vxl | contrib/brl/bbas/volm/volm_utils.h | // This is contrib/brl/bbas/volm/volm_utils.h
#ifndef volm_utils_h_
#define volm_utils_h_
//:
// \file
// \brief Set of utility functions for Volumetric Matching and 3-d indexing library
// \author <NAME>
// \date Oct 16, 2014
//
// \verbatim
// Modifications
// <none yet>
// \endverbatim
//
#include <iostream>
#inc... | TOOL | 0.982131 | 6.434542 | {
"github_metadata": {
"branch": "master",
"commit_count": 42154,
"repo_created_at": "2013-05-02T18:32:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 250,
"forks": 157,
"issues": 49,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e... |
25a2fac3-3fac-47b4-b4e1-29ca5296c4e2 | QiujieDong/Learning_code | kaolin-0.1/kaolin/cuda/three_nn.cpp | // Copyright (c) 2017, Geometric Computation Group of Stanford University
// The MIT License (MIT)
// Copyright (c) 2017 <NAME>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without r... | DATA | 0.975455 | 6.65496 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-10-16T07:15:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bcc8cfeb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.