結果

問題 No.1279 Array Battle
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-11-06 21:27:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 132,076 KB
最終ジャッジ日時 2023-09-29 18:11:16
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,576 KB
testcase_01 AC 74 ms
71,608 KB
testcase_02 AC 72 ms
71,456 KB
testcase_03 AC 74 ms
71,484 KB
testcase_04 AC 74 ms
71,112 KB
testcase_05 AC 74 ms
71,464 KB
testcase_06 AC 74 ms
71,364 KB
testcase_07 AC 73 ms
71,636 KB
testcase_08 AC 73 ms
71,664 KB
testcase_09 AC 74 ms
71,676 KB
testcase_10 AC 75 ms
71,464 KB
testcase_11 AC 81 ms
76,392 KB
testcase_12 AC 82 ms
76,476 KB
testcase_13 AC 93 ms
78,552 KB
testcase_14 AC 89 ms
78,680 KB
testcase_15 AC 206 ms
132,004 KB
testcase_16 AC 215 ms
131,700 KB
testcase_17 AC 216 ms
132,076 KB
testcase_18 AC 224 ms
131,988 KB
testcase_19 AC 218 ms
131,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

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


lis = list(itertools.permutations(a, n))

dic = {}
for x in lis:
    p = 0
    for i,y in enumerate(x):
        if y > b[i]:
            p += y - b[i]
    if p in dic:
        dic[p] += 1
    else:
        dic[p] = 1
dic2 = sorted(dic.items(), reverse=True)
print(dic2[0][1])
0