結果

問題 No.1279 Array Battle
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:12:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 867 ms
コンパイル使用メモリ 81,928 KB
実行使用メモリ 88,100 KB
最終ジャッジ日時 2024-12-26 18:57:50
合計ジャッジ時間 2,623 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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