結果
問題 | No.1643 Not Substring |
ユーザー |
![]() |
提出日時 | 2021-08-13 21:27:32 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 53 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 3,290 ms |
コンパイル使用メモリ | 74,176 KB |
実行使用メモリ | 37,108 KB |
最終ジャッジ日時 | 2024-10-03 21:30:36 |
合計ジャッジ時間 | 5,250 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
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);}}