結果
| 問題 |
No.1279 Array Battle
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-15 11:21:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 31,904 KB |
| 最終ジャッジ日時 | 2024-09-20 01:34:30 |
| 合計ジャッジ時間 | 10,554 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 4 -- * 1 |
ソースコード
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
L = []
for b in permutations(B):
TOTAL = 0
for i, j in zip(A, b):
TOTAL += [0, i-j][i > j]
L += [TOTAL]
MAX = max(L)
ANS = 0
for b in permutations(B):
TOTAL = 0
for i, j in zip(A, b):
TOTAL += [0, i-j][i > j]
if TOTAL == MAX:
ANS += 1
print(ANS)