結果

問題 No.2008 Super Worker
ユーザー tnodinotnodino
提出日時 2022-07-16 14:34:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 648 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 139,264 KB
最終ジャッジ日時 2023-09-10 23:17:16
合計ジャッジ時間 12,179 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,052 KB
testcase_01 AC 71 ms
71,296 KB
testcase_02 AC 75 ms
71,080 KB
testcase_03 AC 76 ms
71,396 KB
testcase_04 AC 76 ms
71,296 KB
testcase_05 AC 76 ms
71,272 KB
testcase_06 AC 75 ms
71,448 KB
testcase_07 AC 76 ms
71,516 KB
testcase_08 AC 76 ms
71,540 KB
testcase_09 AC 76 ms
71,484 KB
testcase_10 AC 76 ms
71,292 KB
testcase_11 AC 76 ms
71,212 KB
testcase_12 AC 72 ms
71,492 KB
testcase_13 AC 81 ms
76,688 KB
testcase_14 AC 83 ms
76,928 KB
testcase_15 AC 81 ms
76,796 KB
testcase_16 AC 82 ms
76,700 KB
testcase_17 AC 81 ms
76,588 KB
testcase_18 AC 82 ms
76,680 KB
testcase_19 AC 78 ms
75,792 KB
testcase_20 AC 80 ms
76,580 KB
testcase_21 AC 79 ms
76,844 KB
testcase_22 AC 77 ms
75,796 KB
testcase_23 AC 638 ms
138,960 KB
testcase_24 AC 633 ms
139,072 KB
testcase_25 AC 648 ms
138,960 KB
testcase_26 AC 629 ms
139,264 KB
testcase_27 AC 635 ms
139,032 KB
testcase_28 AC 629 ms
133,312 KB
testcase_29 AC 629 ms
133,124 KB
testcase_30 AC 632 ms
133,172 KB
testcase_31 AC 625 ms
132,996 KB
testcase_32 AC 623 ms
133,276 KB
testcase_33 AC 203 ms
131,452 KB
testcase_34 AC 632 ms
133,956 KB
testcase_35 AC 195 ms
133,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = []
for i in range(N):
    C.append(((B[i]-1)/A[i], i))
C.sort(reverse=True)
ans = 0
x = 1
for i in range(N):
    idx = C[i][1]
    ans += A[idx] * x
    x *= B[idx]
    ans %= mod
    x %= mod
print(ans)
0