結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2020-07-25 15:47:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 309 bytes |
コンパイル時間 | 1,448 ms |
コンパイル使用メモリ | 168,592 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-27 07:04:04 |
合計ジャッジ時間 | 2,169 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> A(10,0); while(N--){ int a,b,c; cin>>a>>b>>c; A[a-1]++,A[b-1]++,A[c-1]++; } int ans=0,cnt=0; for(int &i:A)ans+=i/2,i%=2; for(int i:A)cnt+=i; cout<<ans+cnt/4<<endl; }