BJ CSP-S 2025 迷惑行为大赏(上半)

· · 休闲·娱乐

前言

CSP 2025 结束了。作为一个北京人,我很希望能看到 BJ 地区的迷惑行为大赏。但令人悲伤的是,似乎北京朋友们对这种类型的文章并不感兴趣。20 天过去了,并没有人撰写这样的文章。对此我表示强烈的悲痛。

我这段时间有太多太多的事情要做。所以最终甚至要到新年甚至还要分成上下两个部分。对此我表示痛心疾首,来年一定第一时间开始写文章。

下半部分。

本文使用 Microsoft Visual Studio 进行关键字查找等内容。

另外,感谢我的同学给我提供的帮助。

统计数据

以下查找均不考虑大小写。

考号 UID
30 1511926
250 533708
1208 890943作者本人。
1560 977777
1710 823830
1724 1015780
1830 1302857
1991 857437

以上就是 BJ 地区的统计数据。如果你有什么实在很好奇的统计,也可以私信我让我统计。但是,干巴巴的一些数字肯定还是不如代码有用的。那么,让我们走进代码。

前置知识

BJ 的代码提交使用一个叫作“程序回收系统”的玩意。大概就是,把四道题的源代码复制粘贴到系统上的四个指定位置,然后就好了。
对,你不需要操心选手目录,文件名这种东西,你只需要操心一下 freopen 写对了没有。

选手代码

本文仅展示了前 1000 人的抽象代码。后 1012 人将放在下半部分。

骗分事故

空文件夹

很显然,这些同学考虑到了评测机的辛苦,决定不再编写代码,以给疲惫的评测机一点休息的时间。

另有 BJ-S00432 同学,在文件夹里放置了四个代码,但是四个代码加起来总共只有 0 字节的代码长度。

神人模数

下表是对应位置对应的选手。

S01128 S01016 S00029 S00074
S01414 S00990 S01816 S00230
S00860
#### 大量打表 这些人为了在最后一题得分拼尽了全力。 ![](https://cdn.luogu.com.cn/upload/image_hosting/t38odpxd.png) #### BJ-S00077 编译器:你看见代码了吗?在哪里? ![](https://cdn.luogu.com.cn/upload/image_hosting/kms2cs5z.png) #### BJ-S00093 编译器:你看见代码了吗?在哪里? 代码:你看见输入文件了吗?在哪里? 评测机:你看见输出文件了吗?在哪里? ![](https://cdn.luogu.com.cn/upload/image_hosting/akyf2eqh.png) #### BJ-S00196 试图让 `void` 关键字变成函数为他所用。 ```cpp #include<bits/stdc++.h> using namespace std; int n,m,k; int u[100010],v[100010],w[100010]; int c[100010],a[100010][100010]; void(){ if(n=4&&m=4&&k=4){ cout<<13; } } 后略 ``` #### BJ-S00201 T1 T2 都没取消注释 `freopen`,而 T4 中道崩殂写个 `usong` 上去。 编译器:这个人好像要写点东西。不明白。 ![](https://cdn.luogu.com.cn/upload/image_hosting/dq5sgjro.png) #### BJ-S00258 反方向的输出流。 ```cpp T4: #include<bits/stdc++.h> using namespace std; int main(){ freopen("employ.in","r",stdin); freopen("employ.out","w",stdout); cout>>2; return 0; } ``` #### BJ-S00261 这里地方太小了,我写不下。 ```cpp T2: #include<bits/stdc++.h> using namespace std; int main(){ freopen("road.in","r",stdin); freopen("road.out","w",stdout); cout<<"...................."; fclose(stdin); fclose(stdout); return 0; } ``` #### BJ-S00339 这是 T2 的代码。对吧,那为什么会出现两个 T4 的 `freopen`。 ```cpp T2: freopen("employ3.in","r",stdin); freopen("employ.out","w",stdout); ``` #### BJ-S00349 写了半天的代码全注释掉了。主要是,你干嘛还要注释 `int main`。喜提 CE。 ```cpp T2: ... } int main(){*/ freopen("road.in","r",stdin); freopen("road.out","w",stdout); cout<<0<<endl; fclose(stdin); fclose(stdout); /* cin>>n>>m>>k; ... ``` #### BJ-S00371 你的 `freopen` 知道它们应当出现在哪里吗。 ```cpp T2: int main(){ freopen("club1.in","r",stdin); freopen("employ.out","w",stdout); cout<<'13'<<endl; return 0; } T3: int main(){ freopen("club1.in","r",stdin); freopen("employ.out","w",stdout); cin>>n>>q; for(int i = 1;i<=n;i++)cout<<'0'<<endl; return 0; } ``` #### BJ-S00416 很显然,这位同学并不知道斜杠应当朝向哪个方向。 ```cpp T1: cout << 0 << "/n"; ``` #### BJ-S00419 这个人四道题只有 T3 的代码不是空的,而 T3 还在写这种清空人类智商的代码。 ```cpp T3: #induce<bits/std c++.h; using name space std; int main(){ cout<< 2<<endl cout<< 0<<endl return 0} ``` #### BJ-S00495 很奇妙的骗分方式。 不过,请相信我,这只是冰山一角。 ```cpp T2: if(n==4&&m==4&&k==2&&u[1]==1&&u[2]==2&&u[3]==4&&u[4]==4&&v[1]==4&&v[2]==3&&v[3]==2&&v[4]==3&&w[1]==6&&w[2]==7&&w[3]==5&&w[4]==4&&c[1]==1&&c[2]==100&&a[1][1]==1&&a[1][2]==8&&a[1][3]==2&&a[1][4]==4&&a[2][1]==1&&a[2][2]==3&&a[2][3]==2&&a[2][4]==4){ cout<<13; } T3: if(n==4&&q==2&&s1[1]=="xabcx"&&s1[2]=="ab"&&s1[3]=="bc"&&s1[4]=="aa"&&s2[1]=="xadex"&&s2[2]=="cd"&&s2[3]=="de"&&s2[4]=="bb"&&t1[1]=="xabcx"&&t2[1]=="xadex"&&t1[2]=="aaaa"&&t2[2]=="bbbb"){ cout<<2<<endl<<0; } ``` #### BJ-S00502 以下是他四道题的代码。他四道题同一份代码。 ```cpp T1,T2,T3,T4: #include<bits/stdc++.h> using namespace std; int main(){ renturn 0; } ``` #### BJ-S00564 某种骗分之前开展的神秘仪式。 ```cpp T4: #include<iostream> using namespace std; int main(){ freopen("employ.in","r",stdin); freopen("employ.out","w",stdout); char a; while(cin>>a){ a++; } cout<<"0"<<endl; return 0; } ``` #### BJ-S00602 不知道什么缘故把 T2 的代码原封不动复制在了 T3。 #### BJ-S00662 ```cpp T2: int a;cin>>a cout<<114514; ``` #### BJ-S00675 输入输输输输到厌倦。 if(x==4) { cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cout<<2<<endl<<0; } else { cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cin>>s; cout<<0<<endl<<0<<endl<<0<<endl<<0; } #### BJ-S00693 很奇怪。 `incluade`。`freopne`。`enpoly`。Python 大神拿单引号存字符串。数组大小生怕自己炸不了。 ```cpp T3: #incluade <bits/stdc++.h> using namespace std; int main(){ freopen("replace.in","r",stdin); freopne("replace.in","w",stdout); cout<<2<<endl<<0; } T4: #include <bits/stdc++.h> using namespace std; struct t{ bool flag; int a; }; string s; int b[1145141919]; t a[1145141919]; int main(){ freopen("enpoly.in","w",stdin); freopen("enpoly.out","w",stdout); int n,m; cin>>n>>m; cin>>s; for(int i=1;i<=n;i++){ cin>>a[i].a; a[i].flag = 0; b[i] = s[i]-48; } if(s=='101') cout<<2; if(s=='1101111011') cout<<2204128; if(s=='11111(中略)11111') cout<<161088479; if(s=='00011(中略)00000') cout<<225301405; return 0; } ``` #### BJ-S00700 T3T4,改了个 `freopen` 就把 T2 供上去了。 #### BJ-S00703 除了 T3 都在搞不定长数组。 T3 骗分,但是搞了个最美逆行者。 ```cpp T1,T2,T4: int n,ans=0,k0[n]={0},k1[n]={0},k2[n]={0}; T3: cout<<0<<endl>>0<<endl<<0<<endl<<0; ``` #### BJ-S00755 史诗级抗抑郁,能看懂者受上赏,看了不笑受中赏,本人来了受下赏。 ![](https://cdn.luogu.com.cn/upload/image_hosting/5z9j3yae.png) #### BJ-S00760 很神秘,似乎想要表达什么。 `int n,m,k,t,f[10015],c[15],b[33][6]={{0,0,0,0,0,0},{0,1,0,0,0,0},{0,0,1,0,0,0},{0,1,1,0,0,0},{0,0,0,1,0,0},{0,1,0,1,0,0},{0,0,1,1,0,0},{0,1,1,1,0,0},{0,0,0,0,1,0},{0,1,0,0,1,0},{0,0,1,0,1,0},{0,1,1,0,1,0},{0,0,0,1,1,0},{0,1,0,1,1,0},{0,0,1,1,1,0},{0,1,1,1,1,0},{0,0,0,0,0,1},{0,1,0,0,0,1},{0,0,1,0,0,1},{0,1,1,0,0,1},{0,0,0,1,0,1},{0,1,0,1,0,1},{0,0,1,1,0,1},{0,1,1,1,0,1},{0,0,0,0,1,1},{0,1,0,0,1,1},{0,0,1,0,1,1},{0,1,1,0,1,1},{0,0,0,1,1,1},{0,1,0,1,1,1},{0,0,1,1,1,1},{0,1,1,1,1,1}};` #### BJ-S00770 他几乎每道题都是这么写的。 开头 $9$ 行就震惊我三次。 ```cpp #include<bits/stdc++.h> using namespace std; int n; int sum; int new; char a[][]; int max; int main( ){ cin>>n; ``` #### BJ-S00903 哥们你这个快读就是一点没用呗。 ```cpp T1,T4: inline int read(){ int f=1,res=0; char ch=getchar_unlocked(); while(ch<'0' || ch>'9'){ if(ch=='-')f=-1; ch=getchar_unlocked(); } while(ch>='0' && ch<='9'){ res=(res<<3)+(res<<1)+(ch^48); ch=getchar_unlocked(); } return f*res; } ... cin>>t; bool flg; while(t--){ memset(cnt,0,sizeof(cnt)); cin>>n; ``` --- ### 游记选手 我对这些内容不做任何评价,因为我只拿了 $141$ 分。 #### BJ-S00016 ```cpp T4: /* T1 先贪心后反悔,暴力反悔直到合法 T2 先跑 kruskal 找出一颗最小生成树,不管选什么新点,都不会用除了这个生成树以外的原边,可以证,之后暴力枚举新点集合?分治归并排序优化边的排序,O(n * k * 2^k * log(k) * 阿尔法(n))。好像唐了。可以先排好全部 n*k+n-1 条边,每次枚举集合之后扫一遍全部边,O(n * k * 2^k * 阿尔法(n)),n=10010 阿尔法(n)<=5 T3 最先最先把 s[i][1]=s[i][2] 的刨去,先对于每一对查询串找出替换位置,包含这个位置的替换才是可以的,双串匹配,字符集大小平方一下?空间和时间都会爆炸。出题人显然想要一个 O(n*log(n)) 或 O(n*sigma) 及以下的做法,但是感觉双串匹配的转化方向是对的。观察到空间 2GB 是否从空间开刀?空间大就是可以 ACAM?(后来这个双串匹配被毙掉了) 先哈希?对于每一对 s 去掉相同的头尾,t 同理,把剩下的东西哈希一下,赌不会冲突,t 需要找和自己哈希值一样的 s。同一种哈希值建立前缀倒序和后缀正序的字典树?没法同时查吧? 似乎是可以的,在其中一颗字典树上找到前缀字典树的 dfn 区间,后缀字典树做一个字典树套平衡树(还好当天上午背了 pbds)在后面的对应节点找元素数量。时间复杂度 O(n*log(n)),空间复杂度 O(n*sigma+n*pbds)。非常奇怪解法。(分析复杂度的 n=\sum L) 上一段似乎想假了,要找的是两个字典树上的链上的节点交集大小,不是子树。做不了。 难道是双串匹配?但是这个哈希不同段的东西看起来很有用? 把询问建前后反正字典数,拿着串在上面标记,然后作一下到根的和!!!正难则反!!! 每一个后缀正字典树的节点挂一个按子树内串在前缀反字典树内的节点 dfn 排序的集合,每次是对这个集合的一个段的加,差分打个标记,用 vector 维护这个集合。 LCWZH 想了半小时 T1 T2;T1 写了十分钟,没调过了大样例;又想了一会 T2,感觉优化得差不多了,写了,没调过了大样例,算算时间差不多卡线,直到这里已经过了 70min 了;开始想 T3,感觉很奇怪的题啊,想了很多方法总是被卡;想了半个小时胡出一个屎山,感觉挺好,开写;20min 后突然发现想假了;然后 10min 后发现把逻辑反过来就是对的不需要 pbds;还是不对;似乎对了;16:43 开写,17:11 写完了,开调;17:32 调完了,小样例过来之后大样例一遍过,有点玄,希望没事,7KB;开始 T4,每时间做了,看看有多少暴力可以骗,状压是好写的,可是 20pts 太少,m=n 是送的,n=500 很奇怪;花了一点点时间,写了 n=m 和 n<=18。 */ ``` #### BJ-S00022 ```cpp T4: /* 赛时状态: - 14:37 看 T1 - 最优化问题 - 我们先假设每个人都去最喜欢的社团,然后最多一个不满足要求的社团,我们从里面踢人就好。 - 14:50 提交 T1,开了 long long - T2 是 MST 类问题,有 n 个点 m 条边的带权无向图,然后 k 个独立的虚点,每个虚点可以向任意原来的 n 个点连边,这样的 MST - 用 DFS 加入边枚举应该可以做到 2^{10}n - 14:14 提交 T2,大样例跑得飞快,但是不确定是不是极端数据,之后有时间对拍。 - T3 是字符串问题,给定一些字符串二元组,多次查询给出两个长度相同的字符串 s,t 求有多少 [l,r] 满足 s,t 在 [l,r] 外的地方一样,且 s[l,r],t[l,r] 是一个给出的二元组。 - 题目保证给出的询问是两个不同的字符串,所以至少有一个不同的位置,那么 [l,r] 必须包含所有不一样的位置 - 考虑字符串哈希 - 15:37 打算现看看 T4 - 可能类似杨表计数? - 其实是每个人有一个固定的前缀。 - 不是它这个描述有歧义吧,万一放弃面试的人的题目是简单题呢?到底算不算过? - 哦哦哦我觉得应该是不算过的。 - 哦噢知道了,这个题目的难点在于前面放弃的也会影响后面的人。 - 懂了,现在还有不到 3h 我觉得应该现把 T3 做了然后拿 T4 暴力,最后全力冲刺 T4 - T3 考虑一次询问怎么做? - 5e6 1s 应该不能搞根号的东西了,但是这道题有 2G - 线性的东西考虑 KMP 和字符串哈希。 - 不能每次枚举 s,所以把 s1 丢到 trie 上看看 - 每次沿着 t 走 trie,能匹配的 s 是所有的 fail tree 祖先链的点。 - 然后我需要查询这些点是否有换成对应长度的 t2? - 我们建两个 trie - 我们可以把 s1 s2 放到一个 trie 里面,然后同时走 t1t2,那么走到 [l,r] 的有端点时,就是从这个位置网上 s1 在到 s2 就是 t2 - 怎么这么难,怎么快速找树上一个点祖先能崩到另一个点的祖先。 - 一个替换可能有多次贡献吗?不可能 - 反过来吗?对询问 t 放到 trie 上 - 感觉 trie 好难看清楚,现考虑特殊性质 - 只有 a 和 b 且 b 恰好一个。 - 16:13 考虑枚举 l - 找到最小的不同区间 [l,r] 你发现 l,r 是 s1s2 的子串 - 推出 s1s2 的最小不一样区间也是 [l,r] - 所以应该是一个简单的字符串哈希 - 我们根据最小不一样区间 将 s1s2 和 t1t2 分组,每组的所有 s1s2t1t2 的最小不一样区间相同,变成一个子串问题 - 我们把这个不一样的位置换乘为出现的字符就好 - 这是沙阿 - 双重子串问题,我们可以让字符串交叉,这样就是普通子串问题了。 - 还有两个小时了,最后一题还不会,所以尽量在 1h 内拿下 T3 - 用字符串哈希处理寻找,然后用 trie 计算子串数量 - 怎么写着感觉不对啊,这个 26 *node 真的能在 1s 跑完吗? - 都固定子串的一个位置了,那么肯定有更快的办法 - 哦哦哦我们可以枚举左边对右边作字符串哈希。 - 这样是 O(n) 的 - 16:59 决定放弃 T4,先写 T4 部分分然后搞 T3 - 17:11 T4 提交 20 分,开始冲 T3 - 17:26 写完了 T3 - 17:41 T3 通过所有下发数据,提交 - 17:43 打算搞 T4,然后留 一些时间写 T3 对拍 - T4 n<=500 看起来是 DP - 考虑特殊性质 A - 那么只需要看 - 18:11 T4 对拍 400 组,正确性应该没问题 - 只有 ab 的极端数据时间在 0.4s 左右 */ ``` #### BJ-S00030 ```cpp T4: //现在是2025年11月1日下午17:57,距离s组考试结束还剩半小时左右。时间不多了,觉得代码调不出来了,又发现考试机有中文输入法,于是索性开始写游记。 //这是我第二次参加csp,第一次考s。去年第一次打只考了j,以200pt喜提二等。这个分对当时的我来说其实不错了,至于分数分布,不用多说,自然是T1T2AC,T3T4爆零。 //去年考的时候,我其实连j组的东西都没学完,甚至dp都没学。所以考出这个分使我信心大增,决定今年冲s2一等。 //但不巧,正值初三,中考临近,考试学科的学习压力巨大,练信息学的时间并不算充裕,甚至可以说紧张。于是考试前一天,说实话,我真的慌爆了。 //前一天晚上10点上床睡觉,打算养精蓄锐,但因为紧张硬生生在床上躺了1h多没睡着,睡着的时候大概11点半了,根本没起到养精蓄锐的效果。 //今天早上起床特别困,比预定的要晚起了将近15min,好在时间预留的多,也是在正常时间到了考点。那时候大概是8:06。 //上午j组发挥还算不错,T1T2还算简单,应该能AC,后面T3T4就纯骗分了。T2调了一个多小时没调出来,修了一堆小bug,结果输出越来越离谱,最后发现是取模打成按位与了。 //中午简单吃了顿饭,大致过了一遍s组考纲,然后进了考场。刚进考场就想了起来,考j的时候忘了并决定中午查的linux对拍方法,我居然忘了查。这意味着s组也没法用对拍了。 //拿到题先花了半小时审完了四道题,然后第一时间放弃了T4。我永远忘不了那个让我从晚上22:00修bug修到凌晨1:30的T4。 //然后准备开始写。然后就把算法模板忘了。然后就浪费了1h用来抓耳挠腮地回忆模板细节,还试着调了一段已经被我删完的,长达80行的,无论输入什么都输出INT_MIN的抽象T1错误代码。 //意识到这玩意调不出AC的我果断地开始骗分。T1写了一堆特判,把数据范围里我能想到的特判都写了一遍。本来打算用dp,后来写了一段才发现似乎不行。我不希望标程出来以后发现就是dp然后给我回旋镖。 //后面又抓耳挠腮地想了半天的T2,从dijkstra到floyd,再到bfs,最后再到暴力,所有方法都没调出来,并且输出错的很离谱,于是还是选择投入了骗分的怀抱。 //考试马上要结束了,我终于悟透了,我离我梦想中的S2一等还有很长一段距离。这次考完以后,我决定先把oi放一段时间,专心准备中考,然后再回来挑战oi。祝我中考顺利。 //所以不能说一定,但这也有可能成为我短暂的oi生涯中的最后一次csp。也许代码公布以后,我能在洛谷文章区的迷惑行为大赏里面看到这篇游记。 //即便oi失利,位居年排17的我也有信心在中考上一览众山小。长风破浪会有时,直挂云帆济沧海。ccf,我们来日方长。择日再会吧。 //趣事:这篇游记写在T4,见上文,这题我一开始就没打算做,于是选择输出随机数骗分(虽然极大概率骗不到)。但当我真的准备写随机数时,又把随机数的写法忘了,只能凭依稀的记忆和小茶壶的自动补全瞎写。 //Written by BJ-S00030 Luogu: RLgE ``` #### BJ-S00250 顺便一提,这个人是我们机房的大佬。 ```cpp T4: /* TC DDG DN VVG AV XXD WG DDE author:uid=533708 from luogu.com.cn you can find another article in the end of T4 of CSP-J RCF Experimental School(rdfzcygj.cn) is a con artist there is no teacher to teach C++ but they said that there will be someone to teach so if you want to continue your C++ career, please not to come i hate them now i'm grade 9 so i can continue my studying in Beijing No.12 high school but i don't know what to do about my learning on C++ next year i'm afraid that this might be the last time to join in CSP for me but actually, these questions are too difficult for me,and T1 took me about 2 hours this program still can not accept the 3rd big data due to segment error i tried my best, but still can't reach 175 which is the score line of NOIP last year what a pity! i don't want to say goodbye to CSP but i have to face the fact (there is 9 minutes left (there is 8 minutes left (there is 7 minutes left (there is 6 minutes left (there is 5 minutes left (there is 4 minutes left (there is 3 minutes left (there is 2 minutes left (there is 1 minutes left --- I'm sorry that there might be several grammar mistakes. if you find them, please let me know and i will try to improve my English skills as possible as i can. 4 4 2 1 4 6 2 3 7 4 2 5 4 3 4 1 1 8 2 4 100 1 3 2 4 'kiss the rain':mi so ti ti do do, so ti do ti re re, mi fa so so do do, ti ti-do ti so la, la so mi mi fa fa, mi re re mi mi, la ti ti do re re, mi re do */ ``` #### BJ-S00402 拥有一台卡顿的电脑是致命的。 ```cpp T2: /* 电脑卡成啥了,我真服了。 挑战猜测终端命令位置。 */ T4: /* 考试差不多该结束了,写点有的没的。 写的很爽啊!感觉区分度比入门组高不少。你这不是会出题吗.jpg t1是简单的贪心,t2也比较套路,但是有点卡常,希望不要爆零。 t3的话我的做法极其依赖数据强度,属于是比较费力,但是大样例跑得飞快。 今天最大的失策是以为t1是dp,在暴力上还卡了挺久。 上限得分100+100+100+8,下限0+0+0+0(对拍0个题,不过全都通过了大样例),比较有敌,期望154。 求数据把我水进WC线吧/ll 最后一年我真的不要爆零。 有点好奇 dyx 写的咋样,看他一直没上厕所,不符合刻板印象啊。 还很好奇 sdhj,好像哥们就自己一个人在4号楼考试,比较惨。 */ ``` 另外,这位朋友拿了 $2^{2^3}$ 分。 #### BJ-S00488 ```cpp T4: /* 15.13写完T1 15.53想出T2 48分做法 先二进制枚举k个乡村是否改造,再O(n^2)最小生成树 16.49写完T2 48分做法,过大样例,想T3 T4暴力 16.52开写T3哈希暴力O(nL),25pts 17.14写完T3 25哈希暴力,上个厕所休息一下 17.20想出T4 n!暴力DFS剪枝,8pts,我在想是写这8分的DFS还是回去测试T1-T3? 17.21我决定写T4 8分代码 17.49写完T4暴力,发现T4的特殊性质一个不会做,我决定能得8分是8分 外面的钟在17.59.48就响了 (: */ ``` #### BJ-S00549 还有群猫娘环节。 ```cpp T1: /* 键盘好难用啊喵。 第一题看起来很像 DP 呢喵。 先冲 55 分喵。 设 dp[i][j][k] 表示三个部门分别有 i, j, k 人的满意度之和的最大值。 显然有: dp[i][j][k] = max( dp[i - 1][j][k] + a[i][1], dp[i][j - 1][k] + a[i][2], dp[i][j][k - 1] + a[i][3] ) 看起来很对啊喵。 30min 搞定喵。 接下来冲特殊性质喵。 先搞 A 喵。 显然贪心地让一半的人选部门一,剩下的喝西北风。 5min 搞定喵,60 分到手。 性质 B 就复杂起来了喵。 肯定是一半选一、一半选二。 但是怎么选呢喵。肯定不能是贪心了,见样例一的第三个测试数据。 有点复杂喵,先做性质 C。 因为纯随机,所以如果贪心选,部门人数的期望最大值应该是 n/3,似乎没有问题喵。 10min 搞定喵,70 分到手。 只剩 2h 了,看看别的题喵。 */ T2: /* 蒸不动了喵。 只拿 8 分喵。 70 + 64 + 0 + 8 = 142 分,1= 无望了。 可能是因为我是 ** 吧。 */ T3: /* 这道题很像最小生成树喵。 但是麻烦的点在于,如果有多条路连接乡镇,那么改造费用只会算一次喵。 打部分分。 注意到 k 很小喵。 那就先 2^k 枚举改造的乡镇喵。 再 Kruskal 求最小生成树喵。 对于 k <= 5 的数据好像可以喵! 预期能拿 64 分喵。 Amazing! 调了 1h 居然做出来了喵。 现在已经拿了 134 分了喵。 但愿不会挂分喵。 我寻思着我要不要打特殊性质 A。 算了吧喵。才多拿 8 分。 我又打 itn 了,都怪[作者注:似乎是真实人名,已编辑]喵。 */ ``` 另外,这个人实际上拿了 $150$ 分,一等稳稳的。 #### BJ-S00675 ```cpp /* mingnianjiubulaile zhyinggaizuihouyicixinjingel szudediyitishuidiao zuihouyicixinjing jinianyixia haiyoubudaoyigexiaoshi haohaoxianghsouba woxiwangfangqizhetiaolu huiguikeben nengzuozaizhelijiumeiyoushenmeyihanle haohaotiyanyixiajianpanqiaojisheng jinian */ ``` 皇家翻译官:(绿色代表原文拼音有误,红色代表解码不出来。) $$ \color{black}\text{明年就不来了}\\ \text{\color{green}这\color{black}应该最后一次信竞\color{green}了}\\ \text{S组的第一题水掉}\\ \text{最后一次信竞}\\ \text{纪念一下}\\ \text{还有不到一个小时}\\ \text{好好享\color{green}受\color{black}吧}\\ \text{我希望放弃这条路}\\ \text{回归课本}\\ \text{能坐在这里就没有什么遗憾了}\\ \text{好好体验一下键盘敲击声}\\ \text{纪念}\\ $$ #### BJ-S00704 这位朋友搞了个 Linux 炸弹。一旦取消注释,威力无穷,同时影响自己未来 $1095$ 天的生路。 ```cpp T3: // system("grep VmPeak /proc/$PPID/status"); return 0; } /* What can I say? Maybe, this is my last CSP. As a loser of OI, My grades always bad. Including test in our school and csp My first csp lasted on 23' Actually, I tried csp on 22', but I didn't pass the first test that time. Also, in csp-j2023, I couldn't even pass "the little apple", and I got 10, only 10. Then, I learned and worked not so hard. On 24', I got the 1st prize of csp-j, but csp-j2024 is the "waterest" test around these years. And then, I still work not so hard. But in this summer vacation, I realized the pleasure of learning OI. Then, I worked so hard. But it's too late...... Today, I only got about 164, what a bad grade. Wish I can visit NOIp, It's my dream. I hope my OI's tour can have a good ending. Hope somebody can look this and decrease score line. Thx.=) a "vegetable chicken" from a middle school,25.11.1,18:17 */ ``` #### BJ-S00705 ```cpp //吾日三省吾身:freopen删注释了喵?大样例测了喵?暴力打了喵? //please open use UTF-8喵 signed main(){ freopen("road.in","r",stdin); freopen("road.out","w",stdout); //AFO-2025.11.1喵 /*打得超级差,T1没写出来只打了暴力喵 T4暴力没写出来喵 T23都不会打暴力喵 …… 喵喵喵 考试前50分钟真的好害怕 哪道题都不会,以前做过类似的题,可是我全忘了 我恨自己没有复习OI 我恨自己一直在卷whk可还是没进小灶班 要是能一直在家里睡觉就好了 好想回家 18:04 by _xdd_(洛谷) */ ``` #### BJ-S00718 ```cpp /* 一转眼就上高三了,这是我最后一次坐在 csp 考场上了吧。 这段时间都没怎么碰 oi 了,反正 csp 的分数对我也没什么用处了,我坐在这里仅仅是为了能去打 noip 而已。 考场上有个逆天小登一直吵……好烦人…… 为啥我还要打 noip 呢?大概是之前觉得对申请 hku 有帮助吧。 为啥我当初想要申 hku 呢?因为我喜欢过去了那里的一个学姐…… 她已经是别人的女朋友了。(原因还是吴孟 w6 要发女朋友这种开玩笑一样的事) 所以说,我为什么还要在这里? 可能是所谓的热爱吧。 时间已所剩无几,没时间把心中的感触都讲完了。 祝你天天开心,陌生人。 也祝他们幸福。 CC__DIAMOND */ ``` #### BJ-S00731 ```cpp T2: //这可能是我最后一次站在信奥赛赛场上了,高中学习压力和课业负担挺重 //我也没有不上文化课,拼命学OI的勇气 //学4年OI打3年CSP,成绩不算很好。J已得过1=但S并没有,最后一次 //只报名了S,想要拿个1=圆梦,但太久没练习生疏了 //先祈祷freopen没问题,然后T1能AC,T3T4特例能骗点,估计1=没戏,求个2=罢 //CSP马上就要结束,我在此写下这段话希望有人能看见? //I LOVE OI ``` --- ### 决斗评测机 #### BJ-S00195 登神长阶。 ![](https://cdn.luogu.com.cn/upload/image_hosting/n3rzf2v0.png) #### BJ-S00234 另一个方向上的登神长阶。 ![](https://cdn.luogu.com.cn/upload/image_hosting/5dx446js.png) #### BJ-S00300 登神短阶。 ![](https://cdn.luogu.com.cn/upload/image_hosting/nq7hgmph.png) #### BJ-S00373 $7$ 维 dfs。很诡异。 ```cpp void d(int a,int b,int c,int x,int an,int bn,int cn){ if(x>n){ans=max(ans,a+b+c);return;} if(an<n/2)d(a+a1[x],b,c,x+1,an+1,bn,cn); if(bn<n/2)d(a,b+b1[x],c,x+1,an,bn+1,cn); if(cn<n/2)d(a,b,c+c1[x],x+1,an,bn,cn+1); } ``` #### BJ-S00438 这下又来了个 $7$ 维 bfs。 ```cpp void bfs(int ren,int s1,int s1r,int s2,int s2r,int s3,int s3r){ if(s1r<=n/2&&s2r<=n/2&&s3r<=n/2){ if(ren<n){ bfs(ren+1,s1+a[ren+1][1],s1r+1,s2,s2r,s3,s3r); bfs(ren+1,s1,s1r,s2+a[ren+1][2],s2r+1,s3,s3r); bfs(ren+1,s1,s1r,s2,s2r,s3+a[ren+1][3],s3r+1); } else ans=max(ans,s1+s2+s3); } } ``` #### BJ-S00569 $6$ 个 cmp。这个数量并不算很多,和一会我们将见证的那位相比。 ```cpp bool cmpa(Node a,Node b){ return a.s-a.a>b.s-b.a; } bool cmpb(Node a,Node b){ return a.s-a.b>b.s-b.b; } bool cmpc(Node a,Node b){ return a.s-a.c>b.s-b.c; } bool cmpa1(Node a,Node b){ return a.a>b.a; } bool cmpb1(Node a,Node b){ return a.b>b.b; } bool cmpc1(Node a,Node b){ return a.c>b.c; } ``` #### BJ-S00585 开了 $2\times10^8$ 个 `int` 生怕 MLE 不了。 究其原因是因为他拿邻接矩阵存图。 ```cpp T2: #include <bits/stdc++.h> using namespace std; int G1[10009][10009]; int G2[10009][10009]; 后略 ``` #### BJ-S00665 这个 `dfs` 的嵌套深度真的不会原地爆炸吗? ![](https://cdn.luogu.com.cn/upload/image_hosting/geup2p3z.png) #### BJ-S00777 定义这么大的数组本身不是啥问题。问题出在定义这俩数组是在函数里定义的。 ```cpp T2: int main(){ freopen("road.in","r",stdin); freopen("road.out","w",stdout); int n,m,k; cin>>n>>m>>k; int w[10000000],w1[10000000]; ``` #### BJ-S00795 你定义这么大的数组那放哪都没用了。 ```cpp T1: int v[500000000]; ``` #### BJ-S00856 十层循环。 ```cpp for(int i=1;i<=3;i++){ for(int j=1;j<=3;j++){ for(int k=1;k<=3;k++){ for(int l=1;l<=3;l++){ for(int m=1;m<=3;m++){ for(int o=1;o<=3;o++){ for(int p=1;p<=3;p++){ for(int q=1;q<=3;q++){ for(int r=1;r<=3;r++){ for(int s=1;s<=3;s++){ ``` #### BJ-S00866 $666$ 满天飞的代码。 ![](https://cdn.luogu.com.cn/upload/image_hosting/3oazo9sw.png) #### BJ-S00937 虽然咱们知道 $3^{10}$ 对评测机来说绰绰有余,但是这个代码还是太抽象了。 ![](https://cdn.luogu.com.cn/upload/image_hosting/az87mxfd.png) --- ### 错字受 #### BJ-S00012 面。神秘freopen。 ```cpp T4: #include<bits/stdc++.h> using name space std; int m,n,b[505],sum,k,ans; string a; int mian() { freopen("employ.in","r",open) freopen("employ.out","w",out); cin>>n>>m; 后略 ``` #### BJ-S00105 看得出来朋友很喜欢条件,因此在代码里也充分表现了对条件的喜爱。 ```cpp T1: freopen("clue.in", "r", stdin); freopen("clue.in", "w", stdout); ``` #### BJ-S00236 头文件乱搞,还定义了一个内容完全为棍母的函数。 而且还不写 `freopen`。 ```cpp T1: #include<bitts/stdc++.h> using namespace std; void froudMaxNum(int a[]){ } int main(){ int t,ans=0,group[5]; cin>>t; 后略 ``` #### BJ-S00302 bro 把 `pair` 拼错了。\[骷髅\]\[骷髅\] ```cpp T3: piar<string> a,b; ``` #### BJ-S00637 哥们把 $\texttt{brute}$ 拼成 $\texttt{burte}$ 了。 ```cpp T4: // 1~4 burteforce: DFS order ``` #### BJ-S00804 ```cpp T2: int main() { freopen("road.in", "r", stdin); freopen("croad.out", "w", stdout); ``` #### BJ-S00805 万能头大神。 ```cpp T3: #include<bits.stdc++.h> ``` #### BJ-S00979 喜欢吃面。 ```cpp T1: int mian() ``` --- ### 小小字段 #### 退役选手 祝大家好运。希望你们能在退役之后仍然保持对信息学的热爱。 ![](https://cdn.luogu.com.cn/upload/image_hosting/i6y8vzo6.png) #### 暴戾语言 ##### BJ-S00XXX ```cpp T1: for(int i = 0;i<n;i++){//you father me say:"in CCF ,you are a int". cin>>m; if(i==0)fuck = m; ``` #### BJ-S00032 让我过让我过让我过。 他赢了。他 T1 和 T2 都 A 了。恭喜。 ```cpp T2: /* let me pass let me pass let me pass onegai onegai onegai */ ``` #### BJ-S00034 dickstra 怎么写来着。不会。 其实,针对不会的东西,你可以写点东西骗分的。比如,就 T4 而言,输出 $0$ 可以得到 $4$ 分。 ```cpp T2: //dickstrazenmexielaizhe T3: //tiaolebuhui T4: //buhui ``` #### BJ-S00040 Man! 另外,缀小生成树是什么。 ```cpp T1: //See you again T2: //zhuixiaoshengchengshu ``` #### BJ-S00131 我又输了,我是最菜的。 但其实,你已经做得很好了。你得了 $150$ 分,比我还高。 ```cpp T3: /* losed again... i am the noobest. */ ``` #### BJ-S00134 不光表达了对原神的热爱,还表达了对十六夜咲夜的强烈赞美。 ![](https://cdn.luogu.com.cn/upload/image_hosting/objr7342.png) #### BJ-S00173 哎呀我去题面怎么这么坏。 ```cpp T1: printf("Bad! It's so bad!"); ``` #### BJ-S00189 行吧,还有崩铁玩家。 ~~三月七天下第一!~~ ```cpp T3: //march 7th world best! ``` #### BJ-S00210 ```cpp T1: //多测不清空,保龄两行泪。 ``` 说出你的故事。 #### BJ-S00244 在代码开头记下作者和题目是好文明。 ```cpp /** * @brief CSP-S 2025 * Problem A. club * @author BJ-S00244 liuli688 */ ``` #### BJ-S00248 还是 whk 大佬。 ```cpp /* 祝我3+0.5能考上!初三上期中考试顺利!初三上12月月考顺利! 语文顺利! 数学顺利! 英语顺利! 道法顺利! 物理顺利! 化学顺利! 历史顺利! */ ``` #### BJ-S00250 妈妈告诉我要 CE 也不要空着。 ```cpp T3,T4: 妈妈告诉我要CE也不要空着 (以上是代码全部内容,并且没有被注释) ``` #### BJ-S00273 姓名缩写是 HXT 的同学有福了。 ```cpp // I LOVE HXT ! ``` #### BJ-S00284 这是对的。你说得对,但是 no egg 的 CCF 会引爆所有人的大脑导致第一题评绿的呼声此起彼伏。 ```cpp T4: // s的题好难(xs.. ``` #### BJ-S00354 你许下的愿望“求评测机跑得飞快”已经实现了,快回家看看吧。 ```cpp T2: //qiu pingceji paodefeikuai.bendi 800ms ``` #### BJ-S00385 多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊!多么诡异啊! ```cpp T4: #include<bits/stdc++.h> using namespace std; int main() { freopen("employ.in","r",stdin); freopen("employ.out","w",stdout); for(int i=0;i<30000000;i++) { pow(i,1000000); } cout<<2204128; /*I wanna talk to you you are such a big I havethis afternoon. It was extremely enjoyable I know you dislike me but I just wanna say: you can't suspect me although what I am doing now is illegal you do not have a way to give me a lesson. How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? How weird is that? */ return 0; } ``` #### BJ-S00414 显然,虽然只有一位同学直接表达了对原神的热爱,但是对原神角色的热爱丝毫不少。 ```cpp T1: // nahida纳西妲 ``` #### BJ-S00424 我知道这样做是为了规避一些问题,但是我还是很想说,$2^{30}-1=1073741823,2^{31}-1=2147483647$。 ```cpp T2: #define INF 1047483647 ``` #### BJ-S00505 Oh Shit! ```cpp T1: ... void shit(int k, int x, int y, int z){ ... else{ cout<<"oh shit\n"<<endl; } ... ``` #### BJ-S00579 这句话让我梦回 $2019$,这句话很像那时候抖音会说的话。 ```cpp if(n&1)cout<<"我知道你想淦什么,哈哈哈\n\n\n我是击掰坨似的三狼,,击败!"<<endl; ``` #### BJ-S00603 CCF 神机会保佑你的。 我也送你上北京大赏吧。 ```cpp T1: // 密码的一个条件给我条了30分钟 // 西西佛神机保佑我100pts!!! T2: // 西西佛神机保佑我16pts!!! // 完了完了还有25min要被西西佛肘击了 // freopen("road.in", "r", stdin); // freopen("road1.out", "w", stdout); // 我要上洛谷迷惑行为大赏!!! // 西西佛神机助我一分不挂 // 西西佛神机助我100 + 16 + 0 + 0 = 116 // You have no egg!!! ``` #### BJ-S00607 误闯天家。题好难。 ```cpp T2: int ti,hao,nan_;char gantanhao='!'; int wo,yi,dao,ye,bu,hui,zuo,aaaa;char gantanhao1='!'; int wu,chuang,tian,jia; int quan,yu,fang,xia,shou,zhong,sha; int wo_,di,yi_,lun,shi,zen,me,guo,de;string wenhao_4ge="????"; ``` #### BJ-S00696 虽然但是,找不到文件读写别赖没蛋。 还有 NP 时间复杂度。 ```cpp T2: //666 no egg can't speak ch //there is any distinguish in "chengshi" and "xiangzheng"??? //go **** city and village T4: O(n!) ``` #### BJ-S00702 四道题都在按如下方式估分。 他估出来 $100+56+10+4$。实际 $96+56+30+0$。净赚 $12$ 分。 ```cpp /* META: BJ-S00702 2025/11/1 replace.cpp T3 Status=Give up,Locked Guess Score=10 E1 AC E2 AC */ ``` #### BJ-S00722 这一行骗分代码有三种含义。 1. $33550336$ 的二进制构造是前面一堆 $1$ 后面一堆 $0$。异或这个数就意味着前半段取反。 2. $33550336$ 是第 $5$ 个完全数。 3. [白厄](https://zh.moegirl.org.cn/%E7%99%BD%E5%8E%84)。 位于 T3。 `srand(time(0)^33550336);` #### BJ-S00731 表达了对 C++ 和 NOI 的喜爱之情。 T3,T4。 `//I LOVE C++ I LOVE NOI` #### BJ-S00767 晚安信竞。 T3。 `printf("Goodnight, OI."); ` #### BJ-S00775 默写。 ![](https://cdn.luogu.com.cn/upload/image_hosting/hgk9lj70.png) 皇家翻译官: $$ \color{black}\text{野望 唐 王绩}\\ \color{black}\text{黄鹤楼 唐 崔颢}\\ \color{black}\text{得道多助 失道寡助}\\ \color{black}\text{三峡 北魏 郦道元}\\ \color{black}\text{与朱元思书 南朝梁 吴均}\\ $$ #### BJ-S00799 明年再来。 ```cpp T1: //practice more and come back next year ``` #### BJ-S00822 思路不清晰是你的谎言。 你后面全都在骗分,绝不可能只是思路不清晰。 ```cpp T1: //脑子里思路非常清晰,但不知道怎么解决最关键的那一步T^T //这题估计0分了T^T ``` ![](https://cdn.luogu.com.cn/upload/image_hosting/yxnaz74g.png) #### BJ-S00856 这段东西让我想起来 $12$ 月 $14$ 日北京的英语听说考试。 简单说,就是一种特殊的英语听力。在进行听力前有一步试机环节,试机环节有一部是键盘测试,就是像这样按一遍每个按键。 ```cpp T3: qwertyuiopasdfghjkl;zxcvbnm 1234567890 {}|:">?< @#$%^&*()+-*/@#$%^&*())!@#$%^&*() ``` #### BJ-S00857 A 了,再见。 诅咒还是正义?你不懂。 ```cpp T2: /* O((kn)log(kn)*(2^k)) 1e9... road4.in 0.6s (w/ O2) road3.in 0.9s (w/ O2) AC byebye */ T4: /* Take me to where you are, won't you? Till then, I'm struggling. Curse of justice, you don't know. */ ``` #### BJ-S00920 我不会! ```cpp T2: cout<<"我不会!"; ``` #### BJ-S01000 说句闲话:编号不错。 T1 调 $2$ 个小时其实有点慢。不过能做出来这道题就是好的。 ```cpp T1: //感慨一下:这道题整整花了我2个小时,纠了不下20个错!!!!!!啊啊啊啊啊啊啊啊啊啊! ``` --- ### 文件读写事故 注:这个分类的一部分被放在了“骗分事故”下。 #### BJ-S00112 没有在骗分,只是单纯忘记了 `freopen` 罢了。 ```cpp T2: #include<bits/stdc++.h> using namespace std; const int N=1e4+10; typedef pair<int,int> pii; vector<pair<int,int>> g[N]; long long dist[N]; int st[N]; int main(){ int n,m,k; cin>>n>>m>>k; 后略 ``` #### BJ-S00129 忘记删大样例了!吃一堑长一智吧。 ```cpp freopen("club2.in","r",stdin); freopen("club2.out","w",stdout); ``` #### BJ-S00292 总感觉忘删大样例的人就能单开一桌。 ```cpp freopen("replace1.in","r",stdin); freopen("replace.out","w",stdout); ``` #### BJ-S00400 这个 `freopen` 写法前无古人。 ```cpp fereopen{"*.in".stdin}; ``` #### BJ-S00417 出了一点点小问题的引号。 ```cpp freopen("replace.in","r",stdin); freopen("replace.out,"w",stdout); ``` #### BJ-S00449 冷知识,`freopen` 的第二个参数必须用双引号包裹。用单引号包裹你就等着 UB 吧。 ```cpp freopen("employ.in", 'r', stdin); freopen("employ.out", 'w', stdout); ``` #### BJ-S00453 ```cpp freopen("replace2.in","r",stdin); freopen("replace.out","w",stdout); ``` #### BJ-S00460 急中生智,试图通过写入输入文件来让后续评测的人只能读到他写的东西。诶呀我去这人怎么这么坏。) ```cpp freopen("employ.in","r",stdin); freopen("employ.in","w",stdout); ``` #### BJ-S00651 恭喜中奖。 ```cpp //freopen("club.in","r",stdin); //freopen("club.out","w",stdout); ``` #### BJ-S00665 ```cpp T2: freopen("road2.in","r",stdin); freopen("road.out","w",stdout); ``` #### BJ-S00666 无能的 `freopen`。 ```cpp freopen("Club1","r",stdin); //freopen("club.out","w",stdout); ``` #### BJ-S00735 ```cpp freopen("road3.in","r",stdin); //freopen("road.out","w",stdout); ``` #### BJ-S00743 不可发送单个标点符号 ```cpp freopen("club.in","r",stdin); freopen("club,out","w",stdout); ``` #### BJ-S00745 bro T3 的 `freopen` 消失了。 #### BJ-S00771 ```cpp //freopen("employ.in","r",stdin); //freopen("employ.out","w",stdout); ``` #### BJ-S00809 ```cpp freopen("empoly.in","r",stdin); freopen("empoly.out","w",stdout); ``` #### BJ-S00855 为什么你四道题的 `freopen` 甚至不能统一一个写法。 ![](https://cdn.luogu.com.cn/upload/image_hosting/sretllxj.png) #### BJ-S00856 ```cpp freopen("road.in","r",stdin); freopen("road.out","w".stdout); ``` #### BJ-S00860 哥们把 T2 和 T3 的 `freopen` 交换了。 #### BJ-S00893 ```cpp freopen("club.in","r",stdin); freopen("clud.out","w",stdout); ``` #### BJ-S00907 ```cpp freopen("road.in", "r", stdin); freopen("road.out", "w". stdout); ``` #### BJ-S00917 ```cpp freopen("replace.in", "r", stdin); //freopen("replace.out", "w", stdout); ``` #### BJ-S00958 ```cpp T2: freopen("road2.in", "r", stdin); freopen("road2.out", "w", stdout); T4: freopen("project.in", "r", stdin); freopen("project.out", "w", stdout); ``` --- ### 其它 #### BJ-S00041 每题都写了 $100$ 多行空行。 (注:最下面那行是 `return 0`) ![](https://cdn.luogu.com.cn/upload/image_hosting/3sq67s4m.png) #### BJ-S00175 T1:神秘诈骗。我说实在的,这个 `culb` 的拼写还是太难错了,不会有人做错的。 T2:齐民要术。原来火狐还有这功能吗。 T3:猜猜看呐。 T4:原来是 AFO 了。祝好。 ```cpp T1: // 去年第一次参加csps不知道可以整活 // 于是我来整活了 // 井inculed 《bits\stdc艹。h》 // using namepsace srd; // itn mian() { // frepoen("club4.in", "r", stdin); // feropen("culb.ans", "w", stodut); // cuot << "Hello word! << enld; // retrun 0; // } T2: // Emacs(GUI),点击Tools,点击Games,全是小游戏,可以随便玩 // FireFox,右键顶部标签栏,点击定制(C)...,把除了弹性空白的其它东西都拖进折叠菜单,点击下面新出现的独角兽,乒乓游戏 // 唉不是怎么虚拟机可以直接拖走阿 // 把虚拟机最小化直接露windows了 // 直接玩谷歌小恐龙 // 被小恐龙薄纱了55 T3: // 灰色头发是初音未来,绿色头发是洛天依 // 八字辨的是初音未来,双马尾的是洛天依 T4: //罢了,如此便好 //AFOed ``` #### BJ-S00264 ```cpp T4: memset(dp,-2e18,sizeof(dp)); ``` 考虑到新手可能不知道这个出了什么问题,解释如下: `memset` 函数的第二个参数理论上是只能存一字节的。如果你传了个超过一字节的数,会只保留最后一字节。 $-2\times10^{18}$ 显然是 $256$ 的倍数,因此最后一字节是 $0$。 这行代码和 `memset(dp,0,sizeof(dp));` 等价。 当然,有同学会发现,`-2e18` 是一个 `double`,似乎不太能用 `int` 处理。 但是这依然不是什么问题。我们可以看到浮点型的存储方式如下图所示: [![](https://cdn.luogu.com.cn/upload/image_hosting/8n9l7u31.png)](https://float.exposed/0xc3bbc16d674ec800) 最后一字节依然是 $0$,所以不影响。(点击上图以进入此链接。) #### BJ-S00314 哥们就一个 $20$ 用得着写这么高深吗。 还有,这个 `teshua` 我拼了半天才发现是 特殊 a。 以及,后面的拼音变量名我也拼了半天,还把连通拼成了 ~~\[此内容违反相关法律法规,已被移除。\]~~ ```cpp T2: ... const int maxk=1e1+10; ... bool teshua,jianshe[maxk],liantong[maxk][maxn],tuozhan[maxn][maxn]; ... ``` #### BJ-S00355 超级优先队列和超级 `if` 语句。 ```cpp T2: priority_queue<pair<int,pair<int,pair<int,int> > >,vector<pair<int,pair<int,pair<int,int> > > >,greater<pair<int,pair<int,pair<int,int> > > > > q; T3: if(repstr[i][0].find(targets) != string::npos && repstr[i][1].find(targett) != string::npos && repstr[i][0].find(targets) == repstr[i][1].find(targett) && repstr[i][0].substr(0,repstr[i][0].find(targets)) == t1.substr(cnt1 - repstr[i][0].find(targets),repstr[i][0].find(targets)) && repstr[i][1].substr(0,repstr[i][0].find(targets)) == t1.substr(cnt1 - repstr[i][0].find(targets),repstr[i][0].find(targets)) && repstr[i][1].substr(repstr[i][0].find(targets) + targets.size()) == repstr[i][0].substr(repstr[i][0].find(targets) + targets.size()) && repstr[i][1].substr(repstr[i][0].find(targets) + targets.size()) == t1.substr(cnt2 + 1) ) { ans ++; } ``` #### BJ-S00366 我很好奇,这个变量的初始值有任何作用和意义吗。 ```cpp T2: long long ans=0x7f,ans2=0x7f; int main() { freopen("road.in","r",stdin); freopen("road.out","w",stdout); int n,m,k; cin>>n>>m>>k; for(int i=1;i<=m;i++) { cin>>a[i].u>>a[i].v>>a[i].w; ans+=a[i].w; } ``` #### BJ-S00412 非常诡异的一段内容,看懂的可以保送清北了。 ![](https://cdn.luogu.com.cn/upload/image_hosting/vp806lbf.png) #### BJ-S00413 想上迷惑大赏,那就上吧。 ```cpp T4: #include<bits/stdc++.h> using namespace std; int n,q; int main() { freopen("employ.in","r",stdin); freopen("employ.out","w",stdout); cout<<2; return 0; }//aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /*苍天已死,黄天当立 你没看错我是黄巾军 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa巴巴波一 wbxl这题真的好难,我都不知道自己咋过的初赛 勇士总冠军!!!!!!!!! 我要上迷惑行为大赏aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa巴巴波一 巴巴波一巴巴波一 Bababooey LG uid:936125 yayayayayayayayayayayay */ ``` #### BJ-S00418 和上面那个写 `-2e18` 的坐一桌。 ```cpp T2: memset(dis,1000000007,sizeof(dis)); ``` $10^9$ 显然是 $256$ 的倍数,因此 $10^9+7$ 和 $7$ 等价。 #### BJ-S00448 输出的时候忘记删调试代码了,那可太悲惨了。 ```cpp #include <bits/stdc++.h> using namespace std; int t,n; struct node{ int a,b,c; }st[1000000]; struct node2{ int l,sc; }; int ansn=0,vis[1000000]; void dfs(node2 x,node2 y,node2 z,int k){ if(k==n+1){ cout << x.l << ' ' << y.l << ' ' << z.l << endl; ansn=max(ansn,x.sc+y.sc+z.sc); return; } for(int i=1;i<=n;i++){ if(x.l<n/2 and vis[i]==0){ vis[i]=1; dfs({x.l+1,x.sc+st[i].a},y,z,k+1); vis[i]=0; } if(y.l<n/2 and vis[i]==0){ vis[i]=1; dfs(x,{y.l+1,y.sc+st[i].b},z,k+1); vis[i]=0; } if(z.l<n/2 and vis[i]==0){ vis[i]=1; dfs(x,y,{z.l+1,z.sc+st[i].c},k+1); vis[i]=0; } } } int main(){ freopen("club.in","r",stdin); freopen("club.out","w",stdout); cin >> t; for(int i=1;i<=t;i++){ cin >> n; for(int j=1;j<=n;j++){ cin >> st[j].a >> st[j].b >> st[j].c; } dfs({0,0},{0,0},{0,0},1); cout << "ans" << ansn << endl; ansn=0; } fclose(stdin); fclose(stdout); return 0; } ``` #### BJ-S00453 我删除了一部分分号。 ```cpp T2: ... int ans=0 for(int j=1;j<=n;j++){ if(i&(1<<(j-1))){ ans+=c[j][0]; for(int w=1;w<=n;w++){ v[j+n].push_back({w,c[j][w]}); v[w].push_back({j.c[j][w]}); } } } for(int j=1;j<=n+k;j++){ v[j].earse(0,v[j].size()) } } return 0; } ``` #### BJ-S00531 `freopen`:好的,这个人想要让我重定向一下输入输出流,那么重定向谁的流呢? 他不告诉我。 (另外,这个人的代码属于*乍看之下没啥毛病,细看全是毛病*的) ```cpp T1: #include<bits/stdc++.h> using namespace std; int const ans = 1e5+5; int main(int argc char **argv){ freopen("club.in","r"); freopen("club.out","w"); int ans=0; int t; const = t; int s; int j=j[ai,1],j[ai,2],j[ai,3]; int n%2=0; cin>>n>>endl; for(int i=0;i<=n;i++){ i++; } for(int i+1;i+1<0;i+1++){ ans++; int s= n/i; } cout<<j[ai,1]+j[ai,2]+j[ai,3]; return 0; } T2: #include <bits/stdc++.h> using namespace std; int const = 1e4+5; int main(){ freopen("road.in","r") freopen("road.in","w") int n,m,k; cin>>n,m,k>>endl; int i = w[i],w[l]; int i = j[i],w[l]; w[i] = i*w; c[i] = i*w + k*c; for(int i = 0;i<0;i++){ for(int j<0;j++){ w[l] = i*w; j[l] = j*c; } } if() { w[l]<w[i]; c[l]<j[i]; } cout<<w[l]+j[l]<<endl; return 0; } T3: #include<bits/stdc++.h> using namespace std; int main(){ freopen("replace.in","r"); freopen("replace.in","w"); return 0; } T4: #include<bits/stdc++.h> using namespace std; int main(){ freopen("employ.in","r"); freopen("employ.in","w"); return 0; } ``` #### BJ-S00547 哥们这不是写了个 dijkstra 吗怎么不用啊。 ```cpp T2: ... void dijkstra(int s) { ... int main() { freopen("road.in","r",stdin); freopen("road.out","w",stdout); cin>>n>>m>>k; for(int i=1;i<=m;i++) { int u,v,w; cin>>u>>v>>w; edge p; p.v = v; p.w = w; e[u].push_back(p); p.v = u; e[v].push_back(p); } for(int i=1;i<=k;i++) { for(int j=1;j<=n+1;j++) { int a[10001]; cin>>c[j]; int u=m+j; for(int k=1;k<=n;k++) { cin>>a[k]; int v=k; int w=a[k]; edge p; p.v=v; p.w=w; e[u].push_back(p); p.v=u; e[v].push_back(p); } } } } ``` #### BJ-S00555 这个人在 T3 的代码里面复制了上百遍 T1 的代码。 下图只是他代码的冰山一角。 ![](https://cdn.luogu.com.cn/upload/image_hosting/gc9fp4ff.png) #### BJ-S00613 四段代码四个好活。 T1 模拟了一个彩票中奖。 T2 是某种排列组合。 T3 Wordle 模拟器。 ```cpp T4: 此代码不予展示。其原因可能为: 1.代码中含有木马病毒等恶意代码 2.代码超出沙箱保护范围内 3.网络原因导致代码异常 4.上传格式为zip、rar等压缩文件 5.其他异常原因 ``` (以上为代码全部原文) #### BJ-S00673 濒临 MLE 的代码,和并没有任何意义的 DJ。 ```cpp T2: int v[11451][11451]; void dj(int x){ } ``` #### BJ-S00701 这个和上面两个 `memset` 搞错的坐一桌。 ```cpp T1: memset(br,0,100004); ``` #### BJ-S00801 试图引入 `unordered_map`。 ```cpp T2: # include <unordered_map> ``` 冷知识:`unordered_map` 是 `map` 的变种,所以它应当在 `map` 头文件下。 #### BJ-S00813 似乎是一个小游戏。一个 $10$ KB 的小游戏。[点击](https://www.luogu.com.cn/paste/necxl514)获取更多信息。 #### BJ-S00835 冷知识:`main` 函数是不能隐藏它的返回值类型的。 它唯一的语法糖,就是你不写 `return` 的时候默认 `return 0`。但你还要写 `int main` 的。 ```cpp T4: main(){ FILE("employ"); ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int T=1; // cin>>T; while(T--)solve(); // cout<<Time()<<"\n"; return 0; } ``` #### BJ-S00873 似乎是三个小游戏。[点击](https://www.luogu.com.cn/paste/ivpfdr3j)获取更多信息。 #### BJ-S00920 为什么出了这么多不会用 `memset` 的人。 基础语法的普及任重道远。 ```cpp T1: memset(a,sizeof(a),0); memset(ca,sizeof(ca),0); memset(cb,sizeof(cb),0); ``` --- ## 后记 本文 Markdown 共有 $39632$ 个字符。