Submission #3006580
Source Code Expand
include <bits/stdc++.h> using namespace std; #define ll long long int n,ans,h[1000005]; int main(){ cin>>n; for(int i=0;i<n;++i){ cin>>h[i]; } for(int i=0;i<n;++i){ if((i==0||h[i-1]<=h[i]) && (i=n-1||h[i]>=h[i+1])){ int temp=1; for(int j=i-1;0<=j&&h[j]<h[j+1];--j)++temp; for(int j=i+1;j<n &&h[j]<h[j-1];++j)++temp; ans=max(ans,temp); } } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 山のデータ |
User | es135 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 446 Byte |
Status | CE |
Compile Error
./Main.cpp:1:1: error: ‘include’ does not name a type include <bits/stdc++.h> ^ ./Main.cpp: In function ‘int main()’: ./Main.cpp:8:3: error: ‘cin’ was not declared in this scope cin>>n; ^ ./Main.cpp:18:23: error: ‘max’ was not declared in this scope ans=max(ans,temp); ^ ./Main.cpp:21:3: error: ‘cout’ was not declared in this scope cout<<ans<<endl; ^ ./Main.cpp:21:14: error: ‘endl’ was not declared in this scope cout<<ans<<endl; ^