結果
問題 | No.945 YKC饅頭 |
ユーザー | koba-e964 |
提出日時 | 2019-12-18 00:48:02 |
言語 | Rust (1.77.0 + proconio) |
結果 |
AC
|
実行時間 | 112 ms / 2,000 ms |
コード長 | 2,790 bytes |
コンパイル時間 | 14,217 ms |
コンパイル使用メモリ | 378,892 KB |
実行使用メモリ | 19,712 KB |
最終ジャッジ日時 | 2024-07-05 02:18:53 |
合計ジャッジ時間 | 19,808 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 3 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 3 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 2 ms
5,376 KB |
testcase_21 | AC | 2 ms
5,376 KB |
testcase_22 | AC | 2 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 2 ms
5,376 KB |
testcase_25 | AC | 3 ms
5,376 KB |
testcase_26 | AC | 3 ms
5,376 KB |
testcase_27 | AC | 2 ms
5,376 KB |
testcase_28 | AC | 1 ms
5,376 KB |
testcase_29 | AC | 2 ms
5,376 KB |
testcase_30 | AC | 2 ms
5,376 KB |
testcase_31 | AC | 8 ms
5,376 KB |
testcase_32 | AC | 11 ms
5,376 KB |
testcase_33 | AC | 25 ms
7,168 KB |
testcase_34 | AC | 44 ms
11,740 KB |
testcase_35 | AC | 70 ms
16,836 KB |
testcase_36 | AC | 56 ms
13,568 KB |
testcase_37 | AC | 51 ms
12,360 KB |
testcase_38 | AC | 46 ms
11,356 KB |
testcase_39 | AC | 15 ms
5,376 KB |
testcase_40 | AC | 20 ms
5,760 KB |
testcase_41 | AC | 11 ms
5,376 KB |
testcase_42 | AC | 89 ms
15,064 KB |
testcase_43 | AC | 49 ms
12,416 KB |
testcase_44 | AC | 60 ms
13,568 KB |
testcase_45 | AC | 70 ms
16,384 KB |
testcase_46 | AC | 7 ms
5,376 KB |
testcase_47 | AC | 44 ms
11,136 KB |
testcase_48 | AC | 11 ms
5,376 KB |
testcase_49 | AC | 22 ms
6,784 KB |
testcase_50 | AC | 71 ms
17,152 KB |
testcase_51 | AC | 85 ms
19,584 KB |
testcase_52 | AC | 87 ms
19,696 KB |
testcase_53 | AC | 82 ms
19,712 KB |
testcase_54 | AC | 85 ms
19,584 KB |
testcase_55 | AC | 84 ms
19,584 KB |
testcase_56 | AC | 16 ms
6,500 KB |
testcase_57 | AC | 8 ms
5,632 KB |
testcase_58 | AC | 98 ms
14,972 KB |
testcase_59 | AC | 112 ms
17,128 KB |
testcase_60 | AC | 59 ms
9,600 KB |
testcase_61 | AC | 101 ms
15,712 KB |
testcase_62 | AC | 99 ms
15,104 KB |
testcase_63 | AC | 8 ms
5,760 KB |
testcase_64 | AC | 62 ms
10,024 KB |
testcase_65 | AC | 53 ms
8,960 KB |
testcase_66 | AC | 51 ms
8,832 KB |
testcase_67 | AC | 81 ms
12,672 KB |
testcase_68 | AC | 60 ms
9,728 KB |
testcase_69 | AC | 28 ms
6,784 KB |
testcase_70 | AC | 33 ms
7,168 KB |
testcase_71 | AC | 33 ms
7,168 KB |
testcase_72 | AC | 70 ms
11,008 KB |
testcase_73 | AC | 108 ms
16,512 KB |
ソースコード
#[allow(unused_imports)] use std::cmp::*; #[allow(unused_imports)] use std::collections::*; use std::io::{Write, BufWriter}; // https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 macro_rules! input { ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes .by_ref() .map(|r|r.unwrap() as char) .skip_while(|c|c.is_whitespace()) .take_while(|c|!c.is_whitespace()) .collect() }; input_inner!{next, $($r)*} }; } macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; } macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, [ $t:tt ]) => {{ let len = read_value!($next, usize); (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }}; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; } #[allow(unused)] macro_rules! debug { ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap()); } #[allow(unused)] macro_rules! debugln { ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap()); } fn solve() { let out = std::io::stdout(); let mut out = BufWriter::new(out.lock()); macro_rules! puts { ($($format:tt)*) => (write!(out,$($format)*).unwrap()); } input! { n: usize, lrt: [(usize1, usize, chars)], } let mut unocc = (0..n).collect::<BTreeSet<_>>(); let mut cnt = [0; 3]; for (l, r, t) in lrt { let idx = match t[0] { 'Y' => 0, 'K' => 1, 'C' => 2, _ => unreachable!(), }; let mut placed = vec![]; for &e in unocc.range(l..r) { placed.push(e); cnt[idx] += 1; } for e in placed { unocc.remove(&e); } } puts!("{} {} {}\n", cnt[0], cnt[1], cnt[2]); } fn main() { // In order to avoid potential stack overflow, spawn a new thread. let stack_size = 104_857_600; // 100 MB let thd = std::thread::Builder::new().stack_size(stack_size); thd.spawn(|| solve()).unwrap().join().unwrap(); }