結果

問題 No.1279 Array Battle
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:12:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 91,108 KB
最終ジャッジ日時 2023-08-27 07:11:28
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,476 KB
testcase_01 AC 66 ms
71,104 KB
testcase_02 AC 66 ms
71,400 KB
testcase_03 AC 64 ms
71,236 KB
testcase_04 AC 67 ms
71,292 KB
testcase_05 AC 66 ms
71,480 KB
testcase_06 AC 67 ms
71,384 KB
testcase_07 AC 68 ms
71,364 KB
testcase_08 AC 68 ms
71,476 KB
testcase_09 AC 64 ms
71,644 KB
testcase_10 AC 66 ms
71,392 KB
testcase_11 AC 71 ms
76,356 KB
testcase_12 AC 84 ms
76,432 KB
testcase_13 AC 83 ms
78,428 KB
testcase_14 AC 79 ms
78,616 KB
testcase_15 AC 123 ms
89,116 KB
testcase_16 AC 126 ms
89,064 KB
testcase_17 AC 133 ms
91,108 KB
testcase_18 AC 134 ms
89,140 KB
testcase_19 AC 132 ms
89,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  from itertools import permutations
  readline=stdin.readline
  n = int(readline())
  A = list(map(int, readline().split()))
  B = list(map(int, readline().split()))
  ans = []
  for a in permutations(A):
    tmp = 0
    for j in range(n):
      tmp += max(a[j]-B[j], 0)
    ans.append(tmp)
  print(ans.count(max(ans)))
main()
0