結果

問題 No.2008 Super Worker
ユーザー tktk_snsntktk_snsn
提出日時 2022-07-15 21:26:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 521 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 11,000 KB
実行使用メモリ 43,760 KB
最終ジャッジ日時 2023-09-10 00:30:49
合計ジャッジ時間 8,232 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,820 KB
testcase_01 AC 16 ms
7,716 KB
testcase_02 AC 17 ms
7,916 KB
testcase_03 AC 15 ms
7,916 KB
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 16 ms
7,928 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 16 ms
7,920 KB
testcase_08 AC 16 ms
7,716 KB
testcase_09 AC 16 ms
7,884 KB
testcase_10 AC 15 ms
7,780 KB
testcase_11 AC 15 ms
7,820 KB
testcase_12 AC 16 ms
7,800 KB
testcase_13 AC 17 ms
8,320 KB
testcase_14 AC 18 ms
8,416 KB
testcase_15 AC 17 ms
8,144 KB
testcase_16 AC 18 ms
8,308 KB
testcase_17 AC 18 ms
8,428 KB
testcase_18 AC 18 ms
8,576 KB
testcase_19 AC 18 ms
8,340 KB
testcase_20 AC 17 ms
8,364 KB
testcase_21 AC 17 ms
8,260 KB
testcase_22 AC 18 ms
8,144 KB
testcase_23 AC 462 ms
38,352 KB
testcase_24 AC 469 ms
38,396 KB
testcase_25 AC 471 ms
38,380 KB
testcase_26 AC 465 ms
38,496 KB
testcase_27 AC 459 ms
38,356 KB
testcase_28 AC 490 ms
41,796 KB
testcase_29 AC 503 ms
41,728 KB
testcase_30 AC 521 ms
41,696 KB
testcase_31 AC 501 ms
41,732 KB
testcase_32 AC 495 ms
41,660 KB
testcase_33 AC 287 ms
39,244 KB
testcase_34 AC 475 ms
43,760 KB
testcase_35 AC 373 ms
35,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10 ** 9 + 7


N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

*idx, = range(N)
idx.sort(key=lambda i: A[i] / (B[i] - 1 + 1e-18))
A = [A[i] for i in idx]
B = [B[i] for i in idx]

ans = 0
L = 1
for a, b in zip(A, B):
    ans += L * a
    ans %= mod
    L = L * b % mod

print(ans)
0