結果
| 問題 | No.1279 Array Battle | 
| コンテスト | |
| ユーザー |  brthyyjp | 
| 提出日時 | 2020-11-06 21:27:18 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 178 ms / 2,000 ms | 
| コード長 | 403 bytes | 
| コンパイル時間 | 509 ms | 
| コンパイル使用メモリ | 82,432 KB | 
| 実行使用メモリ | 76,140 KB | 
| 最終ジャッジ日時 | 2024-07-22 12:10:06 | 
| 合計ジャッジ時間 | 3,073 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
M = 0
import itertools
for p in itertools.permutations(A, n):
    temp = 0
    for a, b in zip(p, B):
        temp += max(0, a-b)
    M = max(temp, M)
ans = 0
for p in itertools.permutations(A, n):
    temp = 0
    for a, b in zip(p, B):
        temp += max(0, a-b)
    if temp == M:
        ans += 1
print(ans)
            
            
            
        