結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
koheijkt
|
| 提出日時 | 2026-04-18 19:03:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 133 ms / 2,000 ms |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 81,376 KB |
| 最終ジャッジ日時 | 2026-04-18 19:03:29 |
| 合計ジャッジ時間 | 7,872 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from collections import defaultdict
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = defaultdict(int)
for pat in permutations(A):
memo = 0
for a, b in zip(pat, B):
if a > b:
memo += a - b
ans[memo] += 1
max_key = max(ans.keys())
print(ans[max_key])
koheijkt