結果

問題 No.1279 Array Battle
ユーザー rlangevinrlangevin
提出日時 2023-02-05 21:45:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 78,008 KB
最終ジャッジ日時 2023-09-17 11:37:21
合計ジャッジ時間 3,626 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,852 KB
testcase_01 AC 101 ms
71,660 KB
testcase_02 AC 101 ms
71,616 KB
testcase_03 AC 102 ms
71,428 KB
testcase_04 AC 98 ms
71,960 KB
testcase_05 AC 100 ms
71,804 KB
testcase_06 AC 99 ms
71,812 KB
testcase_07 AC 99 ms
71,848 KB
testcase_08 AC 97 ms
71,564 KB
testcase_09 AC 99 ms
71,424 KB
testcase_10 AC 98 ms
71,772 KB
testcase_11 AC 110 ms
77,692 KB
testcase_12 AC 111 ms
77,496 KB
testcase_13 AC 118 ms
77,812 KB
testcase_14 AC 115 ms
77,848 KB
testcase_15 AC 151 ms
77,852 KB
testcase_16 AC 158 ms
77,744 KB
testcase_17 AC 168 ms
77,768 KB
testcase_18 AC 176 ms
78,008 KB
testcase_19 AC 168 ms
77,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from collections import *

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

ans, maxv = 0, -1
D = defaultdict(int)
for tup in permutations(A):
    v = 0
    for i in range(N):
        v += max(0, tup[i] - B[i])
    D[v] += 1

for k, v in D.items():
    if k > maxv:
        ans = v
        maxv = k
print(ans)
0