結果
問題 | No.1279 Array Battle |
ユーザー |
👑 |
提出日時 | 2024-07-24 21:58:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 99 ms / 2,000 ms |
コード長 | 357 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 82,460 KB |
実行使用メモリ | 76,064 KB |
最終ジャッジ日時 | 2024-07-24 21:58:14 |
合計ジャッジ時間 | 2,580 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import itertools n = int(input()) alst = list(map(int, input().split())) blst = list(map(int, input().split())) max_ = -1 ans = 0 for lst in itertools.permutations(alst): total = 0 for a, b in zip(lst, blst): total += max(a - b, 0) if max_ == total: ans += 1 elif max_ < total: max_ = total ans = 1 print(ans)