結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
kei
|
| 提出日時 | 2016-08-13 09:23:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 474 ms |
| コンパイル使用メモリ | 60,428 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:58:16 |
| 合計ジャッジ時間 | 1,143 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
using namespace std;
int main() {
int item[10] = { 0 };
int N;
int item_num = 0;
int up_times = 0;
cin >> N;
for (int i = 0; i < N;i++) {
int a, b, c;
cin >> a >> b >> c;
if (++item[a - 1] == 2) { up_times++; item[a - 1] = 0; }
if (++item[b - 1] == 2) { up_times++; item[b - 1] = 0; }
if (++item[c - 1] == 2) { up_times++; item[c - 1] = 0; }
}
for (int i = 0; i < 10;i++) {
item_num += item[i];
}
up_times += (item_num / 4);
cout << up_times << endl;
return 0;
}
kei