結果

問題 No.725 木は明らかに森である
ユーザー KhiromuKhiromu
提出日時 2018-08-24 21:32:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 164,728 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 11:03:58
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

string s;
int main() {
    cin>>s;

    ll idx=0;
    ll num=s.find("treeone", idx);
    while(num != string::npos){
        REP(i, idx, num) cout<<s[i];
        cout<<"forest";

        idx=num+7;
        num=s.find("treeone", idx);
    }
    REP(i, idx, s.size()) cout<<s[i];
    cout<<endl;
    return 0;
}
0