零分求助

P1323 删数问题

首先,你得理解 若 $P$ 是集合的元素,则$2\times P+1$,$4\times P+5$ 也是集合的元素。 的意思 ``` q.push(1); p.push(1); for(int i=1;i<=n;i++){ q.push(q.top()*2+1); p.push(p.top()*4+5); } ``` 应改为 ``` q.push(1); p.push(1); for(int i=1;i<=n;i++){ q.push(q.top()*2+1); q.push(q.top()*4+5); p.push(q.top()*2+1); p.push(q.top()*4+5); q.pop(); } ```
by Wu_Ren @ 2020-09-28 21:36:37


|