結果

問題 No.725 木は明らかに森である
ユーザー signal_kernel
提出日時 2018-08-31 22:02:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 1,832 ms
コンパイル使用メモリ 55,284 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 22:48:18
合計ジャッジ時間 1,334 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

int main()
{
	std::string T = "treeone";
	std::string F = "forest";
	std::string S;
	std::cin >> S;
	size_t place = 0;
	size_t tree;
	while (place < S.length())
	{
		tree = S.find(T, place);
		if (tree == -1) { break; }
		S.replace(tree, T.length(), F);
		place += tree;
	}
	std::cout << S << std::endl;
	return 0;
}
0