結果

問題 No.2008 Super Worker
ユーザー lloyzlloyz
提出日時 2022-07-15 21:50:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 454 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 140,812 KB
最終ジャッジ日時 2023-09-10 01:22:37
合計ジャッジ時間 8,974 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,420 KB
testcase_01 AC 73 ms
71,300 KB
testcase_02 AC 74 ms
71,284 KB
testcase_03 AC 73 ms
71,148 KB
testcase_04 AC 73 ms
71,484 KB
testcase_05 AC 75 ms
71,324 KB
testcase_06 AC 74 ms
70,992 KB
testcase_07 AC 73 ms
71,152 KB
testcase_08 AC 73 ms
71,348 KB
testcase_09 AC 73 ms
71,344 KB
testcase_10 AC 75 ms
71,092 KB
testcase_11 AC 74 ms
71,172 KB
testcase_12 AC 72 ms
71,408 KB
testcase_13 AC 82 ms
76,832 KB
testcase_14 AC 82 ms
76,928 KB
testcase_15 AC 80 ms
76,836 KB
testcase_16 AC 79 ms
76,720 KB
testcase_17 AC 84 ms
76,560 KB
testcase_18 AC 82 ms
76,408 KB
testcase_19 AC 78 ms
75,816 KB
testcase_20 AC 82 ms
76,864 KB
testcase_21 AC 81 ms
76,708 KB
testcase_22 AC 76 ms
75,684 KB
testcase_23 AC 454 ms
140,328 KB
testcase_24 AC 452 ms
140,496 KB
testcase_25 AC 449 ms
140,292 KB
testcase_26 AC 450 ms
140,644 KB
testcase_27 AC 436 ms
140,812 KB
testcase_28 AC 441 ms
133,500 KB
testcase_29 AC 433 ms
133,468 KB
testcase_30 AC 430 ms
133,452 KB
testcase_31 AC 424 ms
133,636 KB
testcase_32 AC 432 ms
133,292 KB
testcase_33 AC 195 ms
133,348 KB
testcase_34 AC 430 ms
133,980 KB
testcase_35 AC 162 ms
120,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
AB = []
AB1 = []
for i in range(n):
    if B[i] == 1:
        AB1.append((A[i], B[i]))
    else:
        AB.append((A[i], B[i]))

AB.sort(key=lambda x: x[0] / (x[1] - 1))
mod = 10**9 + 7
ans = 0
curr = 1
for a, b in AB:
    ans += curr * a % mod
    ans %= mod
    curr *= b
    curr %= mod
for a, _ in AB1:
    ans += curr * a % mod
    ans %= mod
print(ans)
0