結果

問題 No.1692 Expectations
ユーザー ripity
提出日時 2021-12-18 15:25:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 2,473 ms
コンパイル使用メモリ 193,724 KB
最終ジャッジ日時 2025-01-27 03:18:48
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N,M;
    int mx = 0;
    int mn = 0;
    cin >> N >> M;
    vector<int> cnt(M);
    for( int i = 0; i < N; i++ ) {
        int a;
        cin >> a;
        cnt[a-1]++;
    }
    for( int i = 0; i < M; i++ ) {
        mx += min(1,cnt[i]);
        if( cnt[i] == N && N == M ) mn = 1;
    }
    cout << mx << " " << mn << endl;
}
0