結果

問題 No.1279 Array Battle
ユーザー tanon710tanon710
提出日時 2020-11-06 23:24:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 77,892 KB
最終ジャッジ日時 2023-09-29 19:40:19
合計ジャッジ時間 3,430 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
71,760 KB
testcase_01 AC 87 ms
71,352 KB
testcase_02 AC 85 ms
71,504 KB
testcase_03 AC 90 ms
71,700 KB
testcase_04 AC 83 ms
71,600 KB
testcase_05 AC 81 ms
71,376 KB
testcase_06 AC 87 ms
71,688 KB
testcase_07 AC 88 ms
71,584 KB
testcase_08 AC 88 ms
71,860 KB
testcase_09 AC 85 ms
71,508 KB
testcase_10 AC 87 ms
71,468 KB
testcase_11 AC 98 ms
77,564 KB
testcase_12 AC 96 ms
77,456 KB
testcase_13 AC 105 ms
77,572 KB
testcase_14 AC 100 ms
77,696 KB
testcase_15 AC 132 ms
77,652 KB
testcase_16 AC 151 ms
77,760 KB
testcase_17 AC 146 ms
77,656 KB
testcase_18 AC 179 ms
77,892 KB
testcase_19 AC 152 ms
77,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import collections

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt=collections.defaultdict(int)
for p in itertools.permutations(range(n)):
    point=0
    for i in range(n):
        if a[p[i]]>b[i]:
            point+=a[p[i]]-b[i]
    cnt[point]+=1
points=list(cnt.keys())
maxpoint=max(points)
print(cnt[maxpoint])
0