結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-10 05:26:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 502 bytes |
| コンパイル時間 | 509 ms |
| コンパイル使用メモリ | 60,772 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:56:16 |
| 合計ジャッジ時間 | 1,324 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <cstdlib>
#include <array>
#include <iostream>
int
main()
{
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int n;
std::cin >> n;
std::array<int, 10> items{0};
for (int i = 0; i < n; i++) {
int a, b, c;
std::cin >> a >> b >> c;
items[a - 1]++;
items[b - 1]++;
items[c - 1]++;
}
int cnt = 0, rems = 0;
for (auto&& e : items) {
cnt += e / 2;
rems += (e %= 2);
}
cnt += rems / 4;
std::cout << cnt << std::endl;
return EXIT_SUCCESS;
}