| Task: | DNA sequence |
| Sender: | Team Purkka |
| Submission time: | 2016-05-28 11:20:46 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.17 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:13:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int j = 0; j <= s.length() - i; j++) {
^Code
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main () {
string s;
cin>>s;
int n;
cin>>n;
unordered_map<string, bool> m;
for (int i = 1; i <= min(10, (int)s.length()); i++) {
for (int j = 0; j <= s.length() - i; j++) {
//cout<<i<<" "<<j<<endl;
m[s.substr(j, j + i)] = 1;
}
}
for (int i = 0; i < n; i++) {
string x;
cin>>x;
if (m[x]) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}