Submission #1982995


Source Code Expand

#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){

  int t;
  string s, tokyo="tokyo", kyoto="kyoto";

  cin>>t;
  for(int i=0;i<t;i++){
    cin>>s;
    int ct=0, ck=0;
    
    for(int j=0;j<=s.size()-5;j++){
      if(s.substr(j, 5)==tokyo) ct++;
    }
    for(int j=0;j<=s.size()-5;j++){
      if(s.substr(j, 5)==kyoto) ck++;
    }

    cout<<max(ct, ck)<<endl;
  }
  
  return 0;
}

Submission Info

Submission Time
Task A - 東京都
User y_yujin
Language C++14 (GCC 5.4.1)
Score 0
Code Size 454 Byte
Status RE
Exec Time 99 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 2
RE × 1
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 WA 3 ms 256 KB
20_noised_tokyoto.txt WA 3 ms 256 KB
99_teuchi.txt RE 99 ms 256 KB