Submission #1178227
Source Code Expand
using System; class AtCoder { static int Solve(string s) { int aIndex = -1; int zIndex = -1; int i = 0; foreach (char c in s) { if (c == 'A' && aIndex == -1) { aIndex = i; } else if (c == 'Z') { zIndex = i; } ++i; } return (zIndex - aIndex) + 1; } static void Main() { string s = Console.ReadLine(); int answer = Solve(s); Console.WriteLine(answer); } }
Submission Info
Submission Time | |
---|---|
Task | B - A to Z String |
User | tarunama |
Language | C# (Mono 4.6.2.0) |
Score | 200 |
Code Size | 617 Byte |
Status | AC |
Exec Time | 23 ms |
Memory | 11616 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 | 20 ms | 11092 KB |
00_example_02.txt | AC | 19 ms | 9044 KB |
00_example_03.txt | AC | 20 ms | 9044 KB |
01.txt | AC | 21 ms | 11616 KB |
02.txt | AC | 21 ms | 11488 KB |
03.txt | AC | 21 ms | 11232 KB |
04.txt | AC | 21 ms | 11232 KB |
05.txt | AC | 21 ms | 9568 KB |
06.txt | AC | 21 ms | 9568 KB |
07.txt | AC | 21 ms | 11616 KB |
08.txt | AC | 23 ms | 11616 KB |
09.txt | AC | 23 ms | 11616 KB |