結果

問題 No.1692 Expectations
ユーザー eSeF
提出日時 2021-09-14 08:50:52
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 194,560 KB
最終ジャッジ日時 2025-01-24 13:53:02
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N, M;
    cin >> N >> M;
    vector<int>cnt(M + 1, 0);
    for(int i = 0; i < N; i++){
      int a; cin >> a;
      cnt[a]++;
    }

    int type = 0;
    for(int i = 1; i <= M; i++){
      if(cnt[i] == N && N == M){
        cout << 1 << " " << 1 << endl;
        return 0;
      }

      if(cnt[i] > 0) type++;
    }

    cout << type << " " << 0 << endl;

    return 0;
}
0