結果

問題 No.29 パワーアップ
コンテスト
ユーザー Lavender
提出日時 2019-08-31 09:41:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 477 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 62,176 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-24 21:11:04
合計ジャッジ時間 1,189 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main()
{
    int n;
    int a[3];
    int num[10]={0};
    int count=0;
    int ans=0;
    cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
            cin >> a[j];
            num[a[j]-1]++;
        }
    }
    for(int i=0;i<10;i++){
        if(num[i]!=0){
            ans += num[i]/2;
            if(num[i]%2!=0){
                count++;
            }
        }
    }
    ans+=count/4;
    cout << ans << endl;
}
0