Submission #5533867
Source Code Expand
#include "bits/stdc++.h" using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //using Matrix = vector< vector<int> >; typedef long long ll; typedef pair<int, int> P; const int INF = 1 << 30; int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0}; int t; int main(void){ cin>>t; for(int i=0;i<t;i++) { string S; cin>>S; int ans = 0; if(S.size() < 5) { cout<< 0 <<endl; return 0; } for(int j=0;j + 5 - 1<S.size();j++) { if(S.substr(j, 5) == "kyoto" || S.substr(j, 5) == "tokyo") { ans++; j += 5; } } //cout<<" S :"<< S <<endl<<endl; cout<< ans <<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | iketyun08 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 802 Byte |
Status | WA |
Exec Time | 3 ms |
Memory | 256 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 0 / 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 | WA | 2 ms | 256 KB |
20_noised_tokyoto.txt | WA | 3 ms | 256 KB |
99_teuchi.txt | WA | 1 ms | 256 KB |