Submission #1368017
Source Code Expand
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <vector> #include <string> #include <queue> #include <deque> #include <list> #include <stack> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <algorithm> #define int long long #define MOD7 1000000007 #define MOD9 1000000009 #define rep(i, n) for (int i = 0; i < (n); i++) #define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++) #define REP(i, a, n) for (int i = (a); i <= (n); i++) #define all(a) (a).begin(), (a).end() using namespace std; int dx[4] = { 1, 0, -1, 0 }; int dy[4] = { 0, -1, 0, 1 }; template<class T> void inputVector(vector<T>& v, int n) { v.resize(n); for (int i = 0; i < v.size(); i++) cin >> v[i]; } signed main() { string s; cin >> s; int a = -1, b = -1; rep(i, s.size()) { if (s[i] == 'A' && a == -1) a = i; if (s[i] == 'Z') b = i; } cout << b - a + 1 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - A to Z String |
User | iwashi31 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1067 Byte |
Status | AC |
Exec Time | 10 ms |
Memory | 640 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 | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
00_example_03.txt | AC | 1 ms | 256 KB |
01.txt | AC | 7 ms | 640 KB |
02.txt | AC | 6 ms | 640 KB |
03.txt | AC | 4 ms | 512 KB |
04.txt | AC | 4 ms | 512 KB |
05.txt | AC | 8 ms | 640 KB |
06.txt | AC | 10 ms | 640 KB |
07.txt | AC | 8 ms | 640 KB |
08.txt | AC | 8 ms | 640 KB |
09.txt | AC | 8 ms | 640 KB |