Submission #1241320
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); String str = scan.next(); char st[] = new char[str.length()]; int ans=0; for(int i=0;i<str.length();i++){ st[i] = str.charAt(i); } for(int i=0; i<st.length;i++){ if('A'==st[i]){ for(int f = i; f<st.length;f++){ if('Z'==st[f]){ ans = f - i+1; } }break; } } System.out.println(ans); } }
Submission Info
Submission Time | |
---|---|
Task | B - A to Z String |
User | curi |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 645 Byte |
Status | AC |
Exec Time | 174 ms |
Memory | 26068 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 108 ms | 19412 KB |
00_example_02.txt | AC | 90 ms | 19668 KB |
00_example_03.txt | AC | 90 ms | 21716 KB |
01.txt | AC | 162 ms | 24088 KB |
02.txt | AC | 155 ms | 24400 KB |
03.txt | AC | 143 ms | 26068 KB |
04.txt | AC | 139 ms | 25812 KB |
05.txt | AC | 165 ms | 23472 KB |
06.txt | AC | 169 ms | 23344 KB |
07.txt | AC | 171 ms | 24980 KB |
08.txt | AC | 162 ms | 25588 KB |
09.txt | AC | 174 ms | 24836 KB |