結果

問題 No.2008 Super Worker
ユーザー PNJPNJ
提出日時 2023-10-24 00:58:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 404 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 53,748 KB
最終ジャッジ日時 2023-10-24 00:59:24
合計ジャッジ時間 16,888 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,256 KB
testcase_01 AC 29 ms
10,148 KB
testcase_02 AC 28 ms
10,148 KB
testcase_03 AC 28 ms
10,148 KB
testcase_04 AC 28 ms
10,148 KB
testcase_05 AC 29 ms
10,148 KB
testcase_06 AC 29 ms
10,148 KB
testcase_07 AC 29 ms
10,148 KB
testcase_08 AC 29 ms
10,148 KB
testcase_09 AC 32 ms
10,148 KB
testcase_10 AC 29 ms
10,148 KB
testcase_11 AC 28 ms
10,148 KB
testcase_12 AC 29 ms
10,148 KB
testcase_13 AC 32 ms
10,308 KB
testcase_14 AC 34 ms
10,360 KB
testcase_15 AC 33 ms
10,304 KB
testcase_16 AC 33 ms
10,352 KB
testcase_17 AC 33 ms
10,352 KB
testcase_18 AC 38 ms
10,568 KB
testcase_19 AC 33 ms
10,344 KB
testcase_20 AC 34 ms
10,392 KB
testcase_21 AC 34 ms
10,396 KB
testcase_22 AC 33 ms
10,344 KB
testcase_23 AC 1,597 ms
49,724 KB
testcase_24 AC 1,601 ms
49,720 KB
testcase_25 AC 1,582 ms
49,744 KB
testcase_26 AC 1,605 ms
49,732 KB
testcase_27 AC 1,617 ms
49,984 KB
testcase_28 AC 1,944 ms
52,284 KB
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 AC 480 ms
50,792 KB
testcase_34 TLE -
testcase_35 AC 417 ms
45,972 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