結果

問題 No.1338 Giant Class
ユーザー kokatsukokatsu
提出日時 2022-11-25 00:38:17
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 3,308 ms
コンパイル使用メモリ 200,060 KB
実行使用メモリ 9,064 KB
最終ジャッジ日時 2023-09-04 19:03:43
合計ジャッジ時間 7,918 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 88 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 69 ms
7,700 KB
testcase_07 AC 100 ms
8,724 KB
testcase_08 AC 64 ms
6,912 KB
testcase_09 AC 60 ms
7,676 KB
testcase_10 AC 110 ms
7,960 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 75 ms
6,960 KB
testcase_13 AC 67 ms
6,880 KB
testcase_14 AC 19 ms
4,384 KB
testcase_15 AC 28 ms
4,384 KB
testcase_16 AC 11 ms
4,380 KB
testcase_17 AC 68 ms
6,912 KB
testcase_18 AC 19 ms
4,384 KB
testcase_19 AC 34 ms
6,688 KB
testcase_20 AC 120 ms
9,064 KB
testcase_21 AC 122 ms
9,024 KB
testcase_22 AC 122 ms
7,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    long H, W, Q;
    readf("%d %d %d\n", H, W, Q);

    long num = H * W;
    long[long] sit;
    foreach (_; 0 .. Q) {
        long Y, X;
        readf("%d %d\n", Y, X);

        if (X in sit) {
            if (Y < sit[X]) {
                num -= sit[X] - Y;
                sit[X] = Y;
            }
        }
        else {
            num -= H - Y + 1;
            sit[X] = Y;
        }

        num.writeln;
    }
}
0