Submission #1275709


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const int MOD=1e9+7;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;cin>>n;
  for(int i=0;i<n;i++){
      string s;cin>>s;
      int res=0;
      for(int j=0;j<(int)s.length()-4;j++){
          string sub=s.substr(j,5);
          if(sub=="tokyo"||sub=="kyoto"){
              res++;
              j+=4;
          }
      }
      cout<<res<<endl;
  }
}

Submission Info

Submission Time
Task A - 東京都
User zaki_
Language C++14 (GCC 5.4.1)
Score 100
Code Size 715 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 3
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