結果

問題 No.1279 Array Battle
ユーザー zyxwzyxw
提出日時 2021-02-02 20:35:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 139,012 KB
最終ジャッジ日時 2023-09-12 11:22:56
合計ジャッジ時間 4,068 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,248 KB
testcase_01 AC 72 ms
71,200 KB
testcase_02 AC 72 ms
71,200 KB
testcase_03 AC 72 ms
71,248 KB
testcase_04 AC 74 ms
70,884 KB
testcase_05 AC 70 ms
71,028 KB
testcase_06 AC 72 ms
71,256 KB
testcase_07 AC 71 ms
71,044 KB
testcase_08 AC 71 ms
71,192 KB
testcase_09 AC 72 ms
71,132 KB
testcase_10 AC 73 ms
71,148 KB
testcase_11 AC 81 ms
76,244 KB
testcase_12 AC 85 ms
76,452 KB
testcase_13 AC 109 ms
83,596 KB
testcase_14 AC 107 ms
83,716 KB
testcase_15 AC 269 ms
132,856 KB
testcase_16 AC 307 ms
138,840 KB
testcase_17 AC 305 ms
138,896 KB
testcase_18 AC 311 ms
138,896 KB
testcase_19 AC 311 ms
139,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)))
0