結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2020-07-05 19:55:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 822 ms |
コンパイル使用メモリ | 74,612 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 19:22:37 |
合計ジャッジ時間 | 1,678 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }