Submission #532976
Source Code Expand
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(int)(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(x) (x).begin(),(x).end() #define pb emplace_back using namespace std; typedef int64_t ll; typedef long double ld; const int INF = 1e9; const ld EPS = 1e-11; 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); } int main() { int T; cin >> T; string loc[2] = {"kyoto", "tokyo"}; REP(t,T) { string s; cin >> s; int res = 0; for(int i=0;i<s.size()-4;i++) { REP(j,2) { if(s.substr(i, 5) == loc[j]){ res++; i += 4; break; } } } cout << res << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | lan |
Language | C++11 (GCC 4.9.2) |
Score | 0 |
Code Size | 800 Byte |
Status | RE |
Exec Time | 288 ms |
Memory | 1080 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 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 | 860 KB |
20_noised_tokyoto.txt | AC | 30 ms | 820 KB |
99_teuchi.txt | RE | 288 ms | 1080 KB |