結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-21 17:39:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 636 bytes |
| 記録 | |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 71,884 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 21:18:31 |
| 合計ジャッジ時間 | 1,551 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max,count
#include <string> //string,getline, to_string
#include <cstdlib> //abs(int)
#include <utility> //swap, pair
#include <deque> //deque
#include <climits> //INT_MAX
#include <bitset> //bitset
using namespace std;
int main() {
int N;
cin >> N;
int a, b, c;
vector<int> p(11);
for (int i = 0; i < N; i++) {
cin >> a >> b >> c;
p[a]++;
p[b]++;
p[c]++;
}
int ans = 0;
int oth = 0;
for (int i = 1; i <= 10; i++) {
ans += p[i] / 2;
oth += p[i] % 2;
}
ans += oth / 4;
cout << ans << endl;
return 0;
}