版本比较
神秘输入问题
正文
增加 2 行删除 2 行
13 行未改动1415161718192021224 行未改动27282930313233343533 行未改动13 行未改动len = sqrt(n);cnt = 0;a.clear();memset(pos,0,sizeof(pos));while(1){++ cnt;L[cnt] = (cnt - 1) * len + 1;R[cnt] = cnt * len;4 行未改动}a.resize(cnt + 3);for(int i = 1;i <= cnt;i ++)for(int j = L[i];j <= R[i];j ++)pos[j] = i,a[i].push_back(tp[j]);return;}void update(int l,int x){ //在l前插入xn ++;33 行未改动13 行未改动1415161718192021224 行未改动27282930313233343533 行未改动13 行未改动len = sqrt(n);cnt = 0;a.clear();memset(pos,0,sizeof(pos));while(1){++ cnt;L[cnt] = (cnt - 1) * len + 1;R[cnt] = cnt * len;4 行未改动}a.resize(cnt + 3);for(int i = 1;i <= cnt;i ++)for(int j = L[i];j <= R[i];j ++)pos[j] = i,a[i].push_back(tp[j]);return;}void update(int l,int x){ //在l前插入xn ++;33 行未改动