結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-03-27 03:51:18 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 703 bytes | 
| コンパイル時間 | 1,941 ms | 
| コンパイル使用メモリ | 196,264 KB | 
| 実行使用メモリ | 7,720 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:20:36 | 
| 合計ジャッジ時間 | 2,539 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> v;
    int d[11];
    int point = 0;
    int sum = 0;
    for (int i = 0; i < 11; i++)
    {
        d[i] = 0;
    }
    for (int i = 0; i < n; i++)
    {
        int a, b, c;
        cin >>a>> b >> c;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
    }
    for (auto &i : v)
        d[i]++;
    for (auto &i : d)
    {
        point += i / 2;
        i %= 2;
    }
    // cout<<point<<endl;
    // for(auto &i:v){
    //     cout<<i<<endl;
    // }
    for (auto &i : d)
    {
        sum += i;
    }
    point += sum / 4;
    cout << point << endl;
    // system("pause");
}
            
            
            
        