結果

問題 No.182 新規性の虜
ユーザー xuelei
提出日時 2018-07-17 14:21:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 69,048 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 23:24:12
合計ジャッジ時間 2,316 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++)cin >> a[i];
  sort(a,a+n);
  int ans=0;
  for(int i=0;i<n;i++){
    if(a[i]!=a[i-1] && a[i]!=a[i+1])ans++;
  }
  cout << ans << endl;
  return 0;
}
0