結果

問題 No.1904 Never giving up!
ユーザー ntudantuda
提出日時 2022-10-25 21:07:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 71,880 KB
最終ジャッジ日時 2023-09-16 18:17:37
合計ジャッジ時間 2,248 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,880 KB
testcase_01 AC 90 ms
71,480 KB
testcase_02 AC 89 ms
71,504 KB
testcase_03 AC 88 ms
71,620 KB
testcase_04 AC 90 ms
71,700 KB
testcase_05 AC 90 ms
71,808 KB
testcase_06 AC 91 ms
71,648 KB
testcase_07 AC 89 ms
71,604 KB
testcase_08 AC 90 ms
71,508 KB
testcase_09 AC 90 ms
71,732 KB
testcase_10 AC 90 ms
71,608 KB
testcase_11 AC 91 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
D = list(Counter(A).items())
D.sort(reverse= True)
K = factorial(N)
ans = K
for x,c in D:
    while c > 0:
        ans *= N
        ans //= c
        c -= 1
        N -= 1
print(int(ans//K))
0