結果

問題 No.1692 Expectations
ユーザー playerplayer
提出日時 2023-12-26 21:51:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 140,636 KB
最終ジャッジ日時 2023-12-26 21:51:12
合計ジャッジ時間 3,143 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,460 KB
testcase_01 AC 41 ms
53,460 KB
testcase_02 AC 43 ms
55,608 KB
testcase_03 AC 43 ms
55,608 KB
testcase_04 AC 43 ms
55,608 KB
testcase_05 AC 43 ms
55,608 KB
testcase_06 AC 43 ms
55,608 KB
testcase_07 AC 41 ms
53,460 KB
testcase_08 AC 43 ms
55,608 KB
testcase_09 AC 41 ms
55,612 KB
testcase_10 AC 153 ms
114,876 KB
testcase_11 AC 126 ms
114,680 KB
testcase_12 AC 41 ms
55,612 KB
testcase_13 AC 41 ms
53,460 KB
testcase_14 AC 79 ms
93,560 KB
testcase_15 AC 155 ms
110,544 KB
testcase_16 AC 75 ms
89,572 KB
testcase_17 AC 130 ms
107,176 KB
testcase_18 AC 116 ms
115,108 KB
testcase_19 AC 187 ms
127,508 KB
testcase_20 AC 120 ms
106,860 KB
testcase_21 AC 162 ms
140,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

n,m = map(int,input().split())
a = list(map(int,input().split()))

d = defaultdict(list)
for i in range(n):
    d[a[i]].append(i)
    
ma = n
mi = 0

for i in range(1,m+1):
    if len(d[i]) >= 2:
        ma -= (len(d[i])-1)

if n == m:
    s = set(a)
    if len(s) == 1:
        mi = 1
    
print(ma,mi)
0