結果

問題 No.1338 Giant Class
コンテスト
ユーザー yuruhiya
提出日時 2021-01-15 21:34:55
言語 Crystal
(1.19.1)
コンパイル:
crystal build -Donline_judge -o a.out --release --no-debug _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 326 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,589 ms
コンパイル使用メモリ 340,200 KB
実行使用メモリ 1,299,584 KB
最終ジャッジ日時 2026-03-21 08:32:27
合計ジャッジ時間 13,548 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 RE * 1 MLE * 3 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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