結果

問題 No.1279 Array Battle
ユーザー jensenjensen
提出日時 2021-01-03 18:54:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,684 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,448 KB
実行使用メモリ 65,144 KB
最終ジャッジ日時 2023-08-03 15:57:24
合計ジャッジ時間 9,808 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,180 KB
testcase_01 AC 14 ms
8,120 KB
testcase_02 AC 15 ms
8,204 KB
testcase_03 AC 17 ms
8,068 KB
testcase_04 AC 17 ms
8,232 KB
testcase_05 AC 16 ms
8,100 KB
testcase_06 AC 15 ms
8,104 KB
testcase_07 AC 16 ms
8,084 KB
testcase_08 AC 15 ms
8,224 KB
testcase_09 AC 15 ms
8,084 KB
testcase_10 AC 15 ms
8,084 KB
testcase_11 AC 17 ms
8,208 KB
testcase_12 AC 33 ms
8,804 KB
testcase_13 AC 180 ms
14,504 KB
testcase_14 AC 179 ms
14,312 KB
testcase_15 AC 1,515 ms
53,952 KB
testcase_16 AC 1,524 ms
53,936 KB
testcase_17 AC 1,678 ms
65,068 KB
testcase_18 AC 1,645 ms
65,144 KB
testcase_19 AC 1,684 ms
65,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
scores=[]
for x in list(permutations(a)):
    score=0
    for i in range(N):
        score+=max((x[i]-b[i]),0)
    scores.append(score)
print(scores.count(max(scores)))
0