結果

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

ソースコード

diff #

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


class D:
    def __init__(self, a, b):
        self.a = a
        self.b = b
        self.key = (b - 1) / a


ds = [D(a, b) for a, b in zip(A, B)]
x = 1
ans = 0
for d in sorted(ds, key=lambda x: x.key, reverse=True):
    ans += d.a * x
    ans %= MOD
    x *= d.b
    x %= MOD

print(ans)
0