結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2017-09-18 09:43:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 5,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 1,652 ms |
コンパイル使用メモリ | 170,440 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 19:14:55 |
合計ジャッジ時間 | 2,899 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed; ll n; cin >> n; ll a[n+2]; for (ll i = 0; i < n; ++i) cin >> a[i]; a[n] = 0; a[n+1] = 1000000007; sort(a, a+n+2); ll ans = 0; for (int i = 1; i <= n; ++i) { if (a[i-1] != a[i] && a[i] != a[i+1]) ans++; } cout << ans << endl; return 0; }