結果

問題 No.2008 Super Worker
ユーザー 👑 rin204rin204
提出日時 2022-07-15 21:24:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,262 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 138,004 KB
最終ジャッジ日時 2023-09-10 00:28:09
合計ジャッジ時間 17,971 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,496 KB
testcase_01 AC 73 ms
71,376 KB
testcase_02 AC 71 ms
71,548 KB
testcase_03 AC 73 ms
71,196 KB
testcase_04 AC 74 ms
71,412 KB
testcase_05 AC 72 ms
71,356 KB
testcase_06 AC 72 ms
71,524 KB
testcase_07 AC 73 ms
71,336 KB
testcase_08 AC 73 ms
71,200 KB
testcase_09 AC 70 ms
71,388 KB
testcase_10 AC 74 ms
71,072 KB
testcase_11 AC 73 ms
71,256 KB
testcase_12 AC 71 ms
71,200 KB
testcase_13 AC 124 ms
76,772 KB
testcase_14 AC 85 ms
76,776 KB
testcase_15 AC 83 ms
76,652 KB
testcase_16 AC 83 ms
76,752 KB
testcase_17 AC 91 ms
76,536 KB
testcase_18 AC 89 ms
76,492 KB
testcase_19 AC 83 ms
75,928 KB
testcase_20 AC 87 ms
76,724 KB
testcase_21 AC 86 ms
76,760 KB
testcase_22 AC 82 ms
76,064 KB
testcase_23 AC 1,255 ms
137,796 KB
testcase_24 AC 1,236 ms
137,844 KB
testcase_25 AC 1,231 ms
137,684 KB
testcase_26 AC 1,262 ms
137,636 KB
testcase_27 AC 1,230 ms
138,004 KB
testcase_28 AC 1,242 ms
127,144 KB
testcase_29 AC 1,244 ms
127,260 KB
testcase_30 AC 1,219 ms
127,220 KB
testcase_31 AC 1,206 ms
126,944 KB
testcase_32 AC 1,242 ms
127,152 KB
testcase_33 AC 229 ms
125,224 KB
testcase_34 AC 1,220 ms
126,924 KB
testcase_35 AC 222 ms
129,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

class f:
    def __init__(self, a, b):
        self.a = a
        self.b = b
    
    def __lt__(self, other):
        return (1 - self.b) * other.a < (1 - other.b) * self.a


n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ab = [f(a, b) for a, b in zip(A, B)]
ab.sort()
x = 1
ans = 0
for tmp in ab:
    a = tmp.a
    b = tmp.b
    ans += a * x
    ans %= MOD
    x *= b
    x %= MOD
print(ans)
0