結果

問題 No.2008 Super Worker
ユーザー Akijin_007Akijin_007
提出日時 2022-07-15 22:01:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 431 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 129,132 KB
最終ジャッジ日時 2023-09-10 01:50:28
合計ジャッジ時間 9,404 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,200 KB
testcase_01 AC 76 ms
71,364 KB
testcase_02 AC 75 ms
71,124 KB
testcase_03 AC 75 ms
70,912 KB
testcase_04 AC 76 ms
71,388 KB
testcase_05 AC 76 ms
71,100 KB
testcase_06 AC 76 ms
71,416 KB
testcase_07 AC 76 ms
71,284 KB
testcase_08 AC 76 ms
71,128 KB
testcase_09 AC 75 ms
71,312 KB
testcase_10 AC 75 ms
71,232 KB
testcase_11 AC 76 ms
71,284 KB
testcase_12 AC 74 ms
71,368 KB
testcase_13 AC 175 ms
76,428 KB
testcase_14 AC 87 ms
76,652 KB
testcase_15 AC 86 ms
76,832 KB
testcase_16 AC 86 ms
76,788 KB
testcase_17 AC 84 ms
76,788 KB
testcase_18 AC 87 ms
76,580 KB
testcase_19 AC 80 ms
75,528 KB
testcase_20 AC 84 ms
76,888 KB
testcase_21 AC 84 ms
76,632 KB
testcase_22 AC 80 ms
75,884 KB
testcase_23 AC 431 ms
129,012 KB
testcase_24 AC 428 ms
129,088 KB
testcase_25 AC 426 ms
129,060 KB
testcase_26 AC 426 ms
129,044 KB
testcase_27 AC 426 ms
129,132 KB
testcase_28 AC 420 ms
122,764 KB
testcase_29 AC 415 ms
122,608 KB
testcase_30 AC 425 ms
122,424 KB
testcase_31 AC 417 ms
122,548 KB
testcase_32 AC 419 ms
122,516 KB
testcase_33 AC 197 ms
124,172 KB
testcase_34 AC 418 ms
123,392 KB
testcase_35 AC 192 ms
125,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

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

c = [0] * N
for i in range(N):
    if B[i] == 1:
        u = 10 ** 10
    else:
        u = A[i] / (B[i]-1)
    c[i] = [A[i], B[i], u]

c = sorted(c, key=lambda x:(x[2]))

ans = 0
x = 1
# u = [1, 0, 5, 7, 3, 4, 2, 6]
for i in range(N):
# for i in u:
    # print(c[i])
    ans += x * c[i][0]
    ans %= mod
    x = (x * c[i][1]) % mod

print(ans)
0