版本比较
【YFOI-A2026】2026 年扬帆愚人节比赛 赛后总结帖 & 题解
正文
增加 268 行删除 8 行
12 行未改动13141516171718192021493 行未改动全部展开515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739701 行未改动全部展开1441144214431444144514461447144814497 行未改动1457145814591460146114621463146414651,459 行未改动全部展开29252926292729282710292929302712293129322933293429352936293729382939294029412942294329442945294629472948300 行未改动全部展开3249325032513252325332543255325632573258369 行未改动全部展开36283629363036313399363236333634363536363637363836393405364036413642364334083644364534103646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367134143672367336743675367612 行未改动## 脑操
idea:很多人。
solution:[chengyifan91](https://www.luogu.com.cn/user/1512824)。solution & checker:[chengyifan91](https://www.luogu.com.cn/user/1512824)。
本题在很久之前就被出出来了,chengyifan91 感觉非常愚人节,就放到比赛里了。
:::info[简述题意]493 行未改动全部展开:::
::::
:::error[checker]```cpp#include "testlib.h"#include<bits/stdc++.h>using namespace std;
int tp, p=5e5+5, cnt, inp, oup, anp, spj;string s;const int N = 1e6 + 10;int in[N], out[N], an[N], a[N], st[N], nxt[N], lst[N];vector<int> g[N];
#define gi(l, r) (rnd()%(int(r)-int(l)+1)+int(l))
void run(int l, int r) { for (int i = l; i <= r; i++) { if (s[i] == '+') ++cnt, ++a[p]; else if (s[i] == '-') ++cnt, --a[p]; else if (s[i] == '<') ++cnt, --p; else if (s[i] == '>') ++cnt, ++p; else if (s[i] == ',') { ++inp; ++cnt; a[p] = in[inp]; if (inp > 1e6) return ; } else if (s[i] == '.') { ++oup; ++cnt; out[oup] = a[p]; if (oup > 1e6) return ; } else if (s[i] == '[') { ++cnt; if (!a[p]) i = nxt[i], --cnt; } else if (s[i] == ']') i = lst[i]-1; if (cnt > 1e7) return ; if (abs(p-500000-5) > 3e5) return ; }}
bool isop(char c) { return c == '+' || c == '-' || c == '<' || c == '>' || c == ',' || c == '.' || c == '[' || c == ']';}
int read(int x) { in[++inp] = x; return x;}
int write(int x) { an[++anp] = x; return x;}
void solve(int id, mt19937 &rnd, int t) { if (id == 1) read((t&1)*gi(4e5, 5e5)), write(!in[inp]); if (id == 2) read(gi(9e4, 1e5)), write(in[inp]), read(gi(9e4, 1e5)), an[anp] += in[inp]; if (id == 3) read(gi(9e4, 1e5)), write(in[inp]), read(gi(5e4, in[inp])), an[anp] -= in[inp]; if (id == 4) read(gi(200, 300)), write(in[inp]), read(gi(200, 300)), an[anp] *= in[inp]; if (id == 5) read(gi(90, 100)), write(in[inp]), read((t<=2)?t:gi(20, 30)), an[anp] /= in[inp]; if (id == 6) read(gi(90, 100)), write(in[inp]), read((t<=2)?t:gi(20, 30)), an[anp] %= in[inp]; if (id == 7) { int n = read(gi(400, 500)), k = gi(400, n); for (int i = 1; i <= n; i++) read(gi(0, 1)*gi(9e8, 1e9)), (i <= k ? write(in[inp]) : 0); read(k); } if (id == 8) { int n = read(gi(200, 300)); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { write(i == j ? read(gi(9e8, 1e9)), 0 : read(gi(9e8, 1e9))); } } } if (id == 9) { int n = 140, mn = 140, mx = 0; read(n); for (int i = 1; i <= n; i++) mn = min(mn, read(gi(1, 140))), mx = max(mx, in[inp]); write(mx); write(mn); } if (id == 10) { int n = read(gi(240, 250)), ans = 0; for (int i = 1; i <= n; i++) if (n % i == 0) ans++; write(ans); } if (id == 11) { int v = gi(40, 50); int n = read(v), k = gi(v-10, n), ans = 0; for (int i = 1; i <= n; i++) ans += (i <= k ? read(gi(v-10, v)) : (read(gi(v-10, v)), 0)); read(k); write(ans-114514); } if (id == 12) { int v = 50; int n = read(gi(v-10, v)), q = read(gi(v-10, v)); for (int i = 1; i <= n; i++) a[i] = read(gi(9e8, 1e9)); while (q--) { int l = read(gi(1, sqrt(n))), r = read(gi(n-sqrt(n), n)); for (int i = l; i <= r; i++) ++a[i]; } for (int i = 1; i <= n; i++) write(a[i]), a[i] = 0; } if (id == 13) { int n = read(gi(200, 300)), ans = 1; for (int i = 1; i <= n; i++) a[i] = read(gi(0, 1)||i==1?gi(1, 300):a[i-1]); for (int i = 1; i < n; i++) ans += (a[i] != a[i+1]); write(ans); for (int i = 1; i <= n; i++) a[i] = 0; } if (id == 14) { int n = read(gi(30, 60)), ans = 0; for (int i = 1; i <= n; i++) a[read(gi(1, 30))]++, ans += (a[in[inp]] == 1); write(ans); for (int i = 1; i <= 30; i++) a[i] = 0; } if (id == 15) { int n = read(gi(50, 60)); for (int i = 1; i <= n; i++) a[i] = read(gi(1, 50)); sort(a+1, a+n+1); for (int i = 1; i <= n; i++) write(a[i]), a[i] = 0; } if (id == 16) { int n = read(gi(90, 100)); for (int i = 1; i <= n; i++) a[read(gi(1, n/2))]++; for (int i = 1; i <= n; i++) { if (!a[i]) { write(i); break; } } for (int i = 0; i <= 100; i++) a[i] = 0; } if (id == 17) { int n = read(70); read(0); for (int i = 2; i <= n; i++) a[i] = read(gi(max(1, i-5), i-1)); int u = read(gi(1, n-1)), v = read(n), tu = u, tv = v; while (u != v) { if (!a[u]) u = tv; else u = a[u]; if (!a[v]) v = tu; else v = a[v]; } write(u); for (int i = 2; i <= n; i++) a[i] = 0; }}
int main(int argc, char* argv[]) { registerTestlibCmd(argc, argv); int t = inf.readInt(); while (!ouf.eof()) s += ouf.readLine(); if (s.size() > 1024) { quitf(_wa, "CE (Changdu Error)"); return 0; } s.erase(remove_if(s.begin(), s.end(), [](char c){return !isop(c);}), s.end()); for (int i = 0; i < (int)s.size(); i++) { if (s[i] == '[') st[++tp] = i; if (s[i] == ']') { if (!tp) { quitf(_wa, "CE (Compile Error)"); return 0; } lst[i] = st[tp]; nxt[st[tp--]] = i; } } if (tp) { quitf(_wa, "CE (Compile Error)"); return 0; } int ce = 0, wa = 0, mxcnt = 0, oknum = 0; for (int id = 1; id <= 5; id++) { mt19937 rnd(((t<<3)^id)+114514-6578+11738-11831+3920-4848+12423+7891-1391-1378); inp = oup = anp = cnt = 0; p = 5e5+5; for (int j = 1; j <= 1e6; j++) in[j] = -1, a[j] = an[j] = out[j] = 0; solve(t, rnd, id); inp = 0; run(0, s.size()-1); mxcnt = max(mxcnt, cnt); if (cnt > 3e6) { if (ce != 1) ce = 4; if (!ce) ce = 1; continue; } if (abs(p-500000-5) > 3e5) { if (ce != 2) ce = 4; if (!ce) ce = 2; continue; } if (oup > 1e6 || inp > 1e6) { if (ce != 3) ce = 4; if (!ce) ce = 3; continue; } if (anp != oup) { wa = 1; continue; } for (int i = 1; i <= anp; i++) { if (an[i] != out[i]) { wa = 1; --oknum; break; } } ++oknum; } if (ce == 1) quitp(oknum*0.2, "CE (Coin Error: %d)", mxcnt); if (ce == 2) quitp(oknum*0.2, "CE (Chaju Error)"); if (ce == 3) quitp(oknum*0.2, "CE (Cishu Error)"); if (ce == 4) quitp(oknum*0.2, "CE (C??? Error)"); if (wa == 1) quitp(oknum*0.2, "WA (Wrong Answer)"); quitf(_ok, "AC (All Cao) Coin: %d Length: %d", mxcnt, (int)s.size()); return 0;}```:::
## 树从树变成了图然后求最大值问题
idea & solution & grader:[chengyifan91](https://www.luogu.com.cn/user/1512824)。
701 行未改动全部展开:::
:::error[checker]
```cpp#include<bits/stdc++.h>#include"testlib.h"using namespace std;
7 行未改动 quitf(_wa, "Wrong Answer!"); } return 0;}```
:::
## 3/27 打卡题1,459 行未改动全部展开## 打音游?愚人节!
idea:[chengyifan91](https://www.luogu.com.cn/user/1512824)。
谁能想到是个缝合怪曲子。笑点解析:样例中了 $2$ 个。
## 【愚人节特供】凭实力得分本题没有测试数据,因为赛时没人猜中。
:::info[简述题意]你需要猜测 phigros 愚人节的原曲。:::
:::warning[题解]方法一:在 4 月 1 日前猜测愚人节的任意一个原曲。
方法二:穿越到 3 月 31 日,使用方法一。:::
## 凭实力得分
idea & solution & game:[chengyifan91](https://www.luogu.com.cn/user/1512824)。
:::info[简述题意]
300 行未改动全部展开idea & solution:[chengyifan91](https://www.luogu.com.cn/user/1512824),[Cybher](https://www.luogu.com.cn/user/557841)。
checker:[chengyifan91](https://www.luogu.com.cn/user/1512824)。
出题人认为本题配套的 M 题不值得讲解,因此跳过了。
:::info[题意简述]
自己去看题。
369 行未改动全部展开::::
## 排行榜
赛后公布。本排行榜是手打的,如果有些地方与你的真实成绩不符,请联系比赛负责人。

## 隐藏奖励说明
+ **速通** 在 $5$ 小时内通过 Cutecatf's Maze。+ **0.0** 用 AI 提交一遍所有题目。+ **影子** 通过【愚人节特供】凭实力得分。+ **一模一样** 通过愚人节。+ **影子** 通过凭实力得分。+ **倒霉透了** 提交一次倒霉透了。该奖励会和题目的 $-10000$ 分抵消,也就是说这题不计入总分。
## 奖励环节## 颁奖环节
赛后公布。恭喜 **\_endl\_** 成为冠军!
恭喜 **songtaoran** 成为亚军!
恭喜 **\_cout\_** 成为季军!
**【常规奖励】**
恭喜 **\_endl\_** 获得 $5$ 元!
恭喜 **\_endl\_**、**songtaoran** 和 **\_cout\_** 获得 $6578\times 3920$ 个棍母!
恭喜 **\_endl\_**、**songtaoran**、**\_cout\_**、**TCY1234567** 和 **wenhaoran11** 获得 $0$ 部手机!
**【特殊奖励】**
恭喜 **\_endl\_** 和 **songtaoran** 获得 **不要白不要** 奖励!
**【隐藏奖励】**
恭喜 **\_endl\_** 和 **songtaoran** 获得 **影子** 奖励!
恭喜 **\_endl\_**、**songtaoran**、**\_cout\_**、**TCY1234567**、**kelvin1122** 和 **HSY666** 获得 **倒霉透了** 奖励!
## 结语
本场比赛其实有很多疏漏(比如被机惨,下发 checker,SPJ 出锅,到最后排行榜分数混乱),在这里向大家道歉。未来,我们 ~~不保证~~ 会继续努力,办出更好的愚人节比赛!小 F 在这里诚挚的感谢大家参加本场愚人节比赛!
未来,我们 ~~不保证~~ 会继续努力,办出更好的愚人节比赛!
祝大家愚人节快乐!