Submission #5558819


Source Code Expand

#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int main()
{
    vector<string> v = {"kyoto", "tokyo"};
    int n;
    cin >> n;
    while (n--)
    {
        int count = 0;
        string s;
        cin >> s;
        rep(i, s.size() - 4)
        {
            string t = s.substr(i, 5);
            rep(j, 2)
            {
                if (t == v[j])
                {
                    count++;
                    i = i + 4;
                }
            }
        }
        cout << count << endl;
    }
    return 0;
}

Submission Info

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