結果

問題 No.2008 Super Worker
ユーザー googol_S0googol_S0
提出日時 2022-07-15 21:44:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 992 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 62,392 KB
最終ジャッジ日時 2023-09-10 01:12:03
合計ジャッジ時間 14,194 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,972 KB
testcase_01 AC 22 ms
8,888 KB
testcase_02 AC 21 ms
9,080 KB
testcase_03 AC 21 ms
8,892 KB
testcase_04 AC 21 ms
8,904 KB
testcase_05 AC 21 ms
8,928 KB
testcase_06 AC 21 ms
8,968 KB
testcase_07 AC 20 ms
8,900 KB
testcase_08 AC 21 ms
9,068 KB
testcase_09 AC 21 ms
9,092 KB
testcase_10 AC 20 ms
9,076 KB
testcase_11 AC 21 ms
8,968 KB
testcase_12 AC 21 ms
8,972 KB
testcase_13 AC 25 ms
9,216 KB
testcase_14 AC 26 ms
9,280 KB
testcase_15 AC 25 ms
9,340 KB
testcase_16 AC 25 ms
9,196 KB
testcase_17 AC 25 ms
9,360 KB
testcase_18 AC 26 ms
9,424 KB
testcase_19 AC 24 ms
9,120 KB
testcase_20 AC 25 ms
9,240 KB
testcase_21 AC 24 ms
9,316 KB
testcase_22 AC 24 ms
9,312 KB
testcase_23 AC 992 ms
59,812 KB
testcase_24 AC 965 ms
59,804 KB
testcase_25 AC 962 ms
59,940 KB
testcase_26 AC 966 ms
59,748 KB
testcase_27 AC 976 ms
59,732 KB
testcase_28 AC 992 ms
62,168 KB
testcase_29 AC 970 ms
62,060 KB
testcase_30 AC 974 ms
62,148 KB
testcase_31 AC 960 ms
62,048 KB
testcase_32 AC 972 ms
62,136 KB
testcase_33 AC 460 ms
62,392 KB
testcase_34 AC 976 ms
62,192 KB
testcase_35 AC 700 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

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