Submission #3789681
Source Code Expand
#include<bits/stdc++.h> using namespace std; int read(int &x) { char c=getchar();int f=1; x=0; while (c<'0'||c>'9') { if (c=='-') f=-1; c=getchar(); } while (c>='0'&&c<='9') { x=x*10+(int)c-48; c=getchar(); } return x*f; } int main() { int T; cin>>T; string s; while(T--) { int len,ans=0; cin>>s; for(int i=0;i<s.length();i++) { if((s[i]=='t'&&s[i+1]=='o'&&s[i+2]=='k'&&s[i+3]=='y'&&s[i+4]=='o')||(s[i]=='k'&&s[i+1]=='y'&&s[i+2]=='o'&&s[i+3]=='t'&&s[i+4]=='o')) { ans++,i+=4; } } cout<<ans<<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | luogu_bot3 |
Language | C++ (GCC 5.4.1) |
Score | 100 |
Code Size | 737 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 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 | 2 ms | 256 KB |
20_noised_tokyoto.txt | AC | 2 ms | 256 KB |
99_teuchi.txt | AC | 2 ms | 256 KB |