結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2016-01-06 10:50:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 1,564 ms |
コンパイル使用メモリ | 60,392 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-09-19 12:08:37 |
合計ジャッジ時間 | 2,414 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 2 |
ソースコード
#include<iostream> #include<algorithm> using namespace std; int main(void) { int n, i, ans; long long int pa[100005] = {0}; cin >> n; ans = n; for (i = 0; i < n; i++) { cin >> pa[i]; } sort(pa, pa + n); for (i = 0; i < n - 1; i++) { if (pa[i] == pa[i + 1]) ans -= 2; if (pa[i] == pa[i + 1] && pa[i + 1] == pa[i + 2]) ans++; } if (pa[0] == pa[n - 1]) ans = 0; cout << ans << endl;; return 0; }