結果
問題 | No.725 木は明らかに森である |
ユーザー |
|
提出日時 | 2018-09-20 21:01:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 65,876 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 08:36:42 |
合計ジャッジ時間 | 890 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include<iostream> #include<string> using namespace std; int main() { string str, forest = "forest",treeone="treeone"; string substr; cin >> str; int start = 0; while (true) { int index = str.find(treeone, start); if (index == -1)break; str.erase(index, treeone.size()); str.insert(index, forest); start = index + forest.size(); } cout << str << endl; return 0; }