Submission #2150347
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()
{
cin.tie(0);
ios::sync_with_stdio(false);
int T;
scanf("%d", &T);
vector< string > S(T);
REP(i, T) {
cin >> S[i];
}
int ans;
string tmp;
REP(i, T) {
ans = 0;
REP(j, S[i].size()) {
tmp = S[i].substr(j,5);
if (tmp == "kyoto" or tmp == "tokyo") {
++ans;
j += 4;
}
}
printf("%d\n", ans);
}
return 0;
}
Submission Info
Submission Time
2018-03-03 20:26:55+0900
Task
A - 東京都
User
task4233
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
978 Byte
Status
WA
Exec Time
2 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:29: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
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
1 ms
256 KB
20_noised_tokyoto.txt
WA
2 ms
256 KB
99_teuchi.txt
WA
1 ms
256 KB