結果

問題 No.1338 Giant Class
ユーザー tamura2004tamura2004
提出日時 2021-01-21 09:42:54
言語 Ruby
(3.3.0)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 11,144 KB
実行使用メモリ 20,564 KB
最終ジャッジ日時 2023-08-25 20:49:32
合計ジャッジ時間 9,142 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,276 KB
testcase_01 AC 76 ms
15,280 KB
testcase_02 AC 293 ms
15,224 KB
testcase_03 AC 77 ms
15,092 KB
testcase_04 AC 78 ms
15,144 KB
testcase_05 AC 78 ms
15,276 KB
testcase_06 AC 241 ms
17,612 KB
testcase_07 AC 316 ms
20,024 KB
testcase_08 AC 228 ms
17,580 KB
testcase_09 AC 221 ms
17,740 KB
testcase_10 AC 337 ms
20,016 KB
testcase_11 AC 101 ms
15,992 KB
testcase_12 AC 266 ms
17,676 KB
testcase_13 AC 229 ms
17,976 KB
testcase_14 AC 116 ms
16,204 KB
testcase_15 AC 133 ms
16,732 KB
testcase_16 AC 97 ms
15,988 KB
testcase_17 AC 230 ms
17,976 KB
testcase_18 AC 117 ms
16,264 KB
testcase_19 AC 147 ms
16,764 KB
testcase_20 AC 346 ms
20,344 KB
testcase_21 AC 342 ms
20,388 KB
testcase_22 AC 341 ms
20,564 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h,w,q = gets.to_s.split.map{ |v| v.to_i }
mini = Hash.new(h)
ans = h * w
q.times do
  i,j = gets.to_s.split.map{ |v| v.to_i - 1}
  if i < mini[j]
    ans -= mini[j] - i
    mini[j] = i
  end
  puts ans
end
0