标签:ati get wro int answer nbsp ted updating div
1. Get_ST :
Accepted:
void Get_ST(int n){ Log[1]=0; for (int i=2;i<=n;i++){ Log[i]=Log[i>>1]+1; ST[i][0]=height[i]; for (int j=1;j<17;j++){ ST[i][j]=ST[i][j-1]; if (i-(1<<(j-1))>0&&ST[i-(1<<(j-1))][j-1]<ST[i][j]) ST[i][j]=ST[i-(1<<(j-1))][j-1]; } } }
Wrong Answer :
void Get_ST(int n){ Log[1]=0; for (int i=2;i<=n;i++){ Log[i]=Log[i>>1]+1; ST[i][0]=height[i]; for (int j=1;j<17;j++){ ST[i][j]=ST[i][j-1]; if (i-(1<<j)>0&&ST[i-(1<<j)][j-1]<ST[i][j]) ST[i][j]=ST[i-(1<<j)][j-1]; } } }
Difference : 1<<(j-1) $\Longrightarrow $ 1<<j
标签:ati get wro int answer nbsp ted updating div
原文地址:https://www.cnblogs.com/zhouzhendong/p/Mistakes.html