結果

問題 No.1279 Array Battle
ユーザー 👑 platinumplatinum
提出日時 2020-05-19 23:59:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,385 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,624 KB
最終ジャッジ日時 2024-04-27 14:05:20
合計ジャッジ時間 7,068 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,624 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 27 ms
10,880 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 25 ms
10,624 KB
testcase_08 AC 24 ms
10,752 KB
testcase_09 AC 25 ms
10,624 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 27 ms
10,624 KB
testcase_12 AC 36 ms
10,752 KB
testcase_13 AC 140 ms
12,672 KB
testcase_14 AC 127 ms
12,288 KB
testcase_15 AC 831 ms
13,568 KB
testcase_16 AC 951 ms
15,028 KB
testcase_17 AC 1,385 ms
26,444 KB
testcase_18 AC 1,231 ms
26,468 KB
testcase_19 AC 1,312 ms
26,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

l = [x for x in range(N)]
per = itertools.permutations(l)

score = []
for case in per:
	res = 0
	num = 0
	for i in case:
		if(a[i] - b[num] > 0): res += a[i] - b[num]
		num += 1
	score.append(res)

score.sort(reverse = True)
MAX = score[0]
ans = 0
for sc in score:
	if(sc == MAX): ans += 1
	else: break

print(ans)
0