Created
May 31, 2020 06:52
-
-
Save kiwiyou/bea8be80e35211fbedc5b780c22ebfe9 to your computer and use it in GitHub Desktop.
Fast IO for Competitive Programming in Rust
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
extern "C" { fn mmap(a: *mut u8, l: usize, p: i32, f: i32, d: i32, o: i64) -> *mut u8; } | |
fn input(size: usize) -> *const u8 { unsafe { mmap(0 as *mut u8, size, 1, 2, 0, 0) } } | |
fn next(p: &mut *const u8) -> I { unsafe { let mut n = 0; while **p & 16 != 0 { n = n * 10 + (**p as I & 15); *p = p.offset(1) } *p = p.offset(1); n } } | |
type I = i32; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment