This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let buf = stdin(); | |
let mut token = buf.split_ascii_whitespace(); | |
use std::fmt::Write; | |
// buf.clear(); | |
let mut buf = String::new(); | |
writeln!(buf, "{}", token.next().unwrap()).unwrap(); | |
print!("{}", buf); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
class SchoolPage: | |
def __init__(self, site_id: str, return_url: str, fail_url: str, session=requests.Session()): | |
# 로그인 페이지 참조 | |
self.site_id = site_id | |
self.return_url = return_url | |
self.fail_url = fail_url | |
self.reset() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <curses.h> | |
int sq(int w, int h) { | |
int x, y = 1; | |
while (y <= h) { | |
x = 1; | |
while (x <= w) { | |
if ((x == 1 || x == w) && (y == 1 || y == h)) { | |
addch('o'); |
NewerOlder