結果

問題 No.1692 Expectations
コンテスト
ユーザー harurun
提出日時 2021-10-01 22:22:28
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 382 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 644 ms
コンパイル使用メモリ 100,232 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-06-23 07:11:18
合計ジャッジ時間 1,914 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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