結果

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

ソースコード

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 ) mn = 1;
    }
    cout << mx << " " << mn << endl;
}
0