Submission #533062
Source Code Expand
#include<iostream> #include<algorithm> #include<string> #include<vector> #include<set> #include<sstream> #include<cctype> using namespace std; int main() { int n; string s; cin >> n; for (int i = 0; i < n; i++) { cin >> s; int sum = 0; for (int j = 0; j < static_cast<int>(s.size()); j++) { if (s.substr(j, 5) == "tokyo" || s.substr(j, 5) == "kyoto") { sum++; if (j + 4 <= static_cast<int>(s.size()) - 1) { j += 4; } } } cout << sum << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | kkrtjnj3829 |
Language | C++ (GCC 4.9.2) |
Score | 100 |
Code Size | 537 Byte |
Status | AC |
Exec Time | 31 ms |
Memory | 928 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 | 29 ms | 808 KB |
20_noised_tokyoto.txt | AC | 31 ms | 928 KB |
99_teuchi.txt | AC | 29 ms | 924 KB |