結果
| 問題 | No.3015 右に寄せろ! |
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2025-01-31 22:33:49 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 372 bytes |
| 記録 | |
| コンパイル時間 | 1,195 ms |
| コンパイル使用メモリ | 210,840 KB |
| 実行使用メモリ | 17,792 KB |
| 最終ジャッジ日時 | 2026-06-27 06:24:10 |
| 合計ジャッジ時間 | 8,040 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 35 |
ソースコード
#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