結果

問題 No.1904 Never giving up!
ユーザー Goltermann大和Goltermann大和
提出日時 2022-04-15 22:47:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 8,060 KB
最終ジャッジ日時 2023-08-26 08:26:23
合計ジャッジ時間 963 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,060 KB
testcase_01 AC 15 ms
7,988 KB
testcase_02 AC 15 ms
7,936 KB
testcase_03 AC 15 ms
7,952 KB
testcase_04 AC 15 ms
7,908 KB
testcase_05 AC 15 ms
7,928 KB
testcase_06 AC 15 ms
7,920 KB
testcase_07 AC 15 ms
7,920 KB
testcase_08 AC 15 ms
7,932 KB
testcase_09 AC 15 ms
7,920 KB
testcase_10 AC 15 ms
8,036 KB
testcase_11 AC 15 ms
8,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans_u = []
ans_d = []
for idx,num in enumerate(a):
    same_n = 0
    for i in range(idx+1,n):
        if num == a[i]:
            same_n += 1
    ans_u.append(same_n + 1)
    ans_d.append(n-idx)

ans = math.prod(ans_d) / math.prod(ans_u)

print(int(ans))
0