Submission #563652

#TimeUsernameProblemLanguageResultExecution timeMemory
563652OttoTheDinoFinancial Report (JOI21_financial)C++17
12 / 100
38 ms6444 KiB
// D = 1 #include <bits/stdc++.h> using namespace std; #define rep(i,s,e) for (int i = s; i <= e; ++i) #define rrep(i,s,e) for (int i = s; i >= e; --i) #define pb push_back #define pf push_front #define fi first #define se second #define all(a) a.begin(), a.end() #define len(a) (int)a.size() typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<double> vd; typedef vector<string> vs; typedef vector<ll> vll; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, d; cin >> n >> d; assert(d==1); int a[n+1], ans = 0; vi v; rep (i,1,n) cin >> a[i]; rrep (i,n,1) { while (len(v) && v.back()<=a[i]) v.pop_back(); v.pb(a[i]); ans = max(ans, len(v)); } cout << ans << "\n"; return 0; }
#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...