Submission #2210178


Source Code Expand

#include <iostream>
#include <string>       //substrを使う

using namespace std;

const int MAX_T = 100;

int T, ans;
string S[MAX_T];

void solve() {
    for(int i = 0; i < T; i++) {    
        ans = 0;
        for(int j = 0; j < S[i].size()-4; j++) {
            string tmp = S[i].substr(j,5);
            if(tmp == "tokyo" || tmp == "kyoto") {
                ans++;
                j += 4;
            }
        }
        cout << ans << endl;
    }
}

int main() {
    cin >> T;
    for(int i = 0; i < T; i++) cin >> S[i];
    solve();
    return 0;
}

// sizeof(array) / sizeof(array[0]) :100

Submission Info

Submission Time
Task A - 東京都
User ktguy
Language C++14 (GCC 5.4.1)
Score 0
Code Size 632 Byte
Status RE
Exec Time 99 ms
Memory 512 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 2 ms 256 KB
99_teuchi.txt RE 99 ms 512 KB