結果

問題 No.29 パワーアップ
ユーザー kroton
提出日時 2014-10-19 07:45:27
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 670 bytes
コンパイル時間 820 ms
コンパイル使用メモリ 71,012 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 09:42:09
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <fstream>
#include <sstream>
using namespace std;
typedef long long ll;

int cnt[20];

int main(){
    int N;
    cin >> N;
    
    for(int i=0;i<N;i++){
        int a, b, c;
        cin >> a >> b >> c;
        
        cnt[a]++;
        cnt[b]++;
        cnt[c]++;
    }
    
    int res = 0;
    int rest = 0;
    
    for(int i=1;i<=10;i++){
        res += cnt[i] / 2;
        rest += cnt[i] % 2;
    }
    
    res += rest / 4;
    cout << res << endl;
    
    return 0;
}
0