結果

問題 No.29 パワーアップ
ユーザー kkkk97368086
提出日時 2021-12-03 23:24:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 427 bytes
コンパイル時間 1,595 ms
コンパイル使用メモリ 168,752 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 06:51:05
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 5 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> cnt(n-1);
    for(int i=0; i<n; i++){
        int a,b,c;
        cin >> a >> b >> c;
        cnt[a-1]++;
        cnt[b-1]++;
        cnt[c-1]++;
    }
    int sum = 3*n;
    int ans=0;
    for(int i=0; i<10; i++){
        ans += cnt[i]/2;
        sum -= (cnt[i]-cnt[i]%2);
    }
    ans += sum/4;
    cout << ans << endl;
    
}
0