結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2016-08-05 19:09:11 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 582 bytes |
コンパイル時間 | 688 ms |
コンパイル使用メモリ | 66,576 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 00:15:24 |
合計ジャッジ時間 | 1,365 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include<iostream> #include<algorithm> #include<stdio.h> #include<stdlib.h> #include<vector> #include<string> #include<sstream> #include<math.h> using namespace std; int main(){ int n; cin >> n; vector<int> itm(10); for(int i=0;i<n;i++){ int tmp[3]; cin >> tmp[0] >> tmp[1] >> tmp[2]; itm[tmp[0]-1]++; itm[tmp[1]-1]++; itm[tmp[2]-1]++; } int cnt=0; int fl=0; for(int i=0;i<10;i++){ if( itm[i]%2 == 0 ){ cnt += itm[i]/2; }else{ cnt += itm[i]/2; fl++; } } cnt += fl/4; cout << cnt << endl; return 0; }