結果

問題 No.536 人工知能
ユーザー GrenacheGrenache
提出日時 2017-06-30 22:22:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 691 bytes
コンパイル時間 3,294 ms
コンパイル使用メモリ 74,948 KB
実行使用メモリ 54,272 KB
最終ジャッジ日時 2024-04-15 05:59:24
合計ジャッジ時間 4,917 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
54,108 KB
testcase_01 AC 119 ms
54,092 KB
testcase_02 AC 113 ms
53,872 KB
testcase_03 AC 118 ms
54,036 KB
testcase_04 AC 105 ms
52,996 KB
testcase_05 AC 116 ms
54,076 KB
testcase_06 AC 115 ms
54,148 KB
testcase_07 AC 115 ms
53,920 KB
testcase_08 AC 114 ms
54,272 KB
testcase_09 AC 106 ms
53,876 KB
testcase_10 AC 118 ms
54,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder536 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();

		int n = s.length;

		if (s[n - 2] == 'a' && s[n - 1] == 'i') {
			s[n - 2] = 'A';
			s[n - 1] = 'I';

			pr.println(s);
		} else {
			pr.print(s);
			pr.println("-AI");
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0