版本比较
NOIP 2025 GD 迷惑行为(更新中)
正文
增加 34 行删除 34 行
78 行未改动7980818283838485868743 行未改动13113213313413513513613713832 行未改动17117217317417517617717817975 行未改动25525625725825926025926026126226326410 行未改动2752762772782792792802812822834 行未改动28828929029129229229329429529613 行未改动3103113123133143143153163163173183193193203213223233233243253253263273283298 行未改动33833934034134234234334434534634534634734834935035135235335435435535635735835936036136236336336436536636736736836937037137137237337437537537637737837937938038138238338338438538638738738838939039139139239339439539539639739839939940040140240340340440540640740740840941041141141241341441541541641741841941942042142242342342442542642742742842943043143143243343443543543643743843952 行未改动78 行未改动
std::cin >> n >> m; for(int i = 1;i <= n;i++) std::cin >> val[i].x >> val[i].y, val[i].id = i, chan[i] = val[i];
std::sort(val + 1,val + n + 1); std::sort(chan + 1,chan + n + 1,[&](const value &lhs,const value &rhs) -> bool { return lhs.x < rhs.x; });43 行未改动Luogu AcceptedLuogu TLELuogu MLELuogu Wrong answerLuogu LuoguLuoguLuoguLuogu32 行未改动LuoguLuoguLuoguLuoguLuogufreeopenfreeopenfreeopenfreeopen75 行未改动::::
::::info[自荐书]```The length is a secret The length is a secret
I love CCF very much!Can you help me ac test 6?My answer is smaller than CCF'sI can't believe my code is wrong10 行未改动
::::info[不甘心啊]```OI 生涯要这样子结束了吗……去年明明 AK 了 NOIP,今年怎么连 T2 都不会做 去年明明 AK 了 NOIP,今年怎么连 T2 都不会做怎么会有这么搞笑的人啊去年省选 CE 爆了 100,没进队今年 NOIP 直接炸。咋回事??4 行未改动
100+20+48+40 @ 12:32Farewell, OI.
upd: 想到了 tree 的 O(nm^2) @ 12:40。没写完。GG. upd: 想到了 tree 的 O(nm^2) @ 12:40。没写完。GG.```::::
::::info[寄了]13 行未改动最优策略是啥???有最优策略这种东西吗??
考虑为啥按性价比买不到最大值。如果我们最后两元,先买了一个 1,导致紧接着的一个 2 买不到,然后买了下一个 1,甚至是后面啥都买不到 如果我们最后两元,先买了一个 1,导致紧接着的一个 2 买不到,然后买了下一个 1,甚至是后面啥都买不到那把 2 替换掉这两个 1 可能是更优的。这是唯一的情况吗? 这是唯一的情况吗?只能当它是了。
冷静。 冷静。先特判 m=1。然后枚举倒数第二个买的 1 是什么那么首先要求:它自己刚好是倒数第二个买到的那么它前面所有东西都能买到。也就是让前面的权值和恰好为 m-2。 那么它前面所有东西都能买到。也就是让前面的权值和恰好为 m-2。考虑进一步枚举是哪个 a_i/2 被丢到了它后面。设这俩为 y,x/2(要求 y<=x/2<y) 设这俩为 y,x/2(要求 y<=x/2<y)那还要求值在 [x-y,x] 中间的数,全部都要被操作
那么相当于,最大的一批 a_i 可以操作,操作后会使 y 前的权值和 -1从操作后会到 y 后面到 x 之前这堆数不能操作,否则 x 后面的就不是 y 了8 行未改动即,在 c1,c2 中选若干个,使得选出个数的差恰好为某个值 kc1,k 是定值,c2 每次 -1考虑咋办。考虑范德蒙德卷积状物,计算 c1 选了的位和 c2 没选的位那就是和为某个值 k 那就是和为某个值 k
好像不一定是 m-2考虑最后取到的两个 1 y,z 只要 x 后面出现了任何一个 x>y+z 的 x/2,就倒闭了。 考虑最后取到的两个 1 y,z只要 x 后面出现了任何一个 x>y+z 的 x/2,就倒闭了。所以那个权值和限制不在 y 上,而是在 z 上。但是 y,z 中间的数仍然必须全部操作,所以差别似乎不是很大?不对。限制是,操作完在 z 前面的数,权值和恰好为 m-1
完了。寄了。这咋办呢。 这咋办呢。*/
```::::
::::info[freope爱好者]```/*去年的GD-XXXX,但是炸了 去年的GD-XXXX,但是炸了//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin); //freopen("query1.in","r",stdin);*/
```::::52 行未改动