Task: | DNA sequence |
Sender: | Spitfire |
Submission time: | 2016-05-28 11:40:44 +0300 |
Language: | C++ |
Status: | READY |
Result: | TIME LIMIT EXCEEDED |
test | verdict | time | |
---|---|---|---|
#1 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <iostream> #include <string> int main() { std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::string str; str.reserve(100000); std::cin >> str; unsigned int q; std::cin >> q; std::string substr; str.reserve(10); for (size_t i = 0; i < q; i++) { std::cin >> substr; if (str.find(substr) == std::string::npos) { std::cout << "NO\n"; } else { std::cout << "YES\n"; } } return 0; }