結果

問題 No.1279 Array Battle
ユーザー uni_pythonuni_python
提出日時 2020-11-06 21:32:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 75,776 KB
最終ジャッジ日時 2024-07-22 12:18:17
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

N=I()
A=LI()
B=LI()

import itertools

ans=0
M=-1

for ite in itertools.permutations(A, N):
    temp=0
    for i in range(N):
        a=ite[i]
        b=B[i]
        if a>b:
            temp+=a-b
    if temp>M:
        ans=1
        M=temp
    elif temp==M:
        ans+=1

print(ans)
    
0