結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-31 19:04:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 331 bytes |
| コンパイル時間 | 598 ms |
| コンパイル使用メモリ | 64,396 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 14:19:04 |
| 合計ジャッジ時間 | 969 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
string befo = "treeone";
string aft = "forest";
int pos = 0;
int len = befo.length();
while ((pos = s.find(befo, pos)) != -1) {
s.replace(pos, len, aft);
pos += aft.length();
}
cout << s << endl;
return 0;
}