結果

問題 No.1643 Not Substring
ユーザー merlinmerlin
提出日時 2021-08-13 21:27:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 2,985 ms
コンパイル使用メモリ 74,432 KB
実行使用メモリ 50,340 KB
最終ジャッジ日時 2024-04-14 19:35:34
合計ジャッジ時間 4,557 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
50,184 KB
testcase_01 AC 52 ms
49,944 KB
testcase_02 AC 52 ms
50,208 KB
testcase_03 AC 52 ms
50,300 KB
testcase_04 AC 51 ms
50,240 KB
testcase_05 AC 53 ms
50,340 KB
testcase_06 AC 50 ms
50,248 KB
testcase_07 AC 52 ms
50,032 KB
testcase_08 AC 51 ms
50,284 KB
testcase_09 AC 51 ms
50,280 KB
testcase_10 AC 52 ms
50,044 KB
testcase_11 AC 51 ms
50,028 KB
testcase_12 AC 52 ms
50,032 KB
testcase_13 AC 52 ms
50,128 KB
testcase_14 AC 51 ms
50,336 KB
testcase_15 AC 52 ms
49,792 KB
testcase_16 AC 52 ms
50,264 KB
testcase_17 AC 52 ms
50,216 KB
testcase_18 AC 51 ms
50,256 KB
testcase_19 AC 52 ms
50,136 KB
testcase_20 AC 52 ms
50,268 KB
testcase_21 AC 51 ms
50,068 KB
testcase_22 AC 51 ms
49,824 KB
testcase_23 AC 51 ms
50,208 KB
testcase_24 AC 51 ms
49,884 KB
testcase_25 AC 51 ms
50,208 KB
testcase_26 AC 52 ms
50,304 KB
testcase_27 AC 52 ms
50,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s=bu.readLine();
        int i,n=s.length(),a=1;
        for(i=0;i<n;i++)
        if(s.charAt(i)=='a') a++;

        while(a-->0) sb.append('a');
        System.out.println(sb);
    }
}
0