by@akouryy1
AC
1992ms
import java.util.Scanner; public class A{ public static void main(String[]a){ boolean b=false; int d=1; Scanner s=new Scanner(System.in); String g; while((g=s.nextLine())!=null){ for(int i=0;i<g.length();++i){ char c=g.charAt(i); if(c>83)d=0; b=c==75||b&&d>0; System.out.print(d==0||b?"A":c+""); d=++d%50; }System.out.println();}}}
T K
A A A A A A A A A A A A A A A A A A A A A A A A A AAAAAAAAAAA
Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at A.main(A.java:8)