Submission #5558726
Source Code Expand
#include <stdio.h> #include <string> #include <algorithm> #include <set> #include <map> #include <vector> #include <iostream> #include<math.h> #include<bitset> #include<iomanip> #include<queue> using namespace std; int main() { int T; cin >> T; vector<string> s(T); for (int i = 0; i < T; i++)cin >> s[i]; for (int i = 0; i < T; i++) { int ans = 0; for (int j = 0; j < s[i].size()-4; j++) { if (s[i][j] == 't'&&s[i][j + 1] == 'o'&&s[i][j + 2] == 'k'&&s[i][j + 3] == 'y'&&s[i][j + 4] == 'o') { ans++; j += 4; } if (j >= s[i].size())break; if (s[i][j + 3] == 't'&&s[i][j + 4] == 'o'&&s[i][j] == 'k'&&s[i][j + 1] == 'y'&&s[i][j + 2] == 'o') { ans++; j += 4; } } cout << ans << endl; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | yakyuubu7 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 764 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 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 | AC | 2 ms | 256 KB |
20_noised_tokyoto.txt | AC | 2 ms | 256 KB |
99_teuchi.txt | AC | 1 ms | 256 KB |