結果
| 問題 |
No.2924 <===Super Spaceship String===>
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:32:40 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 586 bytes |
| コンパイル時間 | 968 ms |
| コンパイル使用メモリ | 106,296 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 15:33:17 |
| 合計ジャッジ時間 | 1,681 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 6 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>
#include <tuple>
#include <set>
#include <map>
#include <cassert>
using namespace std;
int main() {
string s;
cin >> s;
char pre = '?';
string t;
for (char c: s) {
if (c != '=') {
t += c;
} else {
if (pre != '=') {
t += c;
}
}
pre = c;
}
string u;
for (char c: t) {
u += c;
if (u.size() < 3) { continue; }
if (u.ends_with("<=>")) {
u.pop_back();
u.pop_back();
u.pop_back();
}
}
cout << u.size() << endl;
return 0;
}