結果

問題 No.725 木は明らかに森である
ユーザー CecilCecil
提出日時 2023-01-27 19:41:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 2,607 ms
コンパイル使用メモリ 70,772 KB
実行使用メモリ 56,216 KB
最終ジャッジ日時 2023-09-10 13:31:45
合計ジャッジ時間 3,882 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,628 KB
testcase_01 AC 122 ms
55,920 KB
testcase_02 AC 120 ms
56,216 KB
testcase_03 AC 121 ms
55,856 KB
testcase_04 AC 120 ms
56,200 KB
testcase_05 AC 120 ms
55,812 KB
testcase_06 AC 121 ms
56,032 KB
testcase_07 AC 121 ms
55,448 KB
testcase_08 AC 125 ms
55,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static String word = "treeone";

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);

		String n = scan.hasNextLine() ? scan.nextLine() : null;
		
		// 小文字のみ
		String regex_Alphabet = "^[a-z]+$";

		if (n.length() > 100 || n.length() < 1 || !n.matches(regex_Alphabet)) {
			System.out.println("入力エラー1");
			return;
		}
		
		String ans  = n.replace(word,"forest");

		// 結果出力
		System.out.println(ans);

	}
}
0