結果

問題 No.2008 Super Worker
ユーザー stngstng
提出日時 2022-07-16 11:59:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 756 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 139,084 KB
最終ジャッジ日時 2023-09-10 19:57:23
合計ジャッジ時間 13,106 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,404 KB
testcase_01 AC 71 ms
71,076 KB
testcase_02 AC 70 ms
71,408 KB
testcase_03 AC 71 ms
71,328 KB
testcase_04 AC 71 ms
71,180 KB
testcase_05 AC 71 ms
71,320 KB
testcase_06 AC 70 ms
71,408 KB
testcase_07 AC 72 ms
71,408 KB
testcase_08 AC 71 ms
71,408 KB
testcase_09 AC 71 ms
71,232 KB
testcase_10 AC 70 ms
71,188 KB
testcase_11 AC 71 ms
71,072 KB
testcase_12 AC 71 ms
71,308 KB
testcase_13 AC 83 ms
76,656 KB
testcase_14 AC 83 ms
76,780 KB
testcase_15 AC 85 ms
76,668 KB
testcase_16 AC 83 ms
76,740 KB
testcase_17 AC 84 ms
76,716 KB
testcase_18 AC 85 ms
76,948 KB
testcase_19 AC 74 ms
71,408 KB
testcase_20 AC 83 ms
76,736 KB
testcase_21 AC 84 ms
76,964 KB
testcase_22 AC 75 ms
71,208 KB
testcase_23 AC 748 ms
138,188 KB
testcase_24 AC 737 ms
138,600 KB
testcase_25 AC 751 ms
138,612 KB
testcase_26 AC 756 ms
138,576 KB
testcase_27 AC 744 ms
138,552 KB
testcase_28 AC 741 ms
136,416 KB
testcase_29 AC 745 ms
136,356 KB
testcase_30 AC 728 ms
136,412 KB
testcase_31 AC 726 ms
136,256 KB
testcase_32 AC 737 ms
136,400 KB
testcase_33 AC 228 ms
137,268 KB
testcase_34 AC 735 ms
136,928 KB
testcase_35 AC 224 ms
139,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
mod = 10**9+7
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

ab = []
for i in range(n):
    ab.append([a[i],b[i]])

li = []
#a1,b1 = ab[0]
#li.append([0,0])
#one = []
for i in range(n):
    li.append([(ab[i][1]-1)/ab[i][0],i])

#print(li)
li.sort(reverse=True)
#print(li)
#exit()


#ab.sort(key=lambda x:(-x[1],x[0]))
#print(ab)
x = 1
ans = 0
for i in range(len(li)):
    #print(li[i][1])
    ans += ab[li[i][1]][0]*x
    ans %= mod
    x *= ab[li[i][1]][1]
    x %= mod

print(ans)
0