fork(1) download
  1. #include "stdio.h"
  2. #include "math.h"
  3. #include "string.h"
  4. #define ll unsigned int
  5. #define gc getchar_unlocked
  6. #define pc putchar_unlocked
  7. inline ll r()
  8. {
  9. ll x=0;
  10. char c=gc();
  11. while(c<48||c>57)
  12. c=gc();
  13. while(c>=48&&c<=57)
  14. {
  15. x=x*10+c-48;
  16. c=gc();
  17. }
  18. return x;
  19. }
  20. int main()
  21. {
  22. ll A,B,i,t,max,ct;
  23. char c;
  24. t=r();
  25. while(t--)
  26. {
  27. A=r(); B=r();
  28. ct=max=0;
  29. while((c=gc())!='\n')
  30. {
  31. if(c=='#')
  32. ct++;
  33. else
  34. ct=0;
  35. if(ct>max)
  36. max=ct;
  37. }
  38. if(max>=B)
  39. printf("NO\n");
  40. else
  41. printf("YES\n");
  42. }
  43. return 0;
  44. }
Time limit exceeded #stdin #stdout 15s 3100KB
stdin
2
5 3
.###.
6 2
.#.#.#
stdout
Standard output is empty