結果

問題 No.1279 Array Battle
ユーザー 👑 H20H20
提出日時 2021-02-09 09:32:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 1,086 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 132,044 KB
最終ジャッジ日時 2023-09-20 19:53:17
合計ジャッジ時間 4,324 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,512 KB
testcase_01 AC 73 ms
71,312 KB
testcase_02 AC 73 ms
71,296 KB
testcase_03 AC 73 ms
71,348 KB
testcase_04 AC 72 ms
71,384 KB
testcase_05 AC 72 ms
71,312 KB
testcase_06 AC 71 ms
71,244 KB
testcase_07 AC 73 ms
71,380 KB
testcase_08 AC 73 ms
71,320 KB
testcase_09 AC 71 ms
71,428 KB
testcase_10 AC 72 ms
71,352 KB
testcase_11 AC 82 ms
76,340 KB
testcase_12 AC 82 ms
76,328 KB
testcase_13 AC 92 ms
78,616 KB
testcase_14 AC 90 ms
78,776 KB
testcase_15 AC 194 ms
131,772 KB
testcase_16 AC 214 ms
131,772 KB
testcase_17 AC 208 ms
131,900 KB
testcase_18 AC 212 ms
132,044 KB
testcase_19 AC 209 ms
131,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mp = 0
cnt = 0
for l in list(itertools.permutations(A)):
    point=0
    for i in range(N):
        point+=max(0,l[i]-B[i])
    if mp == point:
        cnt+=1
    elif mp<point:
        mp=point
        cnt=1
print(cnt)

0