結果

問題 No.1279 Array Battle
ユーザー marroncastlemarroncastle
提出日時 2020-11-06 21:42:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 78,060 KB
最終ジャッジ日時 2023-09-29 18:29:23
合計ジャッジ時間 3,307 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,604 KB
testcase_01 AC 83 ms
71,776 KB
testcase_02 AC 86 ms
71,740 KB
testcase_03 AC 80 ms
71,480 KB
testcase_04 AC 77 ms
71,788 KB
testcase_05 AC 83 ms
71,396 KB
testcase_06 AC 79 ms
71,440 KB
testcase_07 AC 83 ms
71,680 KB
testcase_08 AC 78 ms
71,744 KB
testcase_09 AC 78 ms
71,544 KB
testcase_10 AC 84 ms
71,896 KB
testcase_11 AC 97 ms
77,752 KB
testcase_12 AC 94 ms
77,856 KB
testcase_13 AC 101 ms
77,676 KB
testcase_14 AC 94 ms
77,624 KB
testcase_15 AC 127 ms
77,636 KB
testcase_16 AC 140 ms
78,060 KB
testcase_17 AC 146 ms
77,828 KB
testcase_18 AC 153 ms
77,964 KB
testcase_19 AC 141 ms
77,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
from collections import defaultdict
scores = defaultdict(lambda: 0)
max_score = 0
from itertools import groupby, accumulate, product, permutations, combinations
for perm in permutations(A, N):
  score = 0
  for i in range(N):
    score += max(0, perm[i]-B[i])
  scores[score] += 1
  max_score = max(max_score, score)
print(scores[max_score])
0