結果
問題 |
No.725 木は明らかに森である
|
ユーザー |
|
提出日時 | 2018-09-16 17:04:21 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 121 ms / 2,000 ms |
コード長 | 907 bytes |
コンパイル時間 | 3,090 ms |
コンパイル使用メモリ | 75,764 KB |
実行使用メモリ | 54,508 KB |
最終ジャッジ日時 | 2024-07-18 07:24:38 |
合計ジャッジ時間 | 4,646 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder725 { private static Scanner sc; private static Printer pr; private static void solve() { String s = sc.next(); int n = s.length(); int i = 0; int next; while ((next = s.indexOf("treeone", i)) >= 0) { for (int j = i; j < next; j++) { pr.print(s.charAt(j)); } pr.print("forest"); i = next + 7; } for (int j = i; j < n; j++) { pr.print(s.charAt(j)); } pr.println(); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }