結果

問題 No.1904 Never giving up!
ユーザー dn6049949dn6049949
提出日時 2022-04-15 21:28:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 818 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 71,952 KB
最終ジャッジ日時 2023-08-26 07:31:29
合計ジャッジ時間 2,248 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,668 KB
testcase_01 AC 93 ms
71,596 KB
testcase_02 AC 93 ms
71,676 KB
testcase_03 AC 97 ms
71,952 KB
testcase_04 AC 92 ms
71,912 KB
testcase_05 AC 92 ms
71,512 KB
testcase_06 AC 93 ms
71,948 KB
testcase_07 AC 94 ms
71,796 KB
testcase_08 AC 96 ms
71,640 KB
testcase_09 AC 95 ms
71,672 KB
testcase_10 AC 94 ms
71,600 KB
testcase_11 AC 95 ms
71,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def main():
    n = I()
    a = LI()
    a.sort()
    count = defaultdict(lambda : 0)
    for i in a:
        count[i] += 1
    count = list(count.items())
    count.sort()
    p = 1
    q = 1
    res = n
    for _, j in count:
        for i in range(1,j+1):
            p *= i
            q *= n
            n -= 1
    print(q//p)
    return


if __name__ == "__main__":
    main()
0