Submission #643170

#TimeUsernameProblemLanguageResultExecution timeMemory
643170TimDeeClimbers (RMI18_climbers)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define forn(i,n) for (int i=0; i<n; ++i) void solve() { cout<<"NO\n"; return; int n; cin>>n; vector<int> a(n); forn(i,n) cin>>a[i]; int ans=0; vector<int> v={0}; for (int i=1; i<n; ++i) { if (a[i]>=v.back()) { for (int j=v.back()+1;j<=a[i];++j) v.push_back(j); } else { for (int j=v.back()-1;j>=a[i];--j) v.push_back(j); } } int l=0, r=v.size()-1; while (v[l+1]==v[r-1]) ++l, --r; cout<<ans; } int32_t main() { solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...