結果

問題 No.1279 Array Battle
ユーザー ayaoniayaoni
提出日時 2020-11-06 23:25:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 368 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 144,160 KB
最終ジャッジ日時 2023-09-29 19:40:26
合計ジャッジ時間 4,402 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,012 KB
testcase_01 AC 70 ms
71,448 KB
testcase_02 AC 72 ms
71,444 KB
testcase_03 AC 71 ms
71,108 KB
testcase_04 AC 75 ms
71,252 KB
testcase_05 AC 72 ms
71,408 KB
testcase_06 AC 73 ms
71,372 KB
testcase_07 AC 71 ms
71,460 KB
testcase_08 AC 71 ms
71,456 KB
testcase_09 AC 69 ms
71,336 KB
testcase_10 AC 72 ms
71,332 KB
testcase_11 AC 89 ms
75,768 KB
testcase_12 AC 124 ms
78,444 KB
testcase_13 AC 138 ms
84,412 KB
testcase_14 AC 131 ms
84,320 KB
testcase_15 AC 336 ms
143,424 KB
testcase_16 AC 368 ms
143,952 KB
testcase_17 AC 362 ms
144,160 KB
testcase_18 AC 368 ms
143,812 KB
testcase_19 AC 351 ms
143,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))


N = I()
A,B = LI(),LI()

ANS = []
for X in list(permutations([i for i in range(N)],N)):
    ANS.append(sum(max(0,A[X[i]]-B[i]) for i in range(N)))

print(ANS.count(max(ANS)))
0