結果

問題 No.1692 Expectations
ユーザー yudai1102jpyudai1102jp
提出日時 2021-10-01 22:08:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 32,700 KB
最終ジャッジ日時 2023-09-26 17:29:14
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,932 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 16 ms
7,812 KB
testcase_05 AC 16 ms
7,816 KB
testcase_06 AC 16 ms
7,868 KB
testcase_07 AC 16 ms
7,808 KB
testcase_08 AC 16 ms
7,816 KB
testcase_09 AC 16 ms
7,808 KB
testcase_10 AC 136 ms
28,120 KB
testcase_11 AC 142 ms
29,188 KB
testcase_12 AC 16 ms
7,932 KB
testcase_13 AC 15 ms
7,848 KB
testcase_14 AC 30 ms
11,524 KB
testcase_15 AC 146 ms
27,288 KB
testcase_16 AC 29 ms
11,436 KB
testcase_17 AC 83 ms
18,008 KB
testcase_18 AC 44 ms
15,804 KB
testcase_19 AC 172 ms
30,008 KB
testcase_20 AC 123 ms
31,984 KB
testcase_21 AC 142 ms
32,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = list(map(int, input().split()))
Max = N
dp = [0]*(M+1)
for i in range(N):
    if dp[A[i]-1]:
        Max -= 1
    dp[A[i]-1] += 1
if len(set(A)) == 1 and N == M:
    Min = 1
else:
    Min = 0

print(f'{Max} {Min}')
0