結果

問題 No.1338 Giant Class
ユーザー ixTL255ixTL255
提出日時 2023-01-02 14:55:13
言語 Rust
(1.77.0)
結果
RE  
実行時間 -
コード長 612 bytes
コンパイル時間 2,328 ms
コンパイル使用メモリ 143,188 KB
実行使用メモリ 811,700 KB
最終ジャッジ日時 2023-08-17 23:33:19
合計ジャッジ時間 10,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 130 ms
4,612 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 122 ms
72,268 KB
testcase_07 AC 163 ms
73,584 KB
testcase_08 AC 97 ms
24,992 KB
testcase_09 AC 83 ms
9,404 KB
testcase_10 AC 162 ms
26,816 KB
testcase_11 AC 33 ms
63,004 KB
testcase_12 AC 98 ms
4,380 KB
testcase_13 RE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let mut itr = s.trim().split_whitespace();
	let h: usize = itr.next().unwrap().parse().unwrap();
	let w: usize = itr.next().unwrap().parse().unwrap();	
	let q: usize = itr.next().unwrap().parse().unwrap();	
	
	let mut ans = h * w;
	let mut seat: Vec<usize> = vec![h; w];
	
	for _ in 0..q {
		let y = itr.next().unwrap().parse::<usize>().unwrap() - 1;
		let x = itr.next().unwrap().parse::<usize>().unwrap() - 1;
		
		if y < seat[x] {
			ans -= seat[x] - y;
			seat[x] = y;
		}
		println!("{}", ans);
	}
}
0