結果
| 問題 | No.3847 Triple Balls Removal |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-12-03 20:01:54 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 521 bytes |
| 記録 | |
| コンパイル時間 | 2,398 ms |
| コンパイル使用メモリ | 346,416 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-12-04 21:20:33 |
| 合計ジャッジ時間 | 6,974 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 2 |
ソースコード
// This solution should be WA!
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n);
for (auto& x : a) cin >> x;
deque<int> s;
auto removed = 0;
for (const int x : a) {
s.push_back(x);
const int m = s.size();
if (m >= 3 && s[m - 1] == s[m - 2] && s[m - 2] == s[m - 3]) {
s.resize(m - 3);
removed += 3;
}
if (ssize(s) > 100000) s.pop_front();
}
cout << removed << '\n';
}