Submission #810589
Source Code Expand
#include<iostream> #include<string> using namespace std; string S; int main(){ int n;cin>>n; for(int i=0;i<n;i++){ cin>>S; int p=0,sum=0; if(S.size()<=4)goto E; while(p<S.size()-4){ string T=S.substr(p,5); if(T=="tokyo" || T=="kyoto"){sum++;p+=5;} else{p++;} } E:; cout<<sum<<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | E869120 |
Language | C++ (GCC 4.9.2) |
Score | 100 |
Code Size | 341 Byte |
Status | AC |
Exec Time | 33 ms |
Memory | 916 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 10_random_to_kyo.txt, 20_noised_tokyoto.txt, 99_teuchi.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
10_random_to_kyo.txt | AC | 26 ms | 916 KB |
20_noised_tokyoto.txt | AC | 33 ms | 716 KB |
99_teuchi.txt | AC | 26 ms | 804 KB |