結果

問題 No.725 木は明らかに森である
ユーザー himohimo
提出日時 2019-09-26 18:36:11
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 540 bytes
コンパイル時間 2,038 ms
コンパイル使用メモリ 161,132 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 15:38:57
合計ジャッジ時間 2,676 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
string s;
cin >>s;
for(int i=6;i<s.size();i++){
    if(s.at(i-6)=='t'&&s.at(i-5)=='r'&&s.at(i-4)=='e'&&s.at(i-3)=='e'&&s.at(i-2)=='o'&&s.at(i-1)=='n'&&s.at(i)=='e'){
        cout <<"forest";
        s.at(i-6)='A';
        s.at(i-5)='A';
        s.at(i-4)='A';
        s.at(i-3)='A';
        s.at(i-2)='A';
        s.at(i-1)='A';
        s.at(i)='A';
    }
}
for(int i=0;i<s.size();i++){
    if(s.at(i)=='A'){
        
    }
    else {
        cout <<s.at(i);
    }
}
cout <<endl;
}
0