結果

問題 No.1279 Array Battle
ユーザー masayamatumasayamatu
提出日時 2020-11-23 23:46:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 131,604 KB
最終ジャッジ日時 2023-10-01 00:31:34
合計ジャッジ時間 4,176 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,208 KB
testcase_01 AC 73 ms
71,036 KB
testcase_02 AC 72 ms
70,912 KB
testcase_03 AC 73 ms
71,108 KB
testcase_04 AC 72 ms
71,112 KB
testcase_05 AC 71 ms
71,180 KB
testcase_06 AC 71 ms
70,988 KB
testcase_07 AC 71 ms
71,228 KB
testcase_08 AC 72 ms
71,224 KB
testcase_09 AC 73 ms
71,124 KB
testcase_10 AC 71 ms
70,816 KB
testcase_11 AC 107 ms
76,068 KB
testcase_12 AC 121 ms
76,416 KB
testcase_13 AC 94 ms
78,776 KB
testcase_14 AC 93 ms
78,724 KB
testcase_15 AC 204 ms
131,444 KB
testcase_16 AC 226 ms
131,380 KB
testcase_17 AC 267 ms
131,400 KB
testcase_18 AC 278 ms
131,400 KB
testcase_19 AC 260 ms
131,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n = int(input())

a = []
b = []
count = 1

a = list(map(int,input().split()))
b = list(map(int,input().split()))

permutate_a =list(itertools.permutations(a))
score=[0 for i in range(len(permutate_a))]

for i in range(len(permutate_a)):
    for j in range(n):
        if permutate_a[i][j]-b[j]>0:
            score[i] += permutate_a[i][j]-b[j]

score.sort(reverse=True)

for i in range(1,len(score)):
    if(score[i]==score[i-1]):
        count += 1
    else:
        break
        
print(count)
0