結果

問題 No.1279 Array Battle
ユーザー tktk_snsn
提出日時 2022-02-13 02:08:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 347 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-29 05:19:50
合計ジャッジ時間 11,629 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations


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

ans = 0
score = -10
for p in permutations(A):
    tot = 0
    for x, y in zip(p, B):
        tot += max(0, x - y)
    if tot > score:
        score = tot
        ans = 1
    elif tot == score:
        ans += 1
print(ans)
0