Skip to content

Instantly share code, notes, and snippets.

View kiwiyou's full-sized avatar
🥝

kiwiyou kiwiyou

🥝
View GitHub Profile
@kiwiyou
kiwiyou / script.js
Last active May 9, 2025 13:33
Polygon Tests Bulk Downloader
// ==UserScript==
// @name Polygon Tests Bulk Downloader
// @match https://polygon.codeforces.com/tests?action=preview*
// @downloadURL https://gist.githubusercontent.com/kiwiyou/bc89e3dbff247619f92a70f654d6dd1f/raw/script.js
// @grant none
// @version 1.0
// @author kiwiyou <[email protected]>
// ==/UserScript==
import("https://www.unpkg.com/@zip.js/zip.js@2/index.min.js").then(async ({
@kiwiyou
kiwiyou / text-converter.js
Last active January 28, 2025 14:19
SC-TC Converter
// ==UserScript==
// @name Text Converter
// @namespace Violentmonkey Scripts
// @match http*://*/*
// @grant none
// @version 1.0
// @author kiwiyou <[email protected]>
// @description 1/28/2025, 10:19:15 PM
// @require https://unpkg.com/[email protected]/src/main.js
// @homepageURL https://gist.github.com/kiwiyou/34cda490e64c1fde300bec09c3e0c673
@kiwiyou
kiwiyou / csr.py
Created January 20, 2024 03:06
PyPy Compressed Sparse Row
from array import array
class Graph:
def __init__(self, N):
self.h = array('I', [1 << 30]) * N
self.l = array('I')
self.e = array('I')
def connect(self, u, v):
p = self.h[u]
self.h[u] = len(self.l)
@kiwiyou
kiwiyou / main.rs
Last active October 15, 2023 07:34
Simple IO
use std::io::*;
fn solve() {
let mut reader = Reader::new();
let t = reader.read();
for _ in 0..t {
let a: i32 = reader.read();
let b: i32 = reader.read();
println!("{}", a + b);
}
@kiwiyou
kiwiyou / script.js
Created April 23, 2023 04:58
BOJ Group Practice Tier
// ==UserScript==
// @name BOJ Group Practice Tier
// @namespace Violentmonkey Scripts
// @match https://www.acmicpc.net/group/practice/view/*
// @grant GM_xmlhttpRequest
// @version 1.0
// @author kiwiyou
// ==/UserScript==
const problemAnchors = document.querySelectorAll('a[href^="/problem/"]');
const problemMap = new Map();
@kiwiyou
kiwiyou / splay.rs
Created January 5, 2023 06:54
Splay tree
trait SplayOp {
type T;
fn pull(_t: &mut SplayTree<Self>, _u: usize) {}
fn push(_t: &mut SplayTree<Self>, _u: usize) {}
}
struct SplayNode<T> {
v: T,
c: [u32; 2],
@kiwiyou
kiwiyou / linkcut.rs
Created January 5, 2023 04:48
Link cut tree
trait LinkCutOp {
type T;
fn pull(_t: &mut LinkCutTree<Self>, _u: usize) {}
fn push(_t: &mut LinkCutTree<Self>, _u: usize) {}
}
struct LinkCutNode<T> {
v: T,
c: [u32; 2],
@kiwiyou
kiwiyou / solution.rs
Created August 11, 2022 22:11
Hyper Tomato (BOJ 17114)
use core::mem::MaybeUninit;
use alloc::collections::VecDeque;
use basm::io;
const D: usize = 11;
pub fn main() {
let mut reader = io::Reader::<{ 1 << 15 }>::new();
let mut writer = io::Writer::<32>::new();
let mut tomato: [u8; (1_000_000 + 7) / 8] = unsafe { MaybeUninit::uninit().assume_init() };
@kiwiyou
kiwiyou / script.js
Created September 20, 2021 00:43
Use unicode for rendering Yethangul in Naver Korean dictionary
// ==UserScript==
// @name Naver YetHangul to Unicode
// @namespace Violentmonkey Scripts
// @match https://ko.dict.naver.com/
// @grant none
// @version 1.0
// @author kiwiyou <[email protected]>
// ==/UserScript==
new MutationObserver(e => {
@kiwiyou
kiwiyou / baeggro.js
Last active January 14, 2022 13:36
Baekjoon Online Judge Status Offender
// ==UserScript==
// @name Baeggro - BOJ Result Offender
// @match https://www.acmicpc.net/status*
// @grant none
// @version 4.0
// @author kiwiyou <[email protected]>, RanolP <[email protected]>
// @downloadURL https://gist.githubusercontent.com/kiwiyou/ffb8beab11cbc64cb696639fd0c984c7/raw/baeggro.js
// @updateURL https://gist.githubusercontent.com/kiwiyou/ffb8beab11cbc64cb696639fd0c984c7/raw/baeggro.js
// ==/UserScript==