Skip to content

Instantly share code, notes, and snippets.

View rebornplusplus's full-sized avatar

Rafid Bin Mostofa rebornplusplus

View GitHub Profile
@rebornplusplus
rebornplusplus / icpc_dhaka_20_b.cc
Created August 21, 2022 16:07
ICPC Dhaka 2020: B. Password Shuffling
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FastIO ios::sync_with_stdio(false); cin.tie(0);
#define all(x) (x).begin(), (x).end()
@rebornplusplus
rebornplusplus / expansion.cc
Created December 14, 2021 19:04
Ada Lovelace National Girls' Programming Contest 2021
#include <bits/stdc++.h>
using namespace std;
typedef double Tf;
typedef Tf Ti; // int/ll for exactness
const Tf EPS = 1e-7;
const Tf INF = 1e20;
@rebornplusplus
rebornplusplus / wget_gdrive.sh
Last active June 2, 2021 04:11
Download Google Drive Files using wget
# USAGE: (saves to FILENAME)
# ./wget_gdrive.sh FILEID FILENAME
# https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99
# Copy the link for sharing: https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA/view?usp=sharing
# Extract FILEID part: 1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA
# For small (<100MB) files:
# wget --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O $2
@rebornplusplus
rebornplusplus / cpp.cc
Created October 31, 2020 22:41
Interactive stuffs
#include <bits/stdc++.h>
using namespace std;
void read(int& x, int& y) {
cin >> x >> y;
cerr << "cc< " << x << " " << y << endl;
}
void write(int x, int y) {
@rebornplusplus
rebornplusplus / g++.sh
Created September 28, 2020 17:13
Install g++-8 in Ubuntu
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-8 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-8 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-8
sudo update-alternatives --config gcc
@rebornplusplus
rebornplusplus / eval.cc
Last active October 7, 2020 07:19
Validator for AI Offline 2
/***********USAGE********************
* g++ -std=c++11 eval.cc -o eval *
* ./eval yor.crs yor.stu yor.sol *
*************************************/
#include <bits/stdc++.h>
#include <exception>
using namespace std;
@rebornplusplus
rebornplusplus / settings.json
Created February 13, 2020 06:36
VS Code Settings
{
"editor.fontFamily": "'Ubuntu Mono'",
"editor.fontSize": 14,
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"editor.insertSpaces": false,
"editor.detectIndentation": true,
"code-runner.executorMap": {
"c": "gcc -std=c11 $fullFileName && ./a.out",
"cpp": "g++ -std=c++14 $fullFileName && ./a.out",
#include <bits/stdc++.h>
using namespace std;
typedef double T;
const int N = 1e3 + 7;
const T INF = 1e18;
vector<int> g[N];