結果
問題 | No.182 新規性の虜 |
ユーザー |
|
提出日時 | 2017-07-22 22:47:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 1,573 ms |
コンパイル使用メモリ | 58,972 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 17:30:45 |
合計ジャッジ時間 | 2,604 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n, a[100000]; cin >> n; for(int i=0; i<n; i++) cin >> a[i]; sort(a, a+n); int tmp = -1, cnt = 0, ans = 0; for(int i=0; i<n; i++){ if(a[i] == tmp){ cnt++; } else cnt = 0; tmp = a[i]; ans += !cnt ? 1 : cnt == 1 ? -1 : 0; } cout << ans << endl; return 0; }