Submission #5565811


Source Code Expand

#include <iostream>
#include <string>

using namespace std;

int main(){
    int n;
    cin >> n;

    for(int i = 0; i < n; i++){
        string test_value;
        cin >> test_value;

        int len = test_value.size();

        int ans = 0;

        for(int j = 0; j < len-4; j++){
            string tmp = test_value.substr(j, 5);
            if(tmp == "kyoto" || tmp == "tokyo"){
                j += 4;
                ans++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task A - 東京都
User yuyargon
Language C++14 (Clang 3.8.0)
Score 100
Code Size 536 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

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