結果

問題 No.2008 Super Worker
ユーザー kokatsukokatsu
提出日時 2022-07-16 22:39:34
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 3,649 ms
コンパイル使用メモリ 217,408 KB
実行使用メモリ 16,372 KB
最終ジャッジ日時 2023-09-04 17:52:25
合計ジャッジ時間 5,247 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,384 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 84 ms
12,948 KB
testcase_24 AC 84 ms
14,216 KB
testcase_25 AC 83 ms
13,016 KB
testcase_26 AC 83 ms
12,884 KB
testcase_27 AC 84 ms
13,000 KB
testcase_28 AC 99 ms
14,476 KB
testcase_29 AC 99 ms
15,324 KB
testcase_30 AC 99 ms
15,580 KB
testcase_31 AC 98 ms
14,068 KB
testcase_32 AC 97 ms
13,932 KB
testcase_33 AC 82 ms
16,372 KB
testcase_34 AC 98 ms
15,008 KB
testcase_35 AC 63 ms
13,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    long N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(long[]);
    auto B = readln.chomp.split.to!(long[]);

    auto M = 10 ^^ 9 + 7;

    zip(A, B).sort!"a[0] * (b[1] - 1) < b[0] * (a[1] - 1)";

    long res, x = 1;
    foreach (a, b; zip(A, B)) {
        res = (res + a * x) % M;
        x = (x * b) % M;
    }

    res.writeln;
}
0