結果

問題 No.2008 Super Worker
ユーザー googol_S0
提出日時 2022-07-15 21:44:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,160 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 64,552 KB
最終ジャッジ日時 2024-06-27 17:22:26
合計ジャッジ時間 16,714 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
from decimal import *
getcontext().prec=50
X=[(Decimal(B[i]-1)/Decimal(A[i]),A[i],B[i]) for i in range(N)]
X.sort(reverse=True)
ANS=0
V=1
mod=998244353
mod=10**9+7
for i in range(N):
  ANS=(ANS+V*X[i][1])%mod
  V=(V*X[i][2])%mod
print(ANS)
0