CSES - HIIT Open 2016 - Results
Submission details
Task:DNA sequence
Sender:Spitfire
Submission time:2016-05-28 11:40:44 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#1--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;
}

Test details

Test 1

Verdict:

input
ACGCGGGCTCCTAGCGTTAGCAGTTGAGTG...

correct output
YES
YES
NO
NO
YES
...

user output
(empty)