# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
515704 | _Monkey_ | Financial Report (JOI21_financial) | C++17 | 50 ms | 6452 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Song Đồng Gia Phúc
/*
* ʕ•ᴥ•ʔ
* [Penguin_024]
* U U
*/
#include<bits/stdc++.h>
using namespace std;
#define el '\n'
#define ll long long
#define ull unsigned long long
#define vll vector<ll>
#define double double
#define fi first
#define se second
#define cico(A) freopen(A".INP","r",stdin); freopen(A".OUT","w",stdout);
template<typename x,typename y> void amin(x &a,y b){if(b<a) a=b;}
template<typename x,typename y> void amax(x &a,y b){if(b>a) a=b;}
const int maxn=3e5+7,maxq=19*1e4+7;
const string yes="YES\n",no="NO\n";
int n,d,a[maxn];
void sub4(){
vector<int> f;
int ans = 0;
for(int i=n;i>0;--i){
while( !f.empty() && a[i]>=f.back() ) f.pop_back();
f.push_back(a[i]);
amax( ans , f.size() );
}
cout << ans;
}
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);
cin >> n >> d;
for(int i=1;i<=n;++i){
cin >> a[i];
}
// sub 4
if(d==1){
sub4();
return 0;
}
return 0;
}
Compilation message (stderr)
# | 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... |