結果
問題 | No.1904 Never giving up! |
ユーザー |
![]() |
提出日時 | 2022-04-15 21:28:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 818 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 54,784 KB |
最終ジャッジ日時 | 2024-12-24 23:27:41 |
合計ジャッジ時間 | 1,173 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#!usr/bin/env python3from collections import defaultdict, dequefrom heapq import heappush, heappopfrom itertools import permutations, accumulateimport sysimport mathimport bisectdef 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 = 1000000007def main():n = I()a = LI()a.sort()count = defaultdict(lambda : 0)for i in a:count[i] += 1count = list(count.items())count.sort()p = 1q = 1res = nfor _, j in count:for i in range(1,j+1):p *= iq *= nn -= 1print(q//p)returnif __name__ == "__main__":main()