Submission #1983012


Source Code Expand

#include <iostream>
#include <string.h>

using namespace std;

int main(){
  int t, ans = 0;
  cin >> t;
  char s[t][100];
  for (int i = 0; i < t; i++) cin >> s[i];
  for (int i = 0; i < t; i++){
    for (int j = 0; j < strlen(s[i]); j++)
    if (s[i][j] == 't' && j < strlen(s[i]) - 4){
      if (s[i][j+1] == 'o' && s[i][j+2] == 'k' && s[i][j+3] == 'y' && s[i][j+4] == 'o'){
        ans++;
        j += 4;
      }
    }
    else if (s[i][j] == 'k' && j < strlen(s[i]) - 4){
      if (s[i][j+1] == 'y' && s[i][j+2] == 'o' && s[i][j+3] == 't' && s[i][j+4] == 'o'){
        ans++;
        j += 4;
      }
    }
    cout << ans << endl;
    ans = 0;
  }
  return 0;
}

Submission Info

Submission Time
Task A - 東京都
User xmaccode
Language C++14 (GCC 5.4.1)
Score 0
Code Size 694 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Judge Result

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