結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
OR6107
|
| 提出日時 | 2020-11-02 21:38:26 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,229 ms |
| コンパイル使用メモリ | 162,976 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:16:24 |
| 合計ジャッジ時間 | 2,076 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> cnt(11, 0);
for (int i = 0; i < n; i++) {
int a, b, c;
cin >> a >> b >> c;
cnt.at(a)++;
cnt.at(b)++;
cnt.at(c)++;
}
int ans = 0;
int sum = 0;
for (int i = 1; i < 11; i++) {
ans += cnt.at(i) / 2;
sum += cnt.at(i) % 2;
}
ans += sum / 4;
cout << ans << endl;
return 0;
}
OR6107