Submission #532950


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-10;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	int n;
	cin >> n;
	while (n--)
	{
		string s;
		cin >> s;
		int cnt = 0;
		REP(i, s.size()- 4)
		{
			string tmp = s.substr(i, 5);
			if (tmp == "kyoto" || tmp == "tokyo") cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task A - 東京都
User amano
Language C++11 (GCC 4.9.2)
Score 0
Code Size 901 Byte
Status WA
Exec Time 451 ms
Memory 1076 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 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 WA 30 ms 804 KB
20_noised_tokyoto.txt WA 28 ms 924 KB
99_teuchi.txt RE 451 ms 1076 KB