Submission #2150417


Source Code Expand

// ------------------------------------
// Date:2018/ 3/ 3
// Problem:kyoCon '15 東京都 a.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int MOD = 1000000007;

int main()
{
  int T;
  scanf("%d", &T);
  
  int ans;
  string inputStr, tmp;
  while(T--) {
    ans = 0;
    cin >> inputStr;
    RREP(j, inputStr.size()) {
      tmp = inputStr.substr(j, 5);
      if (tmp == "kyoto" or tmp == "tokyo") {
        ++ans;
        j -= 5;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &T);
                  ^

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 2 ms 256 KB