結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 132 ms
57,264 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 135 ms
57,216 KB
testcase_07 WA -
testcase_08 AC 137 ms
57,236 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) {
            target.add(str);
            if (target.size() == 7) {
                if (String.join("", target).equals("treeone")) {
                    str = "forest";
                }
            }
            res.add(str);
            target.clear();
        }
        System.out.println(String.join("", res));
    }
}
0