Submission #5302069


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

/* メモリ食い過ぎ注意 */
#define int ll
#define ALL(v) v.begin(), v.end()
#define _REP(i, n) for (int i = 0; i < n; i++)
#define REP(n) _REP(i, n)

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int t;
    string s[100];
    cin >> t;
    for (int i = 0; i < t; i++)
        cin >> s[i];

    for (int i = 0; i < t; i++)
    {
        int cnt = 0;
        for (int j = 0; j + 4 < s[i].length(); j++)
        {
            if (s[i].substr(j, 5) == "tokyo" || s[i].substr(j, 5) == "kyoto")
            {
                cnt++;
                j += 4;
            }
        }
        cout << cnt << endl;
    }
}

Submission Info

Submission Time
Task A - 東京都
User Myah
Language C++14 (GCC 5.4.1)
Score 100
Code Size 794 Byte
Status AC
Exec Time 3 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 3 ms 256 KB
20_noised_tokyoto.txt AC 3 ms 256 KB
99_teuchi.txt AC 2 ms 256 KB