結果

問題 No.1279 Array Battle
ユーザー taiga000629taiga000629
提出日時 2020-11-06 21:36:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 132,108 KB
最終ジャッジ日時 2023-09-29 18:21:01
合計ジャッジ時間 3,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,436 KB
testcase_01 AC 73 ms
71,308 KB
testcase_02 AC 71 ms
71,312 KB
testcase_03 AC 72 ms
71,600 KB
testcase_04 AC 69 ms
71,500 KB
testcase_05 AC 70 ms
71,672 KB
testcase_06 AC 71 ms
71,476 KB
testcase_07 AC 71 ms
71,484 KB
testcase_08 AC 70 ms
71,596 KB
testcase_09 AC 70 ms
71,544 KB
testcase_10 AC 70 ms
71,516 KB
testcase_11 AC 77 ms
76,112 KB
testcase_12 AC 77 ms
76,316 KB
testcase_13 AC 91 ms
78,472 KB
testcase_14 AC 87 ms
78,384 KB
testcase_15 AC 197 ms
131,996 KB
testcase_16 AC 205 ms
131,720 KB
testcase_17 AC 199 ms
132,108 KB
testcase_18 AC 207 ms
132,024 KB
testcase_19 AC 202 ms
132,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
maxa=-1
ans=1
from itertools import permutations as per
kai=list(per(list(range(1,n+1))))
for i in range(len(kai)):
    sum=0
    j=0
    for x in kai[i]:

        sum+=max(a[x-1]-b[j],0)
        j+=1
    if sum==maxa:
        ans+=1
    elif sum>maxa:
        maxa=sum
        ans=1

print(ans)






0