Submission #1687833


Source Code Expand

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define INF 1e9;
#define mod 1e9+7

//#define max(x,y) (x>y)?x:y
//#define min(x,y) (x<y)?x:y
#define rep(i,j,k) for(int i=j;i<k;i++)
#define repp(i,j,k) for(int i=j;i>=k;i--)
#define mi(n) (int*)malloc(sizeof(int)*n);
#define mc(n) (char*)malloc(sizeof(char)*n);

using namespace std;
void p(int x){
    printf("%d\n",x);
}

void pp(char c){
    printf("%c\n",c);
}

void ppp(char *s){
    printf("%s\n",s);
}

int main(){
   string s;
   cin>>s;
   int count=0,ans=0;
   bool judge=false;
   rep(i,0,s.length()){
       if(s[i]=='A') judge=true;
       if(judge)count++;
       if(s[i]=='Z' && judge){
        ans=max(count,ans);
       }
   }
   
   cout<<ans<<endl;
   
   

    return 0;
}

Submission Info

Submission Time
Task B - A to Z String
User gotutiyan
Language C++14 (GCC 5.4.1)
Score 200
Code Size 818 Byte
Status AC
Exec Time 9 ms
Memory 640 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 12
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 8 ms 640 KB
02.txt AC 6 ms 640 KB
03.txt AC 5 ms 512 KB
04.txt AC 4 ms 512 KB
05.txt AC 8 ms 640 KB
06.txt AC 8 ms 640 KB
07.txt AC 8 ms 640 KB
08.txt AC 9 ms 640 KB
09.txt AC 9 ms 640 KB