結果

問題 No.1692 Expectations
ユーザー pengin_2000pengin_2000
提出日時 2021-10-16 15:34:08
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 30,124 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 22:13:21
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 22 ms
4,348 KB
testcase_11 AC 23 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 4 ms
4,348 KB
testcase_15 AC 22 ms
4,348 KB
testcase_16 AC 4 ms
4,348 KB
testcase_17 AC 12 ms
4,348 KB
testcase_18 AC 6 ms
4,348 KB
testcase_19 AC 26 ms
4,348 KB
testcase_20 AC 21 ms
4,348 KB
testcase_21 AC 24 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i;
	int a[200005];
	for (i = 0; i < n; i++)
		scanf("%d", &a[i]);
	int b[200005];
	for (i = 0; i <= m; i++)
		b[i] = 0;
	int ans = 0;
	for (i = 0; i < n; i++)
	{
		if (b[a[i]] == 0)
			ans++;
		b[a[i]]++;
	}
	printf("%d ", ans);
	ans = 0;
	for (i = 0; i <= m; i++)
		if (b[i] == n)
			ans = 1;
	if (n < m)
		ans = 0;
	printf("%d\n", ans);
	return 0;
}
0