結果

問題 No.725 木は明らかに森である
ユーザー N.MatsumotoN.Matsumoto
提出日時 2019-09-21 21:46:27
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 683 bytes
コンパイル時間 2,191 ms
コンパイル使用メモリ 80,960 KB
実行使用メモリ 57,592 KB
最終ジャッジ日時 2023-10-19 06:49:16
合計ジャッジ時間 4,240 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] array = sc.next().split("");

        List<String> res = new ArrayList<>();
        List<String> target = new ArrayList<>();
        for (String str : array) {
            if (target.size() != 6) {
                target.add(str);
            } else {
                if (String.join("", target).equals("treeone")) {
                    str = "forest";
                }
            }
            res.add(str);
        }
        System.out.println(String.join("", res));
    }
}
0