結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 01:26:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 565 ms |
| コンパイル使用メモリ | 71,392 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 21:01:10 |
| 合計ジャッジ時間 | 1,310 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
int main(int argc, const char* argv[])
{
int N;
cin >> N;
map<int, int> m;
for (int i = 0; i < N; i++) {
int a, b, c;
cin >> a >> b >> c;
m[a]++;
m[b]++;
m[c]++;
}
int cnt = 0;
int others = 0;
for (auto&& v : m) {
cnt += v.second / 2;
others += v.second % 2;
}
cout << cnt + others / 4 << endl;
return 0;
}