結果

問題 No.2008 Super Worker
ユーザー googol_S0
提出日時 2022-07-15 21:43:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 321 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 158,952 KB
最終ジャッジ日時 2024-06-27 17:21:14
合計ジャッジ時間 8,853 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
from decimal import *
getcontext().prec=30
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