fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int T;
  6. cin >> T;
  7.  
  8. for(int i=0; i<T; i++)
  9. {
  10. int N, A, B;
  11. cin >> N >> A >> B;
  12.  
  13. int wearCount = 0;
  14. bool jacket = false;
  15.  
  16. for (int i = 0; i < N; i++)
  17. {
  18. int temp;
  19. cin >> temp;
  20.  
  21. if (temp < A)
  22. {
  23. if (!jacket)
  24. {
  25. wearCount = wearCount + 1;
  26. jacket = true;
  27. }
  28. }
  29. else if (temp > B)
  30. {
  31. jacket = false;
  32. }
  33.  
  34. }
  35.  
  36. cout << wearCount << endl;
  37. }
  38.  
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty