結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-27 20:39:48 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 320 bytes |
| コンパイル時間 | 556 ms |
| コンパイル使用メモリ | 81,104 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:19:50 |
| 合計ジャッジ時間 | 1,305 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
using namespace std;
int main() {
int n, a, b, c;
cin >> n;
int cnt[10];
for (int i = 0; i < 10; i++) cnt[i] = 0;
while (n--) {
cin >> a >> b >> c;
cnt[--a]++;
cnt[--b]++;
cnt[--c]++;
}
int s = 0, t = 0;
for (int i: cnt) {
s += i / 2;
t += i % 2;
}
cout << s + t / 4 << '\n';
}