Submission #5337748
Source Code Expand
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<stack> #include<queue> #include<deque> #include<map> #include<set> using namespace std; typedef long long ll; typedef vector<int> VI; #define FOR(i,n) for(int (i)=0;(i)<(n);(i)++) #define FOR1(i,n) for(int (i)=1;(i)<(n);(i)++) #define eFOR(i,n) for(int (i)=0;(i)<=(n);(i)++) #define eFOR1(i,n) for(int (i)=1;(i)<=(n);(i)++) #define SORT(i) sort((i).begin(),(i).end()) #define rSORT(i) sort((i).begin(),(i).end(), greater<int>()); #define F first #define S second constexpr auto INF = 1000000000; constexpr auto LLINF = 9223372036854775807; constexpr auto mod = 1000000007; int main() { int t; cin >> t; FOR(i, t) { string s; cin >> s; vector<pair<int, int>> a; FOR(j, s.length() - 4) { if (s.substr(j, 5) == "kyoto" || s.substr(j, 5) == "kyoto") { a.push_back({ j + 4, j }); } } SORT(a); int ans = 0, last = 0; FOR(j, a.size()) { if (a[j].S > last) { ans++; last = a[j].F; } } cout << ans << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | first_vil |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1111 Byte |
Status | RE |
Exec Time | 103 ms |
Memory | 384 KB |
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 | 3 ms | 256 KB |
20_noised_tokyoto.txt | WA | 3 ms | 256 KB |
99_teuchi.txt | RE | 103 ms | 384 KB |