提出 #39904040
ソースコード 拡げる
use std::{
cmp::Reverse,
collections::{BinaryHeap, HashSet},
};
use proconio::{input, marker::Usize1};
fn main() {
input! {
n: usize,
q: usize,
};
let mut ans = vec![];
let mut next = 0;
let mut called = BinaryHeap::new();
let mut done = HashSet::new();
for _ in 0..q {
input! {
t: usize,
}
match t {
1 => {
called.push(Reverse(next));
next += 1;
}
2 => {
input! {
x: Usize1,
}
done.insert(x);
}
3 => {
while let Some(Reverse(x)) = called.pop() {
if done.contains(&x) {
continue;
}
called.push(Reverse(x));
ans.push(x);
break;
}
}
_ => unreachable!(),
}
}
for a in ans {
println!("{}", a + 1);
}
}
提出情報
コンパイルエラー
warning: unused variable: `n` --> src/main.rs:10:9 | 10 | n: usize, | ^ help: consider prefixing with an underscore: `_n` | = note: `#[warn(unused_variables)]` on by default
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 400 / 400 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt |
| All | 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_corner_00.txt, 02_corner_01.txt, 02_corner_02.txt, 02_corner_03.txt, 02_corner_04.txt, 02_corner_05.txt, 02_corner_06.txt, 02_corner_07.txt, 02_corner_08.txt, 02_corner_09.txt, 02_corner_10.txt, 03_min_00.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 6 ms | 2076 KiB |
| 01_random_00.txt | AC | 315 ms | 9468 KiB |
| 01_random_01.txt | AC | 320 ms | 8680 KiB |
| 01_random_02.txt | AC | 317 ms | 8572 KiB |
| 01_random_03.txt | AC | 320 ms | 8652 KiB |
| 01_random_04.txt | AC | 317 ms | 8668 KiB |
| 01_random_05.txt | AC | 730 ms | 7904 KiB |
| 01_random_06.txt | AC | 152 ms | 8652 KiB |
| 01_random_07.txt | AC | 91 ms | 11552 KiB |
| 01_random_08.txt | AC | 721 ms | 7824 KiB |
| 01_random_09.txt | AC | 71 ms | 7236 KiB |
| 01_random_10.txt | AC | 29 ms | 3528 KiB |
| 02_corner_00.txt | AC | 85 ms | 13544 KiB |
| 02_corner_01.txt | AC | 88 ms | 13528 KiB |
| 02_corner_02.txt | AC | 86 ms | 13384 KiB |
| 02_corner_03.txt | AC | 63 ms | 13636 KiB |
| 02_corner_04.txt | AC | 63 ms | 13560 KiB |
| 02_corner_05.txt | AC | 64 ms | 13544 KiB |
| 02_corner_06.txt | AC | 67 ms | 13544 KiB |
| 02_corner_07.txt | AC | 31 ms | 7040 KiB |
| 02_corner_08.txt | AC | 30 ms | 7032 KiB |
| 02_corner_09.txt | AC | 434 ms | 10096 KiB |
| 02_corner_10.txt | AC | 314 ms | 9916 KiB |
| 03_min_00.txt | AC | 5 ms | 2084 KiB |