結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-20 20:17:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 488 ms |
| コンパイル使用メモリ | 60,172 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 20:56:41 |
| 合計ジャッジ時間 | 1,223 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
#include <array>
int main() {
int n;
std::cin >> n;
std::array<int, 10> array{ 0 };
for (; n > 0; --n) {
int a, b, c;
std::cin >> a >> b >> c;
++array[a - 1]; ++array[b - 1]; ++array[c - 1];
}
int sum = 0;
int odd = 0;
for (const auto &item : array) {
sum += item >> 1;
if ((item & 1) == 1) ++odd;
}
std::cout << sum + (odd >> 2) << std::endl;
return 0;
}