Submission #533060
Source Code Expand
#include <cstdio> #include <iostream> #include <algorithm> #include <string> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ int ans = 0; string str; cin >> str; str += "#########"; int len = str.size(); for(int j = 0; j < len; j++){ if(str[j] == 't' && str[j+1] == 'o' && str[j+2] == 'k' && str[j+3] == 'y' && str[j+4] == 'o' ){ ans++; j += 4; }else if(str[j] == 'k' && str[j+1] == 'y' && str[j+2] == 'o' && str[j+3] == 't' && str[j+4] == 'o' ){ ans++; j += 4; } } cout << ans << endl; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | sndtkrh |
Language | C++ (GCC 4.9.2) |
Score | 100 |
Code Size | 864 Byte |
Status | AC |
Exec Time | 28 ms |
Memory | 796 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 | 28 ms | 756 KB |
20_noised_tokyoto.txt | AC | 26 ms | 796 KB |
99_teuchi.txt | AC | 26 ms | 792 KB |