Submission #18550

# Submission time Handle Problem Language Result Execution time Memory
18550 2016-02-08T15:27:39 Z eaststar Global Warming (NOI13_gw) C++14
0 / 40
301 ms 12796 KB
#include <stdio.h>
#include <algorithm>
using namespace std;
struct data{
    int h,i;
    bool operator<(const data&r)const{
        return h<r.h;
    }
}a[1000010];
int chk[1000010],ans,s=1;
int main(){
    int i,n;
    scanf("%d",&n);
    for(i=1;i<=n;++i)scanf("%d",&a[i].h),a[i].i=i,chk[i]=1;
    sort(a+1,a+n+1);
    for(i=1;i<=n;){
        do{
            chk[a[i].i]=0;
            s+=chk[a[i].i-1]+chk[a[i].i+1]-1;
        }while(a[i].h==a[++i].h);
        if(ans<s)ans=s;
    }
    printf("%d",ans);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 12796 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 19 ms 12796 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 12796 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 288 ms 12796 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 301 ms 12796 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -