結果

問題 No.1279 Array Battle
ユーザー dangodango
提出日時 2023-06-25 21:24:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,307 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 76,780 KB
最終ジャッジ日時 2023-09-15 11:27:51
合計ジャッジ時間 4,508 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,184 KB
testcase_01 AC 75 ms
71,268 KB
testcase_02 AC 76 ms
71,344 KB
testcase_03 AC 73 ms
71,484 KB
testcase_04 AC 74 ms
71,156 KB
testcase_05 AC 75 ms
71,300 KB
testcase_06 AC 73 ms
71,344 KB
testcase_07 AC 73 ms
71,264 KB
testcase_08 AC 73 ms
71,148 KB
testcase_09 AC 72 ms
71,212 KB
testcase_10 AC 72 ms
71,412 KB
testcase_11 AC 81 ms
76,212 KB
testcase_12 AC 82 ms
76,056 KB
testcase_13 AC 95 ms
76,536 KB
testcase_14 AC 94 ms
76,532 KB
testcase_15 AC 122 ms
76,524 KB
testcase_16 AC 138 ms
76,660 KB
testcase_17 AC 143 ms
76,780 KB
testcase_18 AC 152 ms
76,632 KB
testcase_19 AC 142 ms
76,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
def main():
    N = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    points = {}
    for p in permutations(a):
        point = 0
        for x, y in zip(p, b):
            point += max(0, x-y)
        if point not in points:
            points[point] = 0
        points[point] += 1
    mkey = max(points.keys())
    print(points[mkey])
main()
0