結果

問題 No.1279 Array Battle
ユーザー mkawa2mkawa2
提出日時 2020-11-07 10:04:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,144 ms / 2,000 ms
コード長 893 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 11,052 KB
実行使用メモリ 8,796 KB
最終ジャッジ日時 2023-09-29 20:23:23
合計ジャッジ時間 7,269 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,688 KB
testcase_01 AC 18 ms
8,668 KB
testcase_02 AC 20 ms
8,608 KB
testcase_03 AC 19 ms
8,632 KB
testcase_04 AC 17 ms
8,760 KB
testcase_05 AC 17 ms
8,628 KB
testcase_06 AC 18 ms
8,620 KB
testcase_07 AC 17 ms
8,776 KB
testcase_08 AC 19 ms
8,748 KB
testcase_09 AC 19 ms
8,796 KB
testcase_10 AC 19 ms
8,620 KB
testcase_11 AC 20 ms
8,628 KB
testcase_12 AC 31 ms
8,760 KB
testcase_13 AC 134 ms
8,632 KB
testcase_14 AC 130 ms
8,624 KB
testcase_15 AC 1,099 ms
8,624 KB
testcase_16 AC 1,102 ms
8,628 KB
testcase_17 AC 1,130 ms
8,756 KB
testcase_18 AC 1,107 ms
8,692 KB
testcase_19 AC 1,144 ms
8,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

# input=sys.stdin.buffer.readline
input=sys.stdin.readline

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return input()[:-1]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

n=II()
aa=LI()
bb=LI()

mx=-1
ans=1
for pp in permutations(aa):
    cur=sum(max(0,p-b) for p,b in zip(pp,bb))
    if cur==mx:ans+=1
    if cur>mx:
        ans=1
        mx=cur
print(ans)
0