結果
問題 | No.725 木は明らかに森である |
ユーザー |
![]() |
提出日時 | 2018-08-24 21:25:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 711 bytes |
コンパイル時間 | 684 ms |
コンパイル使用メモリ | 82,956 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 06:38:33 |
合計ジャッジ時間 | 1,244 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <string> #include <iomanip> #include <algorithm> #include <cmath> #include <stdio.h> using namespace std; #define int long long int MOD = 1000000007; signed main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; string res; reverse(S.begin(), S.end()); for (int i = 0; i < S.size(); i++) { res.push_back(S[i]); if ((int)res.size() >= 7) { //cerr << res.substr((int)res.size() - 7, 7) << endl; if (res.substr((int)res.size() - 7, 7) == "enoeert") { for (int j = 0; j < 7; j++)res.pop_back(); res += "tserof"; } } } reverse(res.begin(), res.end()); cout << res << endl; }