結果

問題 No.1338 Giant Class
ユーザー yuruhiyayuruhiya
提出日時 2021-01-15 21:34:55
言語 Crystal
(1.11.2)
結果
RE  
実行時間 -
コード長 326 bytes
コンパイル時間 18,474 ms
コンパイル使用メモリ 256,236 KB
実行使用メモリ 814,480 KB
最終ジャッジ日時 2023-09-13 13:03:40
合計ジャッジ時間 23,672 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 162 ms
5,832 KB
testcase_03 AC 3 ms
4,388 KB
testcase_04 AC 3 ms
4,396 KB
testcase_05 AC 3 ms
4,444 KB
testcase_06 AC 144 ms
89,360 KB
testcase_07 AC 190 ms
92,672 KB
testcase_08 AC 115 ms
35,724 KB
testcase_09 AC 100 ms
13,708 KB
testcase_10 AC 188 ms
36,660 KB
testcase_11 AC 41 ms
67,008 KB
testcase_12 AC 122 ms
5,652 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 #

lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

h, w, q = read_line.split.map(&.to_i64)
a = [h] * w
sum = h * w
q.times do |i|
  y, x = read_line.split.map(&.to_i64.pred)
  if a[x] > y
    sum -= a[x] - y
    a[x] = y
  end
  puts sum
end
0