結果

問題 No.2008 Super Worker
ユーザー gr1msl3ygr1msl3y
提出日時 2022-08-29 23:18:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 115,468 KB
最終ジャッジ日時 2024-04-24 12:12:44
合計ジャッジ時間 6,349 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,320 KB
testcase_01 AC 35 ms
52,484 KB
testcase_02 AC 35 ms
52,516 KB
testcase_03 AC 34 ms
53,260 KB
testcase_04 AC 34 ms
53,036 KB
testcase_05 AC 34 ms
52,552 KB
testcase_06 AC 34 ms
53,092 KB
testcase_07 AC 34 ms
53,356 KB
testcase_08 AC 34 ms
54,000 KB
testcase_09 AC 34 ms
52,824 KB
testcase_10 AC 34 ms
53,200 KB
testcase_11 AC 33 ms
52,204 KB
testcase_12 AC 33 ms
52,992 KB
testcase_13 AC 41 ms
62,204 KB
testcase_14 AC 43 ms
61,272 KB
testcase_15 AC 44 ms
61,168 KB
testcase_16 AC 44 ms
61,216 KB
testcase_17 AC 45 ms
61,596 KB
testcase_18 AC 42 ms
62,100 KB
testcase_19 AC 41 ms
58,796 KB
testcase_20 AC 43 ms
61,620 KB
testcase_21 AC 43 ms
61,684 KB
testcase_22 AC 41 ms
59,456 KB
testcase_23 AC 300 ms
111,716 KB
testcase_24 AC 304 ms
111,340 KB
testcase_25 AC 300 ms
111,600 KB
testcase_26 AC 293 ms
111,856 KB
testcase_27 AC 294 ms
111,724 KB
testcase_28 AC 304 ms
114,984 KB
testcase_29 AC 302 ms
114,980 KB
testcase_30 AC 302 ms
115,096 KB
testcase_31 AC 313 ms
115,208 KB
testcase_32 AC 310 ms
115,020 KB
testcase_33 AC 149 ms
114,744 KB
testcase_34 AC 310 ms
115,468 KB
testcase_35 AC 128 ms
110,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
X=list(range(N))
X.sort(key=lambda x: -(B[x]-1)/A[x])
ans=0
MOD=10**9+7
x=1
for i in X:
    a,b=A[i],B[i]
    ans+=x*a%MOD
    ans%=MOD
    x=x*b%MOD
print(ans)
0