結果

問題 No.2008 Super Worker
ユーザー ニックネームニックネーム
提出日時 2022-07-15 21:50:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 602 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 47,092 KB
最終ジャッジ日時 2023-09-10 01:24:37
合計ジャッジ時間 10,467 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,928 KB
testcase_01 AC 15 ms
7,744 KB
testcase_02 AC 16 ms
7,848 KB
testcase_03 AC 16 ms
7,712 KB
testcase_04 AC 15 ms
7,768 KB
testcase_05 AC 16 ms
7,812 KB
testcase_06 AC 16 ms
7,888 KB
testcase_07 AC 16 ms
7,768 KB
testcase_08 AC 15 ms
7,860 KB
testcase_09 AC 16 ms
7,800 KB
testcase_10 AC 15 ms
7,796 KB
testcase_11 AC 15 ms
7,780 KB
testcase_12 AC 15 ms
7,928 KB
testcase_13 AC 17 ms
8,352 KB
testcase_14 AC 18 ms
8,304 KB
testcase_15 AC 17 ms
8,356 KB
testcase_16 AC 18 ms
8,176 KB
testcase_17 AC 18 ms
8,348 KB
testcase_18 AC 19 ms
8,464 KB
testcase_19 AC 18 ms
8,176 KB
testcase_20 AC 17 ms
8,332 KB
testcase_21 AC 18 ms
8,192 KB
testcase_22 AC 17 ms
8,248 KB
testcase_23 AC 587 ms
44,772 KB
testcase_24 AC 580 ms
44,764 KB
testcase_25 AC 579 ms
44,868 KB
testcase_26 AC 585 ms
44,788 KB
testcase_27 AC 585 ms
44,796 KB
testcase_28 AC 596 ms
46,276 KB
testcase_29 AC 598 ms
47,092 KB
testcase_30 AC 602 ms
46,928 KB
testcase_31 AC 600 ms
46,348 KB
testcase_32 AC 594 ms
46,232 KB
testcase_33 AC 341 ms
45,676 KB
testcase_34 AC 601 ms
47,060 KB
testcase_35 AC 538 ms
41,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
mod = 10**9+7
rab = []
for ai, bi in zip(a, b):
    rab.append(((bi-1)/ai, ai, bi))
rab.sort()
x = 1
ans = 0
for _, ai, bi in rab[::-1]:
    ans = (ans+ai*x)%mod
    x = bi*x%mod
print(ans)
0