結果

問題 No.1279 Array Battle
ユーザー pluto77pluto77
提出日時 2020-11-26 11:39:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 76,964 KB
最終ジャッジ日時 2023-10-01 03:17:16
合計ジャッジ時間 3,071 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,148 KB
testcase_01 AC 66 ms
71,448 KB
testcase_02 AC 70 ms
71,628 KB
testcase_03 AC 68 ms
71,336 KB
testcase_04 AC 70 ms
71,600 KB
testcase_05 AC 70 ms
71,272 KB
testcase_06 AC 68 ms
71,576 KB
testcase_07 AC 67 ms
71,624 KB
testcase_08 AC 69 ms
71,640 KB
testcase_09 AC 69 ms
71,580 KB
testcase_10 AC 69 ms
71,184 KB
testcase_11 AC 76 ms
76,180 KB
testcase_12 AC 76 ms
76,144 KB
testcase_13 AC 86 ms
76,172 KB
testcase_14 AC 85 ms
76,420 KB
testcase_15 AC 114 ms
76,660 KB
testcase_16 AC 130 ms
76,880 KB
testcase_17 AC 127 ms
76,956 KB
testcase_18 AC 133 ms
76,964 KB
testcase_19 AC 128 ms
76,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1279
import itertools
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
m=-1
res=0
for l in itertools.permutations(a):
 s=0
 for x,y in zip(l,b):
  s+=max(x-y,0)
 if m==s:
  res+=1
 elif m<s:
  m=s
  res=1
print(res)
0