結果

問題 No.1338 Giant Class
ユーザー maguroflymagurofly
提出日時 2021-01-15 21:56:22
言語 Ruby
(3.3.0)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 20,652 KB
最終ジャッジ日時 2023-08-17 16:58:45
合計ジャッジ時間 6,870 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,044 KB
testcase_01 AC 78 ms
15,048 KB
testcase_02 AC 320 ms
15,176 KB
testcase_03 AC 81 ms
15,172 KB
testcase_04 AC 81 ms
15,284 KB
testcase_05 AC 82 ms
15,256 KB
testcase_06 AC 242 ms
17,880 KB
testcase_07 AC 321 ms
20,160 KB
testcase_08 AC 239 ms
17,664 KB
testcase_09 AC 222 ms
17,588 KB
testcase_10 AC 349 ms
20,180 KB
testcase_11 AC 105 ms
15,992 KB
testcase_12 AC 268 ms
17,808 KB
testcase_13 AC 232 ms
17,992 KB
testcase_14 AC 125 ms
16,392 KB
testcase_15 AC 140 ms
16,792 KB
testcase_16 AC 103 ms
15,988 KB
testcase_17 AC 233 ms
18,128 KB
testcase_18 AC 121 ms
16,264 KB
testcase_19 AC 153 ms
16,868 KB
testcase_20 AC 355 ms
20,420 KB
testcase_21 AC 348 ms
20,460 KB
testcase_22 AC 352 ms
20,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

H, W, Q = gets.split.map(&:to_i)
cols = Hash.new 0
ans = H * W
Q.times do
    y, x = gets.split.map(&:to_i)
    d = H - y + 1
    d_prev = cols[x]
    d = [d, d_prev].max
    ans -= d - d_prev
    cols[x] = d
    puts ans
end
0