結果

問題 No.1692 Expectations
ユーザー DMoRanSky
提出日時 2021-10-01 21:29:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 836 bytes
コンパイル時間 1,500 ms
コンパイル使用メモリ 166,612 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 10:33:23
合計ジャッジ時間 2,410 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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