Submission #2211265
Source Code Expand
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <limits> #include <map> #define REP(i,n) for(int (i)=0;(i)<(n);(i)++) #define IREP(i,j,n) for(int (i)=(j);(i)<(n);(i)++) #define INF numeric_limits<double>::infinity() constexpr long MOD = 1e9 + 7; using namespace std; int cnt; void solve(string s) { REP(i,int(s.size())-4) { if (s.substr(i,5) == "tokyo" || s.substr(i,5) == "kyoto") { cnt++; solve(s.substr(i+5)); break; } } } int main() { int t; cin >> t; string s; REP(i,t) { cin >> s; solve(s); cout << cnt << endl; cnt = 0; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | xuzijian629 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 736 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 |