結果
| 問題 |
No.182 新規性の虜
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-01-08 01:39:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 544 bytes |
| コンパイル時間 | 637 ms |
| コンパイル使用メモリ | 74,452 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 01:44:20 |
| 合計ジャッジ時間 | 2,566 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 2 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;cin>>n;
if(n==1){
cout << 1 << endl;
}
vector<int> a(n);
for(int i = 0; n > i; i++){
cin>>a[i];
}
sort(a.begin(),a.end());
int ans = 0;
for(int i = 0; n > i; i++){
if(!i){
if(a[i] != a[i+1])ans++;
}else if(i == n-1){
if(a[i-1] != a[i])ans++;
}else{
if(a[i-1] != a[i] && a[i] != a[i+1])ans++;
}
}
cout << ans << endl;
}