Submission #638859

#TimeUsernameProblemLanguageResultExecution timeMemory
638859PietraFinancial Report (JOI21_financial)C++14
0 / 100
188 ms5764 KiB
#include<bits/stdc++.h> using namespace std ; const int maxn = 3e5 + 5 ; int n, mx[maxn], d, v[maxn] ; int main(){ cin >> n >> d ; for(int i = 1 ; i <= n ; i++) cin >> v[i] ; for(int i = 1 ; i <= n + 1 ; i++) mx[i] = max(mx[i-1], v[i-1]) ; int att = 0, ans = 0 ; for(int i = n - 1 ; i > 0 ; i--){ att += (v[i] > mx[i]) ; ans = max(ans, att+1) ; } cout << ans << "\n" ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...