結果

問題 No.2008 Super Worker
ユーザー PNJPNJ
提出日時 2023-10-24 00:59:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,339 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 1,818 ms
コンパイル使用メモリ 81,604 KB
実行使用メモリ 138,616 KB
最終ジャッジ日時 2023-10-24 00:59:50
合計ジャッジ時間 19,238 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
55,468 KB
testcase_01 AC 43 ms
55,468 KB
testcase_02 AC 44 ms
55,468 KB
testcase_03 AC 44 ms
55,468 KB
testcase_04 AC 44 ms
55,468 KB
testcase_05 AC 45 ms
55,468 KB
testcase_06 AC 71 ms
55,468 KB
testcase_07 AC 43 ms
55,468 KB
testcase_08 AC 44 ms
55,468 KB
testcase_09 AC 45 ms
55,468 KB
testcase_10 AC 44 ms
55,468 KB
testcase_11 AC 45 ms
55,468 KB
testcase_12 AC 44 ms
55,468 KB
testcase_13 AC 62 ms
70,636 KB
testcase_14 AC 62 ms
72,692 KB
testcase_15 AC 61 ms
70,644 KB
testcase_16 AC 62 ms
72,692 KB
testcase_17 AC 62 ms
72,692 KB
testcase_18 AC 68 ms
76,324 KB
testcase_19 AC 57 ms
68,020 KB
testcase_20 AC 61 ms
70,640 KB
testcase_21 AC 61 ms
70,640 KB
testcase_22 AC 56 ms
68,020 KB
testcase_23 AC 1,339 ms
123,064 KB
testcase_24 AC 1,299 ms
123,064 KB
testcase_25 AC 1,307 ms
123,072 KB
testcase_26 AC 1,296 ms
123,064 KB
testcase_27 AC 1,290 ms
123,068 KB
testcase_28 AC 1,300 ms
120,296 KB
testcase_29 AC 1,318 ms
120,300 KB
testcase_30 AC 1,284 ms
120,304 KB
testcase_31 AC 1,299 ms
120,312 KB
testcase_32 AC 1,303 ms
120,312 KB
testcase_33 AC 216 ms
138,616 KB
testcase_34 AC 1,307 ms
121,104 KB
testcase_35 AC 200 ms
120,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
mod = 10**9 + 7
C = [(A[i],B[i]) for i in range(N)]
C.sort(key = cmp_to_key(cmp))
x = 1
ans = 0
for a,b in C:
  ans += a*x
  ans %= mod
  x *= b
  x %= mod
print(ans)
0