結果

問題 No.1338 Giant Class
ユーザー yuruhiyayuruhiya
提出日時 2021-01-15 21:36:16
言語 Crystal
(1.11.2)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 21,829 ms
コンパイル使用メモリ 255,804 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2023-09-13 13:04:12
合計ジャッジ時間 22,308 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,400 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 165 ms
5,148 KB
testcase_03 AC 3 ms
4,380 KB
testcase_04 AC 3 ms
4,460 KB
testcase_05 AC 3 ms
4,524 KB
testcase_06 AC 117 ms
10,304 KB
testcase_07 AC 166 ms
15,488 KB
testcase_08 AC 109 ms
10,192 KB
testcase_09 AC 103 ms
10,076 KB
testcase_10 AC 186 ms
15,380 KB
testcase_11 AC 21 ms
5,704 KB
testcase_12 AC 134 ms
8,028 KB
testcase_13 AC 110 ms
10,036 KB
testcase_14 AC 30 ms
5,696 KB
testcase_15 AC 44 ms
6,588 KB
testcase_16 AC 17 ms
5,540 KB
testcase_17 AC 110 ms
10,108 KB
testcase_18 AC 31 ms
6,232 KB
testcase_19 AC 52 ms
7,344 KB
testcase_20 AC 193 ms
15,396 KB
testcase_21 AC 190 ms
15,392 KB
testcase_22 AC 191 ms
15,420 KB
権限があれば一括ダウンロードができます

ソースコード

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 = Hash(Int64, Int64).new(h)
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