結果

問題 No.1279 Array Battle
ユーザー _matumo__matumo_
提出日時 2020-12-04 13:11:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 945 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 8,220 KB
最終ジャッジ日時 2023-10-13 01:25:13
合計ジャッジ時間 6,009 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,220 KB
testcase_01 AC 15 ms
8,212 KB
testcase_02 AC 16 ms
8,092 KB
testcase_03 AC 16 ms
8,128 KB
testcase_04 AC 16 ms
8,212 KB
testcase_05 AC 15 ms
8,084 KB
testcase_06 AC 16 ms
8,212 KB
testcase_07 AC 16 ms
8,136 KB
testcase_08 AC 16 ms
8,060 KB
testcase_09 AC 15 ms
8,128 KB
testcase_10 AC 15 ms
7,976 KB
testcase_11 AC 16 ms
7,976 KB
testcase_12 AC 24 ms
7,972 KB
testcase_13 AC 100 ms
8,156 KB
testcase_14 AC 84 ms
8,020 KB
testcase_15 AC 617 ms
8,140 KB
testcase_16 AC 799 ms
8,036 KB
testcase_17 AC 945 ms
8,220 KB
testcase_18 AC 899 ms
8,096 KB
testcase_19 AC 925 ms
8,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N=int(input())
pa=list(map(int,input().split()))
pb=list(map(int,input().split()))
xv=xn=0
for p in itertools.permutations(pa):
    mv=mn=0
    for a,b in zip(p,pb):
        if a>b: mv+=a-b
    if mv==xv:  xn+=1
    elif mv>xv: xv,xn=mv,1
print(xn)
0