結果

問題 No.725 木は明らかに森である
ユーザー Ryota EnokidoRyota Enokido
提出日時 2018-12-13 21:31:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 731 bytes
コンパイル時間 2,344 ms
コンパイル使用メモリ 75,440 KB
実行使用メモリ 57,492 KB
最終ジャッジ日時 2023-10-25 09:35:49
合計ジャッジ時間 3,968 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,208 KB
testcase_01 AC 133 ms
57,476 KB
testcase_02 AC 136 ms
57,492 KB
testcase_03 AC 136 ms
57,216 KB
testcase_04 WA -
testcase_05 AC 132 ms
57,196 KB
testcase_06 AC 132 ms
57,472 KB
testcase_07 AC 137 ms
57,176 KB
testcase_08 AC 136 ms
57,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.lang.Math;
import java.lang.StringBuilder;
import java.util.regex.Pattern;
import java.util.Arrays;


    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
  
            String s = sc.nextLine();
            StringBuilder sb = new StringBuilder(s);
            boolean flag = true;
            
            while(flag){
                int start = sb.indexOf("treeone");
                if(sb.toString().contains("treeone")){
                    sb.replace(start, start+7,"forest");
                }else{
                    flag = false;
                }
            }
            System.out.println(sb);
        }
    }
0