結果

問題 No.1279 Array Battle
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:10:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 90,476 KB
最終ジャッジ日時 2023-08-27 07:09:32
合計ジャッジ時間 3,957 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,356 KB
testcase_01 AC 72 ms
71,408 KB
testcase_02 AC 73 ms
71,412 KB
testcase_03 AC 73 ms
71,132 KB
testcase_04 AC 73 ms
71,096 KB
testcase_05 AC 72 ms
71,300 KB
testcase_06 AC 72 ms
71,184 KB
testcase_07 AC 71 ms
71,340 KB
testcase_08 AC 74 ms
71,264 KB
testcase_09 AC 73 ms
71,148 KB
testcase_10 AC 72 ms
71,224 KB
testcase_11 AC 116 ms
76,076 KB
testcase_12 AC 79 ms
75,960 KB
testcase_13 AC 94 ms
77,424 KB
testcase_14 AC 91 ms
77,684 KB
testcase_15 AC 137 ms
90,476 KB
testcase_16 AC 149 ms
89,516 KB
testcase_17 AC 149 ms
89,536 KB
testcase_18 AC 154 ms
89,488 KB
testcase_19 AC 149 ms
89,504 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 = []
  L = [x for x in range(n)]
  for i in permutations(L):
    tmp = 0
    k = 0
    for j in i:
      tmp += max(A[j]-B[k], 0)
      k += 1
    ans.append(tmp)
  print(ans.count(max(ans)))
main()
0