結果

問題 No.1279 Array Battle
ユーザー 👑 KazunKazun
提出日時 2020-11-06 21:26:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 76,932 KB
最終ジャッジ日時 2023-09-29 18:07:12
合計ジャッジ時間 2,872 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,480 KB
testcase_01 AC 65 ms
71,512 KB
testcase_02 AC 68 ms
71,288 KB
testcase_03 AC 71 ms
71,284 KB
testcase_04 AC 70 ms
71,608 KB
testcase_05 AC 71 ms
71,216 KB
testcase_06 AC 68 ms
71,272 KB
testcase_07 AC 69 ms
71,284 KB
testcase_08 AC 67 ms
71,520 KB
testcase_09 AC 70 ms
71,480 KB
testcase_10 AC 66 ms
71,336 KB
testcase_11 AC 73 ms
76,576 KB
testcase_12 AC 73 ms
76,684 KB
testcase_13 AC 80 ms
76,428 KB
testcase_14 AC 81 ms
76,492 KB
testcase_15 AC 107 ms
76,448 KB
testcase_16 AC 120 ms
76,856 KB
testcase_17 AC 122 ms
76,852 KB
testcase_18 AC 129 ms
76,852 KB
testcase_19 AC 123 ms
76,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

Max=-1
Count=0
for alpha in permutations(A):
    X=0
    for i in range(N):
        X+=max(0,alpha[i]-B[i])

    if X==Max:
        Count+=1
    elif X>Max:
        Max=X
        Count=1
print(Count)
0