結果

問題 No.725 木は明らかに森である
ユーザー xuelei
提出日時 2018-08-24 21:50:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 159,860 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 07:07:24
合計ジャッジ時間 2,008 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  string s;
  cin>>s;
  if(s.size()<7){
  	cout << s << endl;
  	return 0;
  }
  for(int i=0;i<s.size()-6;++i){
    if(s.substr(i,7)=="treeone"){
      s.erase(i,7);
      s.insert(i,"forest");
      i+=5;
    }
  }
  cout << s << endl;
  return 0;
}
0