結果

問題 No.725 木は明らかに森である
ユーザー N.MatsumotoN.Matsumoto
提出日時 2019-09-22 08:46:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 790 bytes
コンパイル時間 3,696 ms
コンパイル使用メモリ 75,804 KB
実行使用メモリ 57,588 KB
最終ジャッジ日時 2023-10-19 07:05:12
合計ジャッジ時間 4,852 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,296 KB
testcase_01 AC 128 ms
57,412 KB
testcase_02 AC 128 ms
57,364 KB
testcase_03 AC 129 ms
57,344 KB
testcase_04 AC 129 ms
57,336 KB
testcase_05 WA -
testcase_06 AC 129 ms
57,352 KB
testcase_07 WA -
testcase_08 AC 133 ms
57,304 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> strList = new ArrayList<>();
        List<String> resList = new ArrayList<>();
        for (int i = 0; i < array.length; i++) {
            strList.add(array[i]);
            if (strList.size() == 7) {
                resList.add(String.join("", strList).equals("treeone") ? "forest" : String.join("", strList));
                strList.clear();
            } else if (i == array.length - 1) {
                resList.add(String.join("", strList));
            }
        }
        System.out.println(String.join("", resList));
    }
}
0