結果

問題 No.1279 Array Battle
ユーザー nohakai3nohakai3
提出日時 2022-07-16 10:57:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,759 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 22,280 KB
最終ジャッジ日時 2023-09-10 18:40:39
合計ジャッジ時間 10,431 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,120 KB
testcase_01 AC 18 ms
8,112 KB
testcase_02 AC 19 ms
8,084 KB
testcase_03 AC 18 ms
8,188 KB
testcase_04 AC 16 ms
8,156 KB
testcase_05 AC 17 ms
8,116 KB
testcase_06 AC 16 ms
8,180 KB
testcase_07 AC 17 ms
8,176 KB
testcase_08 AC 17 ms
8,084 KB
testcase_09 AC 17 ms
8,088 KB
testcase_10 AC 16 ms
8,124 KB
testcase_11 AC 19 ms
8,152 KB
testcase_12 AC 37 ms
8,288 KB
testcase_13 AC 190 ms
9,656 KB
testcase_14 AC 182 ms
9,560 KB
testcase_15 AC 1,570 ms
11,024 KB
testcase_16 AC 1,547 ms
11,008 KB
testcase_17 AC 1,759 ms
22,268 KB
testcase_18 AC 1,700 ms
22,280 KB
testcase_19 AC 1,707 ms
22,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

from itertools import permutations 
ans=[]
for seq in permutations(range(n)):
    cnt=0
    for i in range(n):
        cnt+=max(A[seq[i]]-B[i],0)
        
    ans.append(cnt)
    
num=max(ans)
print(ans.count(num))
0