結果

問題 No.725 木は明らかに森である
コンテスト
ユーザー kikage
提出日時 2020-02-11 00:35:44
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 477 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 145 ms
コンパイル使用メモリ 41,236 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-17 07:29:30
合計ジャッジ時間 927 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <cstring>
int main(){
    const char Tree[8]="treeone";
    char str[100+1];
    scanf("%s",str);
    for(int pos=0;pos<strlen(str);pos++){
        int k=0;
        for(;pos+k<strlen(str) && k<7;k++){
            if(str[pos+k]!=Tree[k])break;
        }
        if(k==7){
            printf("forest");pos+=7-1;
        }else{
            for(int l=0;l<=k;l++)printf("%c",str[pos+l]);
            pos+=k;
        }
    }printf("\n");
    return 0;
}

0