fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <cstdio>
  4. #include <cstdlib>
  5. #include <cmath>
  6. #include <string.h>
  7. #include <vector>
  8. #include <list>
  9. #include <queue>
  10. #include <deque>
  11. #include <stack>
  12. #include <map>
  13. #include <set>
  14. #include <algorithm>
  15. using namespace std;
  16. int main()
  17. {
  18. int t;
  19. char str1[100001],str2[100001],*p;
  20. scanf("%d",&t);
  21. while(t--)
  22. {
  23. scanf("%s",str1);
  24. scanf(" %s",str2);
  25. p=strstr(str1,str2);
  26. if(p!=NULL)
  27. printf("YES\n");
  28. else
  29. printf("NO\n");
  30. }
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 3420KB
stdin
2
hackerearth
hacker
hackerearth
e
stdout
YES
YES