結果
問題 |
No.725 木は明らかに森である
|
ユーザー |
![]() |
提出日時 | 2018-08-24 21:23:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 647 bytes |
コンパイル時間 | 958 ms |
コンパイル使用メモリ | 82,044 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 06:33:26 |
合計ジャッジ時間 | 1,328 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 1 |
ソースコード
#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; 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) == "treeone") { for (int j = 0; j < 7; j++)res.pop_back(); res += "forest"; } } } cout << res << endl; }