Submission #2638511
Source Code Expand
#include<cstdio> #include <vector> #include <iostream> #include <algorithm> #include <math.h> #include<string> using namespace std; vector<string> v(102); int T,co; int main(){ scanf("%d", &T); for(int i=0;i<T;i++) cin >> v[i]; for(int j=0;j<T;j++){ co = 0; string a = v[j]; int b = a.length(); for(int i=0;i<b;i++){ if(a[i] == 't'){ if(a.substr(i,5) == "tokyo"){ co += 1; i += 4; } } if(a[i] == 'k'){ if(a.substr(i,5) == "kyoto"){ co += 1; i += 4; } } } std::cout << co << '\n'; } }
Submission Info
Submission Time | |
---|---|
Task | A - 東京都 |
User | rookzeno |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 596 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:13: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 | 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 |