結果

問題 No.1279 Array Battle
ユーザー matriematrie
提出日時 2021-01-18 09:31:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,037 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 8,256 KB
最終ジャッジ日時 2023-08-20 16:57:38
合計ジャッジ時間 6,571 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,128 KB
testcase_01 AC 14 ms
8,204 KB
testcase_02 AC 14 ms
8,112 KB
testcase_03 AC 16 ms
8,124 KB
testcase_04 AC 12 ms
8,036 KB
testcase_05 AC 12 ms
8,068 KB
testcase_06 AC 13 ms
8,244 KB
testcase_07 AC 13 ms
8,180 KB
testcase_08 AC 13 ms
8,228 KB
testcase_09 AC 12 ms
8,072 KB
testcase_10 AC 13 ms
8,224 KB
testcase_11 AC 15 ms
8,176 KB
testcase_12 AC 24 ms
8,256 KB
testcase_13 AC 114 ms
8,104 KB
testcase_14 AC 112 ms
8,076 KB
testcase_15 AC 964 ms
8,252 KB
testcase_16 AC 972 ms
8,068 KB
testcase_17 AC 1,009 ms
8,204 KB
testcase_18 AC 1,007 ms
8,116 KB
testcase_19 AC 1,037 ms
8,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as it
input()
A=list(map(int,input().split()))
B=list(map(int,input().split()))
x=c=0
for P in it.permutations(A):
	s=sum([max(a-b,0) for a,b in zip(P,B)])
	if s>x:x=s;c=1
	elif s==x:c+=1
print(c)
0