結果

問題 No.1692 Expectations
ユーザー harurun
提出日時 2021-10-01 22:22:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 923 ms
コンパイル使用メモリ 78,192 KB
最終ジャッジ日時 2025-01-24 19:12:34
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;

int main(){
  int N,M,ans=1;
  cin>>N>>M;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  sort(A.begin(),A.end());
  for(int i=1;i<N;i++){
    if(A.at(i-1)!=A.at(i)){
      ans++;
    }
  }
  cout<<ans<<" ";
  if(N==1){
    cout<<1<<endl;
  }else{
    cout<<"0\n";
  }
  return 0;
}
0