結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-06 21:24:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 2,000 ms |
| コード長 | 429 bytes |
| 記録 | |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 85,200 KB |
| 実行使用メモリ | 81,100 KB |
| 最終ジャッジ日時 | 2026-04-03 08:59:51 |
| 合計ジャッジ時間 | 2,624 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from itertools import permutations
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
res = 0
p = [i for i in range(N)]
L = permutations(p)
for p in L:
tmp = 0
for i in range(N):
tmp += max(0,a[p[i]]-b[i])
res = max(res,tmp)
ans = 0
L = permutations(p)
for p in L:
tmp = 0
for i in range(N):
tmp += max(0,a[p[i]]-b[i])
ans += (tmp==res)
print(ans)