Submission #2142187
Source Code Expand
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <math.h> using namespace std; int INF=1e9; int main(void){ int t; cin>>t; string s1="tokyo",s2="kyoto"; for(int i=0;i<t;i++){ string s; cin>>s; int res=0; for(int j=0;j<s.size();j++){ int c=0,q=0; for(int k=0;k<5;k++){ if(s[j+k]==s1[k])c++; } if(c==5){ res++; j+=5; q=1; } c=0; for(int k=0;k<5;k++){ if(s[j+k]==s2[k])c++; } if(c==5){ res++; j+=5; q=1; } if(q==1)j--; } cout<<res<<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | Hirosesesese23 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 862 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 |