結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
Kurichan0806
|
| 提出日時 | 2017-11-01 16:32:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 472 bytes |
| 記録 | |
| コンパイル時間 | 887 ms |
| コンパイル使用メモリ | 79,444 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 21:03:34 |
| 合計ジャッジ時間 | 1,413 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <cmath>
using namespace std;
#define diff(x, y) ((x) > (y) ? ((x) - (y)) : ((y) - (x)))
int main(void) {
int n, no, ans = 0, sum = 0;
cin >> n;
vector <int> x(11, 0);
for (int i = 0; i < n * 3; i++) {
sum++;
cin >> no;
x[no]++;
if (x[no] >= 2) {
ans++;
sum -= 2;
x[no] -= 2;
}
}
cout << ans + sum / 4<< endl;
return 0;
}
Kurichan0806