結果

問題 No.1279 Array Battle
ユーザー roarisroaris
提出日時 2020-11-14 01:40:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 1,452 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 78,188 KB
最終ジャッジ日時 2023-09-30 04:38:07
合計ジャッジ時間 4,002 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,960 KB
testcase_01 AC 100 ms
71,748 KB
testcase_02 AC 103 ms
71,708 KB
testcase_03 AC 98 ms
71,952 KB
testcase_04 AC 102 ms
72,008 KB
testcase_05 AC 98 ms
71,716 KB
testcase_06 AC 97 ms
71,692 KB
testcase_07 AC 97 ms
71,688 KB
testcase_08 AC 99 ms
71,644 KB
testcase_09 AC 98 ms
71,860 KB
testcase_10 AC 101 ms
71,960 KB
testcase_11 AC 113 ms
77,580 KB
testcase_12 AC 110 ms
77,492 KB
testcase_13 AC 121 ms
78,132 KB
testcase_14 AC 115 ms
77,636 KB
testcase_15 AC 150 ms
77,596 KB
testcase_16 AC 162 ms
77,924 KB
testcase_17 AC 168 ms
77,860 KB
testcase_18 AC 181 ms
77,884 KB
testcase_19 AC 172 ms
78,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import permutations

N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = defaultdict(int)

for p in permutations(a):
    score = 0
    
    for pi, bi in zip(p, b):
        score += max(0, pi-bi)
    
    cnt[score] += 1

M = max(cnt.keys())
print(cnt[M])
0