結果

問題 No.1279 Array Battle
ユーザー ayaoniayaoni
提出日時 2020-11-06 21:33:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 145,448 KB
最終ジャッジ日時 2023-09-29 18:18:51
合計ジャッジ時間 4,089 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,400 KB
testcase_01 AC 94 ms
71,864 KB
testcase_02 AC 95 ms
71,820 KB
testcase_03 AC 92 ms
71,488 KB
testcase_04 AC 92 ms
71,588 KB
testcase_05 AC 92 ms
71,708 KB
testcase_06 WA -
testcase_07 AC 91 ms
71,628 KB
testcase_08 AC 94 ms
71,768 KB
testcase_09 AC 93 ms
71,784 KB
testcase_10 AC 93 ms
71,840 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 119 ms
82,088 KB
testcase_14 WA -
testcase_15 AC 254 ms
143,608 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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)
x = list(count.keys())[0]

print(count[x])
0