結果

問題 No.2008 Super Worker
ユーザー june19312june19312
提出日時 2022-07-16 00:22:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 752 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 134,628 KB
最終ジャッジ日時 2023-09-10 06:46:45
合計ジャッジ時間 12,910 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,096 KB
testcase_01 AC 70 ms
71,284 KB
testcase_02 AC 70 ms
71,336 KB
testcase_03 AC 70 ms
71,236 KB
testcase_04 AC 69 ms
71,424 KB
testcase_05 AC 68 ms
71,364 KB
testcase_06 AC 68 ms
71,492 KB
testcase_07 AC 68 ms
71,212 KB
testcase_08 AC 68 ms
71,096 KB
testcase_09 AC 70 ms
71,360 KB
testcase_10 AC 70 ms
71,284 KB
testcase_11 AC 68 ms
71,504 KB
testcase_12 AC 69 ms
71,240 KB
testcase_13 AC 79 ms
76,672 KB
testcase_14 AC 79 ms
76,860 KB
testcase_15 AC 79 ms
76,712 KB
testcase_16 AC 79 ms
76,920 KB
testcase_17 AC 79 ms
76,792 KB
testcase_18 AC 79 ms
76,820 KB
testcase_19 AC 74 ms
75,704 KB
testcase_20 AC 79 ms
76,664 KB
testcase_21 AC 77 ms
77,080 KB
testcase_22 AC 75 ms
75,636 KB
testcase_23 AC 743 ms
134,520 KB
testcase_24 AC 735 ms
134,616 KB
testcase_25 AC 746 ms
134,216 KB
testcase_26 AC 742 ms
134,392 KB
testcase_27 AC 747 ms
134,628 KB
testcase_28 AC 740 ms
125,064 KB
testcase_29 AC 748 ms
125,128 KB
testcase_30 AC 735 ms
125,292 KB
testcase_31 AC 735 ms
125,188 KB
testcase_32 AC 724 ms
125,384 KB
testcase_33 AC 215 ms
127,400 KB
testcase_34 AC 752 ms
126,144 KB
testcase_35 AC 205 ms
131,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
mod = 10**9+7

C = []

for i in range(N):
    tmp = (B[i]-1)/A[i]
    C.append([tmp,i])

C.sort(reverse=True)

level = 1
ans = 0

for i,ii in C:
    ans+=level*A[ii]
    ans = ans%mod
    level*=B[ii]
    level=level%mod

print(ans)
0