結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
miku39kk
|
| 提出日時 | 2017-08-05 00:35:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 495 bytes |
| 記録 | |
| コンパイル時間 | 563 ms |
| コンパイル使用メモリ | 71,568 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:02:23 |
| 合計ジャッジ時間 | 1,317 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
miku39kk