結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
kyo1
|
| 提出日時 | 2020-03-08 05:11:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 439 bytes |
| 記録 | |
| コンパイル時間 | 1,399 ms |
| コンパイル使用メモリ | 163,224 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:13:20 |
| 合計ジャッジ時間 | 1,934 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<int> cnts(10, 0);
for (int i = 0; i < N; i++) {
for (int j = 0; j < 3; j++) {
int a;
cin >> a;
cnts[a - 1]++;
}
}
int res = 0, pool = 0;
for (int i = 0; i < 10; i++) {
res += cnts[i] / 2;
pool += cnts[i] % 2;
}
cout << res + pool / 4 << '\n';
return 0;
}
kyo1