結果

問題 No.2008 Super Worker
ユーザー ああいいああいい
提出日時 2022-07-17 11:26:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 454 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 140,916 KB
最終ジャッジ日時 2023-09-11 23:20:47
合計ジャッジ時間 9,589 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,080 KB
testcase_01 AC 75 ms
71,296 KB
testcase_02 AC 74 ms
71,244 KB
testcase_03 AC 75 ms
71,372 KB
testcase_04 AC 76 ms
71,452 KB
testcase_05 AC 75 ms
71,396 KB
testcase_06 AC 78 ms
71,564 KB
testcase_07 AC 77 ms
71,348 KB
testcase_08 AC 76 ms
71,416 KB
testcase_09 AC 78 ms
71,240 KB
testcase_10 AC 77 ms
71,420 KB
testcase_11 AC 76 ms
71,644 KB
testcase_12 AC 77 ms
71,616 KB
testcase_13 AC 87 ms
76,972 KB
testcase_14 AC 84 ms
76,800 KB
testcase_15 AC 85 ms
76,848 KB
testcase_16 AC 85 ms
76,856 KB
testcase_17 AC 84 ms
76,980 KB
testcase_18 AC 84 ms
76,696 KB
testcase_19 AC 80 ms
75,784 KB
testcase_20 AC 84 ms
76,828 KB
testcase_21 AC 83 ms
76,812 KB
testcase_22 AC 81 ms
75,708 KB
testcase_23 AC 445 ms
140,380 KB
testcase_24 AC 450 ms
140,720 KB
testcase_25 AC 454 ms
140,908 KB
testcase_26 AC 449 ms
140,696 KB
testcase_27 AC 445 ms
140,916 KB
testcase_28 AC 440 ms
133,448 KB
testcase_29 AC 439 ms
133,692 KB
testcase_30 AC 437 ms
133,468 KB
testcase_31 AC 438 ms
133,608 KB
testcase_32 AC 433 ms
133,528 KB
testcase_33 AC 199 ms
133,416 KB
testcase_34 AC 439 ms
134,108 KB
testcase_35 AC 177 ms
120,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
P = 10 ** 9 + 7
inf = 10 ** 9
def f(x):
    a,b = x
    if b == 1:
        return inf
    else:
        return a / (b - 1)
C = [(a,b) for a,b in zip(A,B)]
C.sort(key = f)
ans = 0
now = 1
for a,b in C:
    ans += a * now
    ans %= P
    now = now * b % P
print(ans)
0