Submission #5498085


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
bool tokyo(int x, string s) {
    return s.at(x)=='t' && s.at(x+1)=='o' && s.at(x+2)=='k' && s.at(x+3)=='y' && s.at(x+4)=='o';
}
bool kyoto(int x, string s) {
    return s.at(x)=='k' && s.at(x+1)=='y' && s.at(x+2)=='o' && s.at(x+3)=='t' && s.at(x+4)=='o';
}

int main() {
    int T;
    cin >> T;
    vector<string> S(T);
    for(string s : S) {
        cin >> s;
        int cnt = 0;
        int x = 0;
        while (x < s.size()-4) {
            if(tokyo(x, s) || kyoto(x, s)) {
                cnt++;
                x += 5;
            }
            else x++;
        }
        cout << cnt << endl;
    }
}

Submission Info

Submission Time
Task A - 東京都
User gyouzasushi
Language C++14 (GCC 5.4.1)
Score 0
Code Size 685 Byte
Status RE
Exec Time 98 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 2
RE × 1
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 3 ms 256 KB
99_teuchi.txt RE 98 ms 256 KB