結果

問題 No.1279 Array Battle
コンテスト
ユーザー masayamatu
提出日時 2020-11-23 23:46:19
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 513 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 125 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 136,708 KB
最終ジャッジ日時 2026-04-03 15:38:51
合計ジャッジ時間 1,847 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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