Saleh127

CF 427B

Jul 27th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9.  
  10. ll a[200005],c,d,e,f=0,i,j=0,k,l;
  11. cin>>c>>d>>e;
  12. for(i=0; i<c; i++)
  13. {
  14. cin>>a[i];
  15. }
  16. for(i=0; i<c; i++)
  17. {
  18. if(a[i]<=d)
  19. {
  20. f++;
  21. }
  22. else
  23. {
  24. if(f-e+1>=0)
  25. {
  26. j+=(f-e+1);
  27. }
  28. f=0;
  29. }
  30. }
  31. if(f>0 && (f-e+1>=0))
  32. {
  33. j+=(f-e+1);
  34. }
  35. cout<<j<<endl;
  36. return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment