結果

問題 No.536 人工知能
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-06-30 22:28:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 510 bytes
コンパイル時間 3,279 ms
コンパイル使用メモリ 76,932 KB
実行使用メモリ 54,212 KB
最終ジャッジ日時 2024-04-15 06:16:04
合計ジャッジ時間 4,364 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
54,176 KB
testcase_01 AC 123 ms
54,036 KB
testcase_02 AC 121 ms
53,988 KB
testcase_03 AC 118 ms
54,212 KB
testcase_04 AC 104 ms
52,860 KB
testcase_05 AC 108 ms
52,712 KB
testcase_06 AC 116 ms
53,072 KB
testcase_07 AC 122 ms
54,036 KB
testcase_08 AC 120 ms
54,068 KB
testcase_09 AC 120 ms
53,676 KB
testcase_10 AC 110 ms
52,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        solve(S);
    }
    static void solve(String S){
        int N = S.length();
        if(S.charAt(N-2)=='a'&&S.charAt(N-1)=='i'){
            for(int i=0; i<=N-3; i++){
                System.out.print(S.charAt(i));
            }
            System.out.println("AI");
        }else{
            System.out.println(S+"-AI");
        }
    }
}
0