This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int N, D;
vector<int> arr;
int main()
{
cin >> N >> D;
arr.resize(N);
for (int &i : arr)
cin >> i;
reverse(arr.begin(), arr.end());
//compression
stack<int> st;
int score = 0;
for (int i : arr)
{
while (!st.empty() && st.top() <= i)
st.pop();
st.push(i);
score = max(score, (int)st.size());
}
cout << score;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |