結果

問題 No.2008 Super Worker
ユーザー june19312june19312
提出日時 2022-07-16 00:24:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 829 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 134,824 KB
最終ジャッジ日時 2023-09-10 06:49:35
合計ジャッジ時間 13,039 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,548 KB
testcase_01 AC 70 ms
71,324 KB
testcase_02 AC 71 ms
71,212 KB
testcase_03 AC 71 ms
71,540 KB
testcase_04 AC 72 ms
71,544 KB
testcase_05 AC 72 ms
71,184 KB
testcase_06 AC 72 ms
71,544 KB
testcase_07 AC 71 ms
71,548 KB
testcase_08 AC 71 ms
71,452 KB
testcase_09 AC 70 ms
71,188 KB
testcase_10 AC 72 ms
71,464 KB
testcase_11 AC 71 ms
71,544 KB
testcase_12 AC 72 ms
71,320 KB
testcase_13 AC 83 ms
76,816 KB
testcase_14 AC 82 ms
77,024 KB
testcase_15 AC 82 ms
76,896 KB
testcase_16 AC 83 ms
76,992 KB
testcase_17 AC 82 ms
76,820 KB
testcase_18 AC 83 ms
76,988 KB
testcase_19 AC 76 ms
75,892 KB
testcase_20 AC 80 ms
76,848 KB
testcase_21 AC 81 ms
77,088 KB
testcase_22 AC 75 ms
75,888 KB
testcase_23 AC 760 ms
134,744 KB
testcase_24 AC 772 ms
134,824 KB
testcase_25 AC 775 ms
134,356 KB
testcase_26 AC 774 ms
134,624 KB
testcase_27 AC 769 ms
134,632 KB
testcase_28 AC 803 ms
124,904 KB
testcase_29 AC 806 ms
124,784 KB
testcase_30 AC 805 ms
124,840 KB
testcase_31 AC 798 ms
124,644 KB
testcase_32 AC 794 ms
124,916 KB
testcase_33 AC 221 ms
126,640 KB
testcase_34 AC 829 ms
125,356 KB
testcase_35 AC 203 ms
131,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

C = []

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

C.sort()
C.reverse()

level = 1
ans = 0

for i,v in enumerate(C):
    tmp1 = v[1]
    ans+=level*A[tmp1]
    ans%mod
    level*=B[tmp1]
    level=level%mod

print(ans%mod)
0