結果

問題 No.1279 Array Battle
ユーザー hir355hir355
提出日時 2020-11-06 21:58:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 77,136 KB
最終ジャッジ日時 2023-09-29 18:42:13
合計ジャッジ時間 2,787 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,456 KB
testcase_01 AC 62 ms
71,164 KB
testcase_02 AC 63 ms
71,560 KB
testcase_03 AC 65 ms
71,488 KB
testcase_04 AC 65 ms
71,440 KB
testcase_05 AC 63 ms
71,220 KB
testcase_06 AC 66 ms
71,364 KB
testcase_07 AC 68 ms
71,360 KB
testcase_08 AC 68 ms
71,328 KB
testcase_09 AC 65 ms
71,172 KB
testcase_10 AC 64 ms
71,484 KB
testcase_11 AC 69 ms
76,708 KB
testcase_12 AC 73 ms
76,608 KB
testcase_13 AC 78 ms
76,456 KB
testcase_14 AC 80 ms
76,460 KB
testcase_15 AC 104 ms
76,752 KB
testcase_16 AC 113 ms
77,116 KB
testcase_17 AC 121 ms
76,840 KB
testcase_18 AC 119 ms
77,000 KB
testcase_19 AC 122 ms
77,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ma = 0
ans = 0
for x in permutations(a):
    t = 0
    for i in range(n):
        t += max(0, x[i] - b[i])
    if t > ma:
        ans = 1
        ma = t
    elif t == ma:
        ans += 1
print(ans)
0