結果

問題 No.536 人工知能
ユーザー jimanojimano
提出日時 2018-01-26 22:24:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 3,612 ms
コンパイル使用メモリ 83,100 KB
実行使用メモリ 51,700 KB
最終ジャッジ日時 2023-08-27 19:17:40
合計ジャッジ時間 4,892 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 48 ms
49,704 KB
testcase_02 AC 48 ms
49,788 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 48 ms
49,796 KB
testcase_06 WA -
testcase_07 AC 48 ms
49,664 KB
testcase_08 WA -
testcase_09 AC 47 ms
49,532 KB
testcase_10 AC 48 ms
49,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0536 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String input = br.readLine();

			String ans = judgeLastletter(input) ? input.substring(0, input.lastIndexOf("ai")) + "Ai" : input + "-AI";

			System.out.println(ans);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	static boolean judgeLastletter(String input) {
		return input.charAt(input.length() - 2) == 'a' && input.charAt(input.length() - 1) == 'i';
	}
}
0