結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2017-11-01 16:32:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 654 ms |
コンパイル使用メモリ | 79,560 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 14:35:02 |
合計ジャッジ時間 | 1,470 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <utility> #include <iomanip> #include <cmath> using namespace std; #define diff(x, y) ((x) > (y) ? ((x) - (y)) : ((y) - (x))) int main(void) { int n, no, ans = 0, sum = 0; cin >> n; vector <int> x(11, 0); for (int i = 0; i < n * 3; i++) { sum++; cin >> no; x[no]++; if (x[no] >= 2) { ans++; sum -= 2; x[no] -= 2; } } cout << ans + sum / 4<< endl; return 0; }