Submission #1151332
Source Code Expand
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; const int INF = 2000000000; using namespace std; int main(){ int n; cin >> n; rep(i,n){ string s; cin >> s; int cnt = 0; rep(j,s.size()){ string tmp = s.substr(j,5); if(tmp == "kyoto" || tmp == "tokyo"){ cnt++; j += 4; } } cout << cnt << endl; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | noy72 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 720 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 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 | 2 ms | 256 KB |
20_noised_tokyoto.txt | AC | 2 ms | 256 KB |
99_teuchi.txt | AC | 2 ms | 256 KB |