結果

問題 No.1338 Giant Class
ユーザー natoriusannatoriusan
提出日時 2023-07-30 23:44:56
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 958 bytes
コンパイル時間 7,765 ms
コンパイル使用メモリ 197,900 KB
実行使用メモリ 436,368 KB
最終ジャッジ日時 2024-04-18 00:55:27
合計ジャッジ時間 19,704 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 334 ms
34,688 KB
testcase_01 AC 332 ms
34,536 KB
testcase_02 AC 779 ms
57,496 KB
testcase_03 AC 333 ms
34,564 KB
testcase_04 AC 334 ms
34,572 KB
testcase_05 AC 335 ms
34,132 KB
testcase_06 AC 650 ms
91,996 KB
testcase_07 AC 762 ms
95,188 KB
testcase_08 AC 617 ms
68,324 KB
testcase_09 AC 598 ms
60,684 KB
testcase_10 AC 797 ms
73,692 KB
testcase_11 AC 394 ms
68,840 KB
testcase_12 AC 671 ms
57,792 KB
testcase_13 RE -
testcase_14 AC 565 ms
436,368 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (258 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(1,5): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
/home/judge/data/code/Main.fs(8,9): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let [|h; w; q|] = stdin.ReadLine().Split " " |> Array.map int


let seatArr = Array.replicate w (h+1)
let mutable available = (int64 h) * (int64 w)

for _ in 0..q-1 do
    let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int
    let minus =
        let m = seatArr.[x-1] - y
        if m < 0 then
            0
        else
            seatArr.[x-1] <- y
            m
    available <- available - (int64 minus)
    printfn "%d" available
    
    
// let arr =
//     [|
//         for i in 0..q-1 ->
//             let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int
//             x, y
//     |] |> Array.sort |> Array.rev
//     
// let rec count prev_x value index =
//     if index = arr.Length then
//         value
//     else
//         let x, y = arr.[index]
//         if prev_x <> x then
//             count x (value+y) (index+1)
//         else
//             count x value (index+1)
//             
// count -1 0 0 |> printfn "%d"
0