結果

問題 No.1904 Never giving up!
ユーザー tobusakanatobusakana
提出日時 2022-10-23 23:51:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 71,952 KB
最終ジャッジ日時 2023-09-15 07:55:03
合計ジャッジ時間 2,780 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,696 KB
testcase_01 AC 93 ms
71,704 KB
testcase_02 AC 95 ms
71,820 KB
testcase_03 AC 91 ms
71,744 KB
testcase_04 AC 91 ms
71,836 KB
testcase_05 AC 94 ms
71,836 KB
testcase_06 AC 95 ms
71,952 KB
testcase_07 AC 91 ms
71,408 KB
testcase_08 AC 96 ms
71,648 KB
testcase_09 AC 92 ms
71,616 KB
testcase_10 AC 96 ms
71,860 KB
testcase_11 AC 98 ms
71,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0