제출 #5398

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
53982014-04-30 10:00:16gs12117호화 벙커 (IZhO13_burrow)C++98
100 / 100
648 ms5088 KiB
#include<stdio.h>
int n,m,p;
int a[1010][1010];
int b[1010];
int stk[1010];
int sp;
int lend[1010];
int rend[1010];
int f(int x){
int i,j,ans;
for(i=0;i<m;i++){
b[i]=0;
}
ans=0;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
if(a[i][j]>=x){
b[j]++;
}
else b[j]=0;
}
stk[0]=-1;
sp=1;
for(j=0;j<m;j++){
while(sp!=1&&b[stk[sp-1]]>=b[j])sp--;
lend[j]=stk[sp-1];
stk[sp]=j;
sp++;
}
stk[0]=m;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...