結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2017-08-05 00:35:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 687 ms |
コンパイル使用メモリ | 65,144 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:58:03 |
合計ジャッジ時間 | 1,293 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <math.h> using namespace std; int main() { int n,ans = 0,leave = 0; cin >> n; vector<int> item(11,0); for(int i = 0;i < n;i++){ int a,b,c; cin >> a >> b >> c; item[a]++; item[b]++; item[c]++; } for(int i = 1;i < 11;i++){ ans += item[i]/2; leave += item[i]%2; } ans += leave/4; cout << ans << endl; return 0; }