結果

問題 No.1904 Never giving up!
ユーザー ikomaikoma
提出日時 2022-04-15 22:16:28
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 1,364 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 71,888 KB
最終ジャッジ日時 2023-08-26 08:08:11
合計ジャッジ時間 2,363 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,888 KB
testcase_01 AC 83 ms
71,640 KB
testcase_02 AC 80 ms
71,676 KB
testcase_03 AC 83 ms
71,772 KB
testcase_04 AC 81 ms
71,544 KB
testcase_05 AC 86 ms
71,700 KB
testcase_06 AC 86 ms
71,396 KB
testcase_07 AC 86 ms
71,748 KB
testcase_08 AC 85 ms
71,688 KB
testcase_09 AC 85 ms
71,688 KB
testcase_10 AC 82 ms
71,792 KB
testcase_11 AC 82 ms
71,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

Aset = list(set(A))
from collections import Counter
from math import gcd
cnt = Counter(A)
Aset.sort(reverse=True)
num=1
den=1
for a in Aset:
    n = cnt[a]
    while n:
        num *= n
        den *= N
        g = gcd(num,den)
        num //= g
        den //= g
        n-=1
        N-=1
print(den)
0