Submission #5542067


Source Code Expand

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T;
    cin >> T;
    vector<string> S(T);
    REP(i, T) cin >> S[i];
    for (int i = 0; i < T; ++i) {
        int ans = 0;
        for (int j = 0; j < S[i].size();) {
            if(S[i].substr(j, 5) == "kyoto" || S[i].substr(j, 5) == "tokyo"){
                ans++;
                j += 5;
            }else {
                j++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task A - 東京都
User machida_k
Language C++14 (GCC 5.4.1)
Score 100
Code Size 617 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