結果

問題 No.2008 Super Worker
ユーザー ryusukeryusuke
提出日時 2022-07-16 10:23:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 462 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 136,808 KB
最終ジャッジ日時 2023-09-10 17:56:56
合計ジャッジ時間 8,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,512 KB
testcase_01 AC 71 ms
71,276 KB
testcase_02 AC 69 ms
71,084 KB
testcase_03 AC 70 ms
71,324 KB
testcase_04 AC 71 ms
71,512 KB
testcase_05 AC 70 ms
71,160 KB
testcase_06 AC 71 ms
71,336 KB
testcase_07 AC 70 ms
71,232 KB
testcase_08 AC 70 ms
71,200 KB
testcase_09 AC 70 ms
71,464 KB
testcase_10 AC 70 ms
71,068 KB
testcase_11 AC 71 ms
71,336 KB
testcase_12 AC 71 ms
71,212 KB
testcase_13 AC 80 ms
76,664 KB
testcase_14 AC 79 ms
76,364 KB
testcase_15 AC 80 ms
76,900 KB
testcase_16 AC 80 ms
76,804 KB
testcase_17 AC 78 ms
76,676 KB
testcase_18 AC 79 ms
76,364 KB
testcase_19 AC 75 ms
75,556 KB
testcase_20 AC 80 ms
76,720 KB
testcase_21 AC 81 ms
76,580 KB
testcase_22 AC 76 ms
75,632 KB
testcase_23 AC 446 ms
136,772 KB
testcase_24 AC 442 ms
136,808 KB
testcase_25 AC 442 ms
136,360 KB
testcase_26 AC 438 ms
136,360 KB
testcase_27 AC 437 ms
136,724 KB
testcase_28 AC 431 ms
126,484 KB
testcase_29 AC 427 ms
126,400 KB
testcase_30 AC 417 ms
126,256 KB
testcase_31 AC 462 ms
126,596 KB
testcase_32 AC 424 ms
126,140 KB
testcase_33 AC 183 ms
124,588 KB
testcase_34 AC 423 ms
126,904 KB
testcase_35 AC 181 ms
128,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

l = []
for i in range(n):
    l.append((a[i], b[i], (b[i] - 1) / a[i]))

l.sort(key=lambda x: x[2], reverse=True)
ans = 0
mod = 10 ** 9 + 7
level = 1
for i in range(n):
    ans += level * l[i][0]
    level *= l[i][1]
    level %= mod
    ans %= mod

print(ans)
0