結果

問題 No.1692 Expectations
ユーザー DMoRanSkyDMoRanSky
提出日時 2021-10-01 21:29:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 836 bytes
コンパイル時間 1,503 ms
コンパイル使用メモリ 163,488 KB
実行使用メモリ 5,224 KB
最終ジャッジ日時 2023-09-26 16:27:43
合計ジャッジ時間 2,741 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 8 ms
4,380 KB
testcase_11 AC 7 ms
4,384 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 9 ms
4,936 KB
testcase_16 AC 3 ms
4,384 KB
testcase_17 AC 6 ms
4,620 KB
testcase_18 AC 4 ms
4,376 KB
testcase_19 AC 11 ms
5,224 KB
testcase_20 AC 8 ms
4,896 KB
testcase_21 AC 9 ms
5,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// Skyqwq
#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second
#define mp make_pair

using namespace std;

typedef long long LL;

template <typename T> void chkMax(T &x, T y) { if (y > x) x = y; }
template <typename T> void chkMin(T &x, T y) { if (y < x) x = y; }

template <typename T> void inline read(T &x) {
    int f = 1; x = 0; char s = getchar();
    while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); }
    while (s <= '9' && s >= '0') x = x * 10 + (s ^ 48), s = getchar();
    x *= f;
}

const int N = 2e5 + 5;

int n, m, a[N], c[N];
 
int main() {
	read(n), read(m);
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		if (!c[a[i]]) cnt++;
		c[a[i]]++;
	}
	int v = 0;
	for (int i = 1; i <= m; i++)
		if (n == m && c[i] == n) v = 1;
	printf("%d %d\n", cnt, v);
	return 0;
}
0