Submission #5242808


Source Code Expand

#include <iostream>
#include <string>
using namespace std;

int main() {
    int T;
    cin >> T;
    for (int t=0; t<T; ++t) {
        string S;
        cin >> S;
        int len;
        int ans = 0;
        len = S.size();
        for (int i=0; i<len-4; ++i) {
            string sub = S.substr(i, i+5);
            if (sub == "tokyo" || sub == "kyoto") {
                ++ans;
                i += 4;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task A - 東京都
User doraneko94
Language C++14 (Clang 3.8.0)
Score 0
Code Size 503 Byte
Status WA
Exec Time 3 ms
Memory 384 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 3
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 3 ms 384 KB
20_noised_tokyoto.txt WA 2 ms 256 KB
99_teuchi.txt WA 2 ms 256 KB