結果
| 問題 | No.3015 右に寄せろ! |
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2025-01-31 22:33:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 372 bytes |
| 記録 | |
| コンパイル時間 | 2,330 ms |
| コンパイル使用メモリ | 194,392 KB |
| 実行使用メモリ | 19,260 KB |
| 最終ジャッジ日時 | 2025-01-31 22:34:31 |
| 合計ジャッジ時間 | 40,958 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 TLE * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fast_io() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
}
int main() {
fast_io();
string s;
cin >> s;
int n = s.size();
int ans = 0;
for (int i = 2; i < n; i++) {
int j = i;
while (j >= 2 && s.substr(j - 2, 3) == "110") {
swap(s[j], s[j - 2]);
j -= 2;
ans++;
}
}
cout << ans << endl;
}
eve__fuyuki