結果

問題 No.2008 Super Worker
ユーザー Kiri8128Kiri8128
提出日時 2022-04-27 01:54:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,411 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 135,336 KB
最終ジャッジ日時 2023-09-10 16:30:34
合計ジャッジ時間 20,728 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
72,256 KB
testcase_01 AC 107 ms
72,184 KB
testcase_02 AC 109 ms
72,256 KB
testcase_03 AC 109 ms
72,388 KB
testcase_04 AC 107 ms
72,416 KB
testcase_05 AC 108 ms
72,296 KB
testcase_06 AC 108 ms
72,448 KB
testcase_07 AC 111 ms
72,208 KB
testcase_08 AC 109 ms
72,340 KB
testcase_09 AC 109 ms
72,268 KB
testcase_10 AC 109 ms
72,356 KB
testcase_11 AC 106 ms
72,224 KB
testcase_12 AC 107 ms
72,388 KB
testcase_13 AC 123 ms
77,384 KB
testcase_14 AC 125 ms
77,764 KB
testcase_15 AC 124 ms
77,680 KB
testcase_16 AC 125 ms
77,512 KB
testcase_17 AC 123 ms
77,876 KB
testcase_18 AC 126 ms
77,872 KB
testcase_19 AC 118 ms
76,944 KB
testcase_20 AC 125 ms
77,604 KB
testcase_21 AC 123 ms
77,608 KB
testcase_22 AC 121 ms
76,680 KB
testcase_23 AC 1,380 ms
132,848 KB
testcase_24 AC 1,411 ms
133,064 KB
testcase_25 AC 1,381 ms
132,788 KB
testcase_26 AC 1,370 ms
132,824 KB
testcase_27 AC 1,399 ms
132,708 KB
testcase_28 AC 1,366 ms
135,164 KB
testcase_29 AC 1,381 ms
135,156 KB
testcase_30 AC 1,379 ms
135,088 KB
testcase_31 AC 1,405 ms
135,168 KB
testcase_32 AC 1,360 ms
135,312 KB
testcase_33 AC 269 ms
129,748 KB
testcase_34 AC 1,373 ms
135,336 KB
testcase_35 AC 264 ms
132,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import cmp_to_key
def cmp(a, b):
    x, y = a[0], a[1] - 1
    xx, yy = b[0], b[1] - 1
    s = x * yy - y * xx
    return 1 if s > 0 else -1 if s < 0 else 0

cmpkey = cmp_to_key(cmp)

P = 10 ** 9 + 7
N = int(input())
X = sorted([(int(a), int(b)) for a, b in zip(input().split(), input().split())], key = cmpkey)
ans = 0
l = 1
for a, b in X:
    ans = (ans + l * a) % P
    l = l * b % P
print(ans)
0