Skip to content

Instantly share code, notes, and snippets.

View shiftpsh's full-sized avatar
👋

Suhyun Park shiftpsh

👋
View GitHub Profile
@shiftpsh
shiftpsh / boj-contest-solutions.js
Last active January 15, 2023 06:57
Parse BOJ contest solutions
const solutionTrs = (doc) => doc.querySelectorAll('tr[id^="solution-"]');
const extractText = (elem) => elem.innerText.trim();
const extractTooltip = (elem) => {
const attr = elem?.dataset?.originalTitle;
return attr ?? null;
};
const parseDate = (x) => {
@shiftpsh
shiftpsh / HLD.cpp
Created January 15, 2020 02:28
Heavy-light decomposition
#include <bits/stdc++.h>
using namespace std;
template<typename _Ty, typename _Fn = plus<_Ty>>
struct segment_tree {
_Ty default_value = _Ty();
int n = 0;
vector<_Ty> tree;
@shiftpsh
shiftpsh / raw.csv
Created December 8, 2019 11:22
solved.ac experience v. codeforces rating (as of December 8th 2019)
handle codeforces_now codeforces_max solvedac_exp solvedac_level
koosaga 2460 3154 1962413830 30
dotorya 3060 3237 723330259 27
cubelover 3071 3071 563844655 26
portableangel 2300 2314 466331812 26
cki86201 3005 3005 1492060034 30
chogahui05 1735 1735 363768906 25
kajebiii 2332 2339 411214082 26
h0ngjun7 2003 2035 491129327 26
ainta 2973 3180 1117482641 29

Keybase proof

I hereby claim:

  • I am shiftpsh on github.
  • I am shiftpsh (https://keybase.io/shiftpsh) on keybase.
  • I have a public key ASAleVQQvBPcZ9JaKXFI7AjYBLSnX2LuvpIReDBw64HZpgo

To claim this, I am signing this object:

@shiftpsh
shiftpsh / FFT.cpp
Created August 1, 2019 06:36
FFT, based on https://blog.myungwoo.kr/54 and edited
#include <cmath>
#include <complex>
#include <vector>
using namespace std;
using base = complex<double>;
constexpr auto pi = 3.14159265358979323846264;
void fft(vector<base> &a, bool invert) {
int n = a.size();
for (int i = 1, j = 0; i < n; i++) {
@shiftpsh
shiftpsh / LTNDecoder.kt
Last active July 8, 2018 10:18
Decoding octet array to integers
import java.net.URL
import java.io.IOException
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.io.OutputStream
fun main(args: Array<String>) {
val url = /* Some file to download and decode */
val list = ArrayList<Long>()
import com.github.kittinunf.fuel.httpGet
import org.jsoup.Jsoup
fun main(args: Array<String>) {
val url = "https://web.archive.org/web/20140301191716/http://pokemondb.net/pokedex/national"
val sb = StringBuilder("arrayOf(")
val (_, _, result) = url.httpGet().responseString()
val (_, error) = result
if (error == null) {