結果

問題 No.1692 Expectations
ユーザー harurunharurun
提出日時 2021-10-01 22:22:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 79,932 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-26 18:08:30
合計ジャッジ時間 2,601 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,508 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 51 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 7 ms
4,380 KB
testcase_15 AC 60 ms
4,380 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 30 ms
4,380 KB
testcase_18 AC 12 ms
4,380 KB
testcase_19 AC 71 ms
4,376 KB
testcase_20 AC 49 ms
4,380 KB
testcase_21 AC 58 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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