結果

問題 No.725 木は明らかに森である
ユーザー マサマサ
提出日時 2022-02-08 17:55:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,967 ms
コンパイル使用メモリ 72,032 KB
実行使用メモリ 58,060 KB
最終ジャッジ日時 2023-09-05 17:58:44
合計ジャッジ時間 3,857 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,792 KB
testcase_01 AC 123 ms
55,824 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 122 ms
55,948 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		
		StringBuilder sb = new StringBuilder(str);
		try {
			sb = sb.replace(sb.indexOf("treeone"), sb.indexOf("treeone") + 7, "forest");
		} catch(StringIndexOutOfBoundsException e) {
			System.out.println(str);
		}
		
		System.out.println(sb.toString());
		sc.close();
	}
}
0