結果
問題 |
No.1904 Never giving up!
|
ユーザー |
|
提出日時 | 2022-10-23 23:51:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 456 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 53,888 KB |
最終ジャッジ日時 | 2024-07-02 12:16:09 |
合計ジャッジ時間 | 1,582 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
N = int(input()) A = list(map(int,input().split())) from collections import defaultdict dic = defaultdict(int) for a in A: dic[a] += 1 dic = sorted(dic.items(), key = lambda x:x[0], reverse = True) rate = 1 # 条件を満たす取り出し方 for number, cnt in dic: # rest個の中からcnt個を引く for c in range(cnt, 0, -1): rate *= c # 全ての取り出し方 alls = 1 for i in range(1, N + 1): alls *= i print(alls // rate)