結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-05 19:55:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 668 bytes |
| 記録 | |
| コンパイル時間 | 668 ms |
| コンパイル使用メモリ | 79,892 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:15:09 |
| 合計ジャッジ時間 | 1,370 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main() {
int n;
cin >> n;
vector<int> cnt(10);
for (int i = 0; i < n; ++i) {
int a, b, c;
cin >> a >> b >> c;
a--, b--, c--;
cnt[a]++, cnt[b]++, cnt[c]++;
}
int ans = 0;
int sum = 0;
for (int i = 0; i < 10; ++i) {
int t = cnt[i] / 2;
ans += t;
cnt[i] -= 2 * t;
sum += cnt[i];
}
ans += sum / 4;
cout << ans << endl;
return 0;
}