Submission #532927
Source Code Expand
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <cfloat> #include <climits> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> i_i; typedef pair<ll, int> ll_i; typedef pair<double, int> d_i; typedef pair<ll, ll> ll_ll; typedef pair<double, double> d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; ll INF = LLONG_MAX / 2; double EPS = 1e-10; int main() { int T; cin >> T; while (T--) { string S; cin >> S; int n = S.length(), cnt = 0; for (int i = 0; i + 5 <= n;) { if (S.substr(i, 5) == "tokyo" || S.substr(i, 5) == "kyoto") { cnt++; i += 5; } else i++; } cout << cnt << endl; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | sugim48 |
Language | C++11 (GCC 4.9.2) |
Score | 100 |
Code Size | 1023 Byte |
Status | AC |
Exec Time | 30 ms |
Memory | 928 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
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 | 30 ms | 924 KB |
20_noised_tokyoto.txt | AC | 28 ms | 800 KB |
99_teuchi.txt | AC | 28 ms | 928 KB |