結果

問題 No.2008 Super Worker
ユーザー tnodino
提出日時 2022-07-16 14:34:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 666 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 137,144 KB
最終ジャッジ日時 2024-06-28 14:04:05
合計ジャッジ時間 10,737 ms
ジャッジサーバーID
(参考情報)
judge4 / 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()))
C = []
for i in range(N):
    C.append(((B[i]-1)/A[i], i))
C.sort(reverse=True)
ans = 0
x = 1
for i in range(N):
    idx = C[i][1]
    ans += A[idx] * x
    x *= B[idx]
    ans %= mod
    x %= mod
print(ans)
0