結果

問題 No.2008 Super Worker
ユーザー shotoyooshotoyoo
提出日時 2022-07-15 21:26:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 408 ms / 2,000 ms
コード長 840 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 146,356 KB
最終ジャッジ日時 2023-09-10 00:29:56
合計ジャッジ時間 9,095 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
72,312 KB
testcase_01 AC 88 ms
71,968 KB
testcase_02 AC 87 ms
72,108 KB
testcase_03 AC 92 ms
72,284 KB
testcase_04 AC 88 ms
71,968 KB
testcase_05 AC 91 ms
72,244 KB
testcase_06 AC 89 ms
72,244 KB
testcase_07 AC 86 ms
72,084 KB
testcase_08 AC 90 ms
72,096 KB
testcase_09 AC 89 ms
72,540 KB
testcase_10 AC 90 ms
72,028 KB
testcase_11 AC 89 ms
71,972 KB
testcase_12 AC 91 ms
72,068 KB
testcase_13 AC 100 ms
77,984 KB
testcase_14 AC 102 ms
78,356 KB
testcase_15 AC 101 ms
78,184 KB
testcase_16 AC 99 ms
78,372 KB
testcase_17 AC 102 ms
78,232 KB
testcase_18 AC 99 ms
78,172 KB
testcase_19 AC 93 ms
76,724 KB
testcase_20 AC 100 ms
78,112 KB
testcase_21 AC 101 ms
78,228 KB
testcase_22 AC 96 ms
76,400 KB
testcase_23 AC 400 ms
146,240 KB
testcase_24 AC 402 ms
145,920 KB
testcase_25 AC 404 ms
146,356 KB
testcase_26 AC 401 ms
146,244 KB
testcase_27 AC 404 ms
146,196 KB
testcase_28 AC 408 ms
131,628 KB
testcase_29 AC 402 ms
131,652 KB
testcase_30 AC 408 ms
131,652 KB
testcase_31 AC 404 ms
131,572 KB
testcase_32 AC 393 ms
131,812 KB
testcase_33 AC 185 ms
129,028 KB
testcase_34 AC 387 ms
132,140 KB
testcase_35 AC 179 ms
141,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, random
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(3*10**5+10)

write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); inf=10**18
LI = lambda : list(map(int, input().split()))
def debug(_l_):
    for s in _l_.split():
        print(f"{s}={eval(s)}", end=" ")
    print()
def dlist(*l, fill=0):
    if len(l)==1:
        return [fill]*l[0]
    ll = l[1:]
    return [dlist(*ll, fill=fill) for _ in range(l[0])]

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
index = list(range(n))
index.sort(key=lambda i: -(b[i]-1)/a[i])
c = 1
ans = 0
M = 10**9+7
for i in index:
    ans += c*a[i]%M
    c *= b[i]
    c %= M
print(ans%M)
0