結果

問題 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
コンパイル時間 497 ms
コンパイル使用メモリ 65,796 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 03:38:06
合計ジャッジ時間 1,220 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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