結果

問題 No.2008 Super Worker
ユーザー norioc
提出日時 2025-09-26 01:09:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 139,624 KB
最終ジャッジ日時 2025-09-26 01:09:08
合計ジャッジ時間 6,198 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


def key(x):
    a, b = x
    return (b - 1) / a


xs = list(zip(A, B))

x = 1
ans = 0
for a, b in sorted(xs, key=key, reverse=True):
    ans += a * x
    ans %= MOD
    x = b * x

print(ans)
0