結果

問題 No.586 ダブルブッキング
ユーザー kokatsu
提出日時 2022-07-28 22:11:31
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 205,432 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 15:53:28
合計ジャッジ時間 2,450 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int P1, P2;
    readf("%d\n%d\n", P1, P2);

    int N;
    readf("%d\n", N);

    bool[int] list;
    int res;
    foreach (_; 0 .. N) {
        int R;
        readf("%d\n", R);

        if (R in list) res += P1 + P2;

        list[R] = true;
    }

    res.writeln;
}
0