結果

問題 No.1279 Array Battle
ユーザー GrayCoderGrayCoder
提出日時 2020-11-07 11:23:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 498 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 8,784 KB
最終ジャッジ日時 2023-09-29 20:27:47
合計ジャッジ時間 3,647 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,608 KB
testcase_01 AC 19 ms
8,544 KB
testcase_02 AC 17 ms
8,604 KB
testcase_03 AC 18 ms
8,532 KB
testcase_04 AC 18 ms
8,632 KB
testcase_05 AC 18 ms
8,660 KB
testcase_06 AC 18 ms
8,512 KB
testcase_07 AC 18 ms
8,512 KB
testcase_08 AC 18 ms
8,520 KB
testcase_09 AC 18 ms
8,464 KB
testcase_10 AC 18 ms
8,500 KB
testcase_11 AC 18 ms
8,664 KB
testcase_12 AC 23 ms
8,644 KB
testcase_13 AC 66 ms
8,512 KB
testcase_14 AC 60 ms
8,512 KB
testcase_15 AC 367 ms
8,496 KB
testcase_16 AC 413 ms
8,568 KB
testcase_17 AC 498 ms
8,632 KB
testcase_18 AC 488 ms
8,784 KB
testcase_19 AC 495 ms
8,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from itertools import permutations
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))

    score = defaultdict(int)
    for a in permutations(A):
        n = sum([i - j for i, j in zip(a, B) if i > j])
        score[n] += 1
    ans = sorted(score.items(), reverse=1)
    print(ans[0][1])


main()
0