結果

問題 No.1279 Array Battle
ユーザー ayaoniayaoni
提出日時 2020-11-06 21:34:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 254 ms / 2,000 ms
コード長 783 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 145,048 KB
最終ジャッジ日時 2023-09-29 18:19:24
合計ジャッジ時間 4,076 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
71,668 KB
testcase_01 AC 80 ms
71,704 KB
testcase_02 AC 81 ms
71,300 KB
testcase_03 AC 78 ms
71,824 KB
testcase_04 AC 81 ms
71,592 KB
testcase_05 AC 83 ms
71,788 KB
testcase_06 AC 79 ms
71,812 KB
testcase_07 AC 82 ms
71,708 KB
testcase_08 AC 83 ms
71,692 KB
testcase_09 AC 81 ms
71,672 KB
testcase_10 AC 82 ms
71,676 KB
testcase_11 AC 92 ms
77,464 KB
testcase_12 AC 95 ms
77,776 KB
testcase_13 AC 105 ms
82,340 KB
testcase_14 AC 102 ms
81,948 KB
testcase_15 AC 225 ms
143,604 KB
testcase_16 AC 236 ms
144,032 KB
testcase_17 AC 243 ms
145,040 KB
testcase_18 AC 254 ms
144,284 KB
testcase_19 AC 238 ms
145,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
from collections import Counter
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()
A = LI()
B = LI()

ANS = []
for X in list(permutations([i for i in range(N)],N)):
    a = 0
    for i in range(N):
        a += max(0,A[X[i]]-B[i])
    ANS.append(a)

count = Counter(ANS)
Y = list(count.keys())
Y.sort(reverse=True)
x = Y[0]
print(count[x])
0