結果
| 問題 | No.1279 Array Battle | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-02-02 20:35:29 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 243 ms / 2,000 ms | 
| コード長 | 385 bytes | 
| コンパイル時間 | 131 ms | 
| コンパイル使用メモリ | 81,968 KB | 
| 実行使用メモリ | 135,480 KB | 
| 最終ジャッジ日時 | 2024-06-29 23:53:13 | 
| 合計ジャッジ時間 | 2,680 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=[]
import itertools
S=""
for i in range(N):
    S+=str(i)
data=list(itertools.permutations(S))
for i in range(len(data)):
    d=list(data[i])
    ans_pre=0
    for j in range(N):
        if a[int(d[j])]-b[j]>0:
            ans_pre+=a[int(d[j])]-b[j]
    ans.append(ans_pre)
print(ans.count(max(ans)))
            
            
            
        