版本比较
解题报告 P4690 [Ynoi Easy Round 2016] 镜中的昆虫
正文
增加 6 行删除 6 行
95 行未改动9697989910010010110210310430 行未改动13513613713813913914014114214310 行未改动154155156157158158159160161162195 行未改动全部展开35835936036136236236336436536614 行未改动38138238338438538538638738838914 行未改动4044054064074084084094104114129 行未改动95 行未改动 { if(!q[itl].op) ins(q[itl].l,q[itl].tye); tmp[++ top] = q[itl ++]; } else else { if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].l); tmp[++ top] = q[itr ++]; }30 行未改动 freopen("data.in","r",stdin);freopen("data.out","w",stdout); #endif n = read(); m = read(); for(int i = 1;i <= n;i ++) for(int i = 1;i <= n;i ++) { a[i] = read(); s[a[i]].insert(i); q[++ tot] = {0,i,pre(a[i],i),0,1};10 行未改动 cnt ++; q[++ tot] = {1,r,l,cnt,1}; q[++ tot] = {1,l - 1,l,cnt,-1}; } else else { q[++ tot] = {0,l,pre(a[l],l),0,-1}; q[++ tot] = {0,l,pre(r,l),0,1}; opt = nxt(a[l],l);195 行未改动全部展开 { if(!q[itl].op) ins(q[itl].r,q[itl].tye); tmp[++ top] = q[itl ++]; } else else { if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].r); tmp[++ top] = q[itr ++]; }14 行未改动 freopen("data.in","r",stdin);freopen("data.out","w",stdout); #endif n = read(); m = read(); for(int i = 1;i <= n;i ++) for(int i = 1;i <= n;i ++) { a[i] = read(); if(!mp[a[i]]) mp[a[i]] = ++ tot; a[i] = mp[a[i]];14 行未改动 if(!mp[v]) mp[v] = ++ tot; v = mp[v]; assign(l,r,v,i); } else else { l = read(); r = read(); q[++ cnt] = {1,r,l - 1,i,1};9 行未改动