| 5 | using namespace std; |
| 6 | |
| 7 | int main() { |
| 8 | int n,c; cin >> n >> c; |
| 9 | int a[n]; |
| 10 | int w1 = 0,w2 = 0; |
| 11 | for (int i =0; i < n; i++) |
| 12 | { |
| 13 | cin >> a[i]; |
| 14 | } |
| 15 | |
| 16 | for (int i = 0; i < n-1; i++) |
| 17 | { |
| 18 | int diff = a[i+1]-a[i]; |
| 19 | if (diff <= c)//1 <= 1 |
| 20 | { |
| 21 | w1++; |
| 22 | } |
| 23 | else if (diff > c)//2 > 1.2 > 1.2 > 1.2 > 1. |
| 24 | { |
| 25 | w1= 0;//w = 0. |
| 26 | } |
| 27 | } |
| 28 | cout << w1+1; |
| 29 | return 0; |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected