結果
問題 | No.1692 Expectations |
ユーザー |
|
提出日時 | 2021-10-01 21:29:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 143 ms / 2,000 ms |
コード長 | 762 bytes |
コンパイル時間 | 294 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 114,432 KB |
最終ジャッジ日時 | 2024-07-19 10:34:19 |
合計ジャッジ時間 | 2,612 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
import sys#sys.setrecursionlimit(10 ** 6)INF = float('inf')#10**20,2**63に変えるのもありMOD = 10**9 + 7MOD2 = 998244353from collections import defaultdictdef solve():def II(): return int(sys.stdin.readline())def LI(): return list(map(int, sys.stdin.readline().split()))def LC(): return list(input())def IC(): return [int(c) for c in input()]def MI(): return map(int, sys.stdin.readline().split())N,M = MI()A = LI()Num = defaultdict(lambda:0)for a in A:Num[a] += 1Key = list(Num.keys())Count = len(Key)if N ==M and Count == 1:print(1,1)exit()Min = M - Countif Min >= 0:print(Count,0)else:print(Count,abs(Min))returnsolve()