Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void poc()
- {
- int n, m;
- int* input = new int[1000000];
- cin >> n >> m;
- for (int i = 0; i < n; i++)
- {
- cin >> input[i];
- }
- int start = 0;
- long long out = 0;
- for (int i = 0; i < n; i++)
- {
- if (input[i] >= m)
- {
- out += ((long long) i - start + 1) * ((long long) n - i);
- start = i + 1;
- }
- }
- cout << out;
- delete[] input;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement