結果
| 問題 |
No.1279 Array Battle
|
| コンテスト | |
| ユーザー |
👑 SPD_9X2
|
| 提出日時 | 2020-11-06 21:25:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 2,000 ms |
| コード長 | 380 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 82,248 KB |
| 実行使用メモリ | 75,224 KB |
| 最終ジャッジ日時 | 2024-07-22 12:05:26 |
| 合計ジャッジ時間 | 2,043 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import itertools
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
maxi = 0
ans = 0
for x in itertools.permutations(A,N):
now = 0
cnt = 0
for i in x:
if i > B[cnt]:
now += i-B[cnt]
cnt += 1
if now == maxi:
ans += 1
elif now > maxi:
maxi = now
ans = 1
print (ans)
SPD_9X2