标题
增加 1 行删除 1 行
1CSP-S 2025 JS 迷惑行为大赏1CSP-S 2025 JS 迷惑行为大赏(上+下)
正文
增加 1607 行删除 38 行
123456789101112131415161763 行未改动8182838485868788897 行未改动979899100101102103104105178 行未改动全部展开2842852862872882892902912928 行未改动30130230330430530630730830945 行未改动355356357358359360361362210 行未改动全部展开5735745755765775785795805815825835845855865875885895905915925935945955968 行未改动60560660760860961061161261361461561661761815 行未改动63463563663763863964064116 行未改动658659660661662663664665666253 行未改动全部展开92092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797866 行未改动104510461047104810491050105110521053150 行未改动全部展开12041205120612071208120912101211121255 行未改动12681269127012711272127312741275127673 行未改动1350135113521353135413551356135713581359136013611362136349 行未改动格式学习自 [NOIP 2024 JS 迷惑行为大赏](https://www.luogu.com.cn/article/u7t1mnfk)# 示例以下是一个代码展示格式的示例。## JS-S00000(以上为选手的准考证号。):::info[[edit.cpp/assign.cpp] **你 被 骗 了**]{open}(标题表示以下代码段出现在了哪些程序中,和作者对其的评价。)```cpp//freopen("input.txt","r",stdin);```(以上表示代码片段,注释可能经过了拆分。):::# 选手63 行未改动:::info[[replace.cpp]**没骂人,求放过**]```cpp// O(q*B^2 + q*(S/2*B ... meimaren))// ccf qiufangguo// dayangli ruocheng shenme yangzi le aaaaaa....7 行未改动:::info[[replace.cpp]**如你所愿** (我承认说话有点大声了)]```cpp* os:希望数据也能这么水```:::178 行未改动全部展开:::## JS-S00206:::info[[club.cpp]**Clannad老师晚上好** 你怎么知道我2+1遐蝶了]```cpp//要开longlong,多测要清空//想上电视qwq8 行未改动## JS-S00213:::info[[club.cpp]**天梯大蛇**]画面过于暴力就不放了,大概就是写一行代码加一个tab,总共119行:::## JS-S00227 / JS-S0023345 行未改动```:::--------------------------$1501\sim 1915$ author:[LuoFeng_Nanami](https://www.luogu.com.cn/user/759710)## JS-S01504210 行未改动全部展开int n;cin>>n;int a[n+5][4];for(inti=1;i<=n;i++){cin>>a[i][1]>>a[i][2]>>a[i][3] ; }intcnt[4]={0 },c[n+1],f[n+1];long long tot=0;for(int i=1;i<=n;i++){int m=max(a[i][1], max(a[i][2],a[i][3])); for(intj=1;j<=3;j++){if(a[i][j]==m)8 行未改动i][3]};sort(x,x+3); c[i]=x[2]-x[1];} /* for(inti=1;i<=n;i++){cout<<f[i]<<ppp;}cout<<endlpp>>>>>>*/for(int i=1;i<=3;i++){if(cnt[i]>n/2){int cn[cnt[i]+1];for(intj=1,k=1;j<=n;j++){if(f[j]==i){cn15 行未改动stdout);ACplzzz;}```::::::info[[employ.cpp] **I'm so bored**]```cpp16 行未改动using namespace std;#define NetEase 998244353int main(){freopen("employ.in","r",stdin);freopen("employ.out","w",stdout);int miHoYo,SEGA;cin>>miHoYo>>SEGA;string SONY;cin>>SONY;253 行未改动全部展开:::## JS-S01606:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] 没有人比我更懂 //freopen !]```cppint main(){// freopen("club.in","r"stdin);// freopen("club.out","w"stdout);cout<<"18"<<endl;cout<<"4"<<endl;cout<<"13"<<endl;return 0;}``````cppint main(){// freopen("road.in","r"stdin);// freopen("road.out","w"stdout);cout<<"13"<<endl;return 0;}``````cppint main(){// freopen("replace.in","r"stdin);// freopen("replace.out","w"stdout);cout<<"2"<<endl;cout<<"0"<<endl;return 0;}``````cppint main(){// freopen("employ.in","r"stdin);// freopen("employ.out","w"stdout);cout<<"2"<<endl;return 0;}```:::## JS-S01634:::info[[road.cpp] **想从 ccf 身上捞一笔?**]```cpp//csp kao chang yu dao zhe zhong qing kuan ccf huei chu duo shao qian```66 行未改动return 0;}```四道题的代码都是这个。:::## JS-S01671:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] jy 姐姐下午好 /se]150 行未改动全部展开wo yao shang qi pa he ji!!!!!!!!!!! :(//freopen()//freopen()//freopen()//freopen()55 行未改动*/```:::## JS-S01747:::info[[club.cpp] 那很好了]```cpp//Oh my god! I can see the problem only on 14:39!```:::73 行未改动```:::## JS-S01795:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] 还有 freopen 高手]```cppint main(){freopen("club/road/replace/employ.in","r");freopen("club/road/replace/employ.out","w");```:::## JS-S01801:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] gzx 老师你好呀]```cpp49 行未改动12345678910111213141516171819202122232425262763 行未改动9192939495969798997 行未改动107108109110111112113114115178 行未改动全部展开2942952962972982993003013028 行未改动31131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944045 行未改动4864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906210 行未改动全部展开2117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921408 行未改动2149215021512152215321542155215621572158215921602161216215 行未改动217821792180218121822183218421852186218716 行未改动220422052206220722082209221022112212253 行未改动全部展开24662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252866 行未改动259525962597259825992600260126022603150 行未改动全部展开27542755275627572758275927602761276255 行未改动28182819282028212822282328242825282673 行未改动29002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293249 行未改动格式学习自 [NOIP 2024 JS 迷惑行为大赏](https://www.luogu.com.cn/article/u7t1mnfk)。本次江苏共有 $1915$ 名选手参加了 CSP-S,因为参赛选手较多,分为上(JS-S00001 至 JS-S00600)、中(JS-S00601 至 JS-S01500)、下(JS-S01501 至 JS-S01915)三部分,本篇专栏是上、下两部分合集,由 [liuhaodong947](https://www.luogu.com.cn/user/304613)、[\_qwerty\_](https://www.luogu.com.cn/user/905744)、[LuoFeng_Nanami](https://www.luogu.com.cn/user/759710) 共同完成。**限时活动(截止日期 2025/12/31):在评论区发送 `vote: 00000,...,01915`(五位数字是准考证号后五位)为你喜爱的选手迷惑行为投票!每人限量 $20$ 票,超出无效,以最后一条评论为准!**榜单见 [此处](https://www.luogu.me/paste/nyi42o7c)。欢迎各位继续投稿!**免责声明:以下代码不代表作者本人观点。**# 示例以下是一个代码展示格式的示例。## JS-S00000(以上为选手的准考证号。):::info[[club.cpp/road.cpp] **你 被 骗 了**]{open}(标题表示以下代码段出现在了哪些程序中,和作者对其的评价。)```cpp//freopen("(Iniaugoty&&zzy0618&&Igunareo)_akioi.txt","r",stdin);```(以上表示代码片段,注释可能经过了拆分。):::# 选手63 行未改动:::info[[replace.cpp]**没骂人,求放过**]```cpp// O(q*B^2 + q*(S/2*B ... meimaren))// ccf qiufangguo// dayangli ruocheng shenme yangzi le aaaaaa....7 行未改动:::info[[replace.cpp]**如你所愿** (我承认说话有点大声了)]```cpp* os:希望数据也能这么水```:::178 行未改动全部展开:::## JS-S00206:::info[[club.cpp]**Clannad老师晚上好** ]```cpp//要开longlong,多测要清空//想上电视qwq8 行未改动## JS-S00213:::info[[club.cpp]**天梯大蛇**]**建议复制至本地观赏。**```cpp#include<bits/stdc++.h>using namespace std;bool cmp(int x,int y){return x>y;}int main(){freopen("club.in","r","std.in");freopen("club.out","w","std.out");long long t,n,a1[10005],a2[10005],a3[10005];cin>>t;int cnt;for (int i=1;i<=t;i++){cin>>n;int sum=0,sum1=0,sum2=0;int cnt=0;for (int j=1;j<=n;j++){cin>>a1[j]>>a2[j]>>a3[j];if (a1[j]>a2[j]&&a1[j]>a3[j]){sum++;cnt+=a1[j];} if (a2[j]>a1[j]&&a2[j]>a3[j]){sum1++;cnt+=a2[j];} if (a3[j]>a1[j]&&a3[j]>a2[j]){sum2++;cnt+=a3[j];}if (sum>(n/2)){sort(a2,a2+n,cmp);sort(a1,a1+n,cmp);sort(a3,a3+n,cmp);if (a2[j]>a3[j]){sum1++;cnt+=a2[j];}else {sum2++;cnt+=a3[j];}sum--;cnt-=a1[j];}if (sum>(n/2)){sort(a2,a2+n);sort(a1,a1+n);sort(a3,a3+n);if (a2[j]>a3[j]){sum1++;cnt+=a2[j];}else {sum2++;cnt+=a3[j];}sum--;cnt-=a1[j];}if (sum1>(n/2)){sort(a2,a2+n,cmp);sort(a1,a1+n,cmp);sort(a3,a3+n,cmp);if (a1[j]>a3[j]){sum++;cnt+=a1[j];}else {sum2++;cnt+=a3[j];}sum1--;cnt-=a2[j];} if (sum1>(n/2)){sort(a2,a2+n);sort(a1,a1+n);sort(a3,a3+n);if (a1[j]>a3[j]){sum++;cnt+=a1[j];}else {sum2++;cnt+=a3[j];}sum1--;cnt-=a2[j];}if(sum2>(n/2)){sort(a2,a2+n,cmp);sort(a1,a1+n,cmp);sort(a3,a3+n,cmp);if (a1[j]>a2[j]){cnt+=a1[j];}else {sum1++;cnt+=a2[j];}sum2--;cnt-=a3[j];}if(sum2>(n/2)){sort(a2,a2+n);sort(a1,a1+n);sort(a3,a3+n);if (a1[j]>a2[j]){sum++;cnt+=a1[j];}else {sum1++;cnt+=a2[j];}sum2--;cnt-=a3[j];}}if(cnt==10){cout<<"13"<<endl;}else {cout<<cnt<<endl;}}return 0;}```:::## JS-S00227 / JS-S0023345 行未改动```:::------------$301\sim 600$ author:[\_qwerty\_](https://www.luogu.com.cn/user/905744)## JS-S00302:::info[[club/road/replace/employ.cpp] **惊世智慧**]```cpp#define x0 ak_cspj#define x1 ak_csps#define y0 ak_noi#define y1 ak_noi```:::## JS-S00305:::info[[replace.cpp] **听我说谢谢你**]```cpp//Thanks CCF qwq;```:::## JS-S00311:::info[[road.cpp] **匿名这一块**]```cpp// Name: XK// Identity: XXXXXXKKKKKKKK-xk-XXX-KKK-XKXKXKXKXKXKXK123456789X```::::::info[[replace.cpp] **同上**]```cpp//XKXKXKXKXKXKXKXKKXKXKXKXKKXKX//XKXKXKXKKXKXKXKXKKXKXKXKKXKXK//XKXKXKXKXKXKXKKXKXKXKXKXKKXKX```:::## JS-S00320:::info[[road/replace/employ] **砖 业 片 分,三题都在骗分但是没写文件**]```cppint main(){int n,m;string s;int c[1000001];cin>>n>>m;cin>>s;for(int i=0;i<n;i++){cin>>c[i];}cout<<2;}```:::## JS-S00323:::info[[employ.cpp] **西西艾副亦有情,给我五分行不行**]```cpp//dear CCF,please give me 5 points```:::## JS-S00324:::info[[road/replace/employ.cpp] **和 00320 坐一桌**]```cpp//freopen("club.in","r",stdin);//freopen("club.out","w",stdout);```:::## JS-S00326:::info[[employ.cpp] **rp++**]```cpp//// || |||||||||| |||||||||||// || || || ||// || || || || || ||// |||| || || || ||// || ||||||||||| |||||||||| ||||||||||// || || || ||// || || || ||// || ||// || ||// || ||////project Moon Start```:::## JS-S00330:::info[[club.cpp] **这也有车迷**]```cpp//tefosi```::::::info[[replace.cpp] **嘟嘟嘟嘟~**]```cpp//dududuDu```:::## JS-S00331:::info[[club/road/replace/employ.cpp] **小剧场+1**]```cpp//Try to take Zhong Chenxi & Lu Guo to every contest.//Wish Zhong&Lu forever,till the end!//0232 is the best pair in the world!//Little Pigeon is the most beautiful, most adorable creature all over the world!//I love Little Pigeon!//Little Pigeon is the best!/*There once was a kingdom named "Pigeoland". The king of the kingdom Chuanshang was very old but wise. He only had a beautiful daughter, whose name wasZhong1 Guo3. The old king thought, "I need to find a man, who is kind, thoughtful and intelligent to be the new king, or my daughter will too buzy to livea happy life." So he said to his daughter, "Oh, my dear daughter, you are old enough to travel around the world like I did in a young age. It's the timeto leave home and get more hands-on experience."Zhong1 Guo3 was very glad to have a look at the outer part of the world, so she left the capital with a guide and three whole chests of gold coinshappily. She spent one chest of coins quickly in the first month. She decided to go home, but on the way home, the guide robbed all her money and escaped.The princess walked home tiredly and hungrily, surprised with the attitude of her friends before, when she is still rich. Hearing her story, the old kingsmiled and said, "This is the first class, people's attitude to you depends on the interest they can make from you."The princess left again with little money at the second time. She found a boyfriend and they loved each other deeply. But one day, she found thather boyfriend had another "only"! She was angry and went back home. "This is the second class, don't be the doll to love.", the old king said with acough.The princess travelled the third time. This time she brought some money and a pair o rings. She soon found her love, who was kind, thoughtful andclever, called Lu2 Chen2xi1. They got married, lived happily owning a farm.But soon the bad news come. The old king had a bad ill suddenly. The princess told her husband her true name and information, and they went backquickly. The old king laid on the bed, smiling weakly, "This is the last class, my daughter. You are a good leader now, and the class is over."The king dead in a few weeks, and the new king Lu2 Chen2xi1 worked hard and loved his queen very much. They also had a daughter.Years passed. The little princess growed up, and the old king and queen are both old. One day, the old queen said to the little princess, "Oh, mydear daughter..."*/```:::## JS-S00335:::info[[club.cpp] **邮寄+1**]```cpp/*I thought T1 for 1.5h and puzzled with "n".Beacuse if n%2==1,it might be too hard for me to come up with the right alogithmFinally......When I looked the content above the requires again,I had found that was impoosible in this task......*/```:::## JS-S00338:::info[[club.cpp] **你说的对,但是研究科学的最佳方式是(逃**]```cpp/*置身天上之森*/```:::## JS-S00346:::info[[employ.cpp] **数学大手子(初中版)**]```cpp/*25(本题满分16分).如图(没有),在抛物线 $y_1=ax^2+bx+3$ 上有一动点 $P$。抛物线交 y 轴于 $C\text{(0,3)}$,交 x 轴与 $A,B\text{(3,0)}$。$y_2=kx+m$ 交抛物线于 $A,C$ 两点,交抛物线的对称轴于 $E$。(1) 求 $y_1,y_2$ 的解析式。(3分)(2) A(_,_),E(_,_)。(2分)(3) 当 $P$ 在直线 $BC$ 上方时(不与 $B,C$ 重合),求 $\triangle PBC$ 面积最大值以及此时 $P$ 点坐标。(3分)(4) 求出当 $\triangle ACP$ 为等腰三角形时 $P$ 的坐标。(4分)(5) 在 $x$ 轴上是否存在一点 $Q$,使 $P,Q,A,E$ 构成的四边形是平行四边形?如果存在,直接写出 $P$ 点的坐标。(4分)*/```:::## JS-S00351:::info[[club.cpp] **不写文件+1**][employ.cpp] **神秘文件+1**```cppfreopen("employ3.in","r",stdin);```:::## JS-S00362:::info[[employ.cpp] **自信骗分**]```cppcout<<rand()%mod<<"\n";```:::## JS-S00367:::info[[road.cpp] **文件+1**]```cpp//freopen("road.in","r",stdin);//freopen("road.out","w",stdout);```:::## JS-S00369:::info[[road.cpp] **made mom $\times \infty$**]```cpp/* for(int i=0;i<1000;i++){cout<<"CCF I made you mom!!!";}*/```:::## JS-S00374:::info[[club.cpp] **大法师来了**]```cpp// let me try force(dfs)!!!// then write ji yi hua sou suo```:::## JS-S00391:::info[[club/road/replace/employ.cpp] **逆天文件,club甚至连文件名都是错的**]```cppfreopen("culb.ans","w",stdout);``````cppfreopen("road.ans","w",stdout);```:::## JS-S00400:::info[[replace/employ.cpp] **I don't know**]```cppprintf("😡👎I don't know👎😡\n");```:::## JS-S00403:::info[[road.cpp] **wo bu hui a**]```cpp//prim?//wo bu hui a wwwww//yao afo l```:::## JS-S00415:::info[[road.cpp] **美术家+1**]```cpp/*~ ~ ~| | || | |___|___|___|___/ \\ /\_____________/*/```:::## JS-S00419:::info[[club.cpp] **如你所愿**]```cpp//rp++++++++//why t1 so difficult//or i am too sweet//ganjue you 1.4 le//xiaoduiliyou nianlingbiwoxiao shilibiwoqiang deren//woshibushiyaobeitanchudandiaoduiliele//huashuojinnian demihuoxingweidashanghuibuhuiyouwo?```[replace.cpp] **许愿+1**```cpp//ahhhhhh//ccfnengduogeiwoyidianfenma```[employ.cpp] **自信随机**```cpp//baolimaosifenhaitingduode//suijishusuanfa!!```:::## JS-S00429:::info[[club.cpp] **循环展开???**]```cppif(n==4){int ans=0,sum=0;sum=a[1][1]+a[2][1]+a[3][2]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][1]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][2]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][2]+a[4][2];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][1]+a[2][3]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][1]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][2]+a[2][1]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][2]+a[3][1]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][2]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][2]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][2]+a[3][3]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][1]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][2]+a[2][3]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][2]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][1]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][1]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][1]+a[4][3];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][2]+a[4][3];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][3]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][2]+a[3][3]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][3]+a[3][1]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][3]+a[3][1]+a[4][2];ans=max(sum,ans);sum=a[1][3]+a[2][3]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][3]+a[3][2]+a[4][1];ans=max(sum,ans);sum=a[1][3]+a[2][3]+a[3][2]+a[4][2];ans=max(sum,ans);cout<<ans<<"\n";}```:::## JS-S00433:::info[[road.cpp] **road1.in**]```cppfreopen("road1.in","r",stdin);```:::## JS-S00447:::info[[road/replace/employ.cpp] **默哀**]```cpp//freopen("road.in","w",stdin);```:::## JS-S00454:::info[[replace.cpp] **默哀+1**]```cpp//freopen("replace.in","r",stdin);```:::## JS-S00455:::info[[club.cpp] **卡哇伊**]```cpp//(QWQ) (^_^) =) =( (qwq) (QAQ) ( !&@#!& )( !&)!!& ) (*_*) (*o*) (^o^) ($o$) ($_$)```:::## JS-S00456:::info[[club/road/replace/employ.cpp] 六条戒律哪够,来个 $93$ 条]```cpp/*1. keep calm, one mistake can't ruin ur test, but mental breakdown can2. read the problem carefully, at least twice3. think calmly: think twice code once, think once code forever4. check freopen and filename5. array limits, corner cases(0), int/long long overflow, init if multicases6. trust urself, u r the best version of urself, don't compare with othersthat one day, when we look back, we will be amazed by how far we've comed!*/```:::## JS-S00468:::info[[club.cpp] 密码锁这一块]```cppif(n == 2)for(int i = 1;i <= 3;i++)for(int j = 1;j <= 3;j++){if(i == j) continue;ans = max(a[1][i] + a[2][j],ans);}else if(n == 4)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++){memset(x,0,sizeof x);x[i]++,x[j]++,x[k]++,x[l]++;if(x[1] > n / 2 || x[2] > n / 2 || x[3] > n / 2) continue;ans = max(ans,a[1][i] + a[2][j] + a[3][k] + a[4][l]);}else if(n == 10)for(int q = 1;q <= 3;q++)for(int w = 1;w <= 3;w++)for(int e = 1;e <= 3;e++)for(int r = 1;r <= 3;r++)for(int t = 1;t <= 3;t++)for(int yy = 1;yy <= 3;yy++)for(int u = 1;u <= 3;u++)for(int i = 1;i <= 3;i++)for(int o = 1;o <= 3;o++)for(int p = 1;p <= 3;p++){memset(x,0,sizeof x);x[q]++,x[w]++,x[e]++,x[r]++,x[t]++,x[yy]++,x[u]++,x[i]++,x[o]++,x[p]++;if(x[1] > n / 2 || x[2] > n / 2 || x[3] > n / 2) continue;ans = max(ans,a[1][q] + a[2][w] + a[3][e] + a[4][r] + a[5][t] + a[6][yy] + a[7][u] + a[8][i] + a[9][o] + a[10][p]);}```:::## JS-S00469:::info[[club/road/replace/employ.cpp] 膜拜来了]```cpp//mo bai xst dalao//mo bai wyx dalao//mo bai cyh dalao//I AK IOI//Ren5Jie4Di4Ling5%```:::## JS-S00479:::info[[club.cpp] ready for afo]```cpp//t2 zhale.//ready for afo.```:::## JS-S00493:::info[[club.cpp] 循环展开喜加一]```cppif(n==2){for(int i=1;i<=3;i++){cnt[i]++;sum+=a[1][i];for(int i2=1;i2<=3;i2++){cnt[i2]++;sum+=a[2][i2];if(judge(n) && maxn<sum){maxn=sum;}cnt[i2]--;sum-=a[2][i2];}cnt[i]--;sum-=a[1][i];}}else if(n==4){for(int i=1;i<=3;i++){cnt[i]++;sum+=a[1][i];for(int i2=1;i2<=3;i2++){cnt[i2]++;sum+=a[2][i2];for(int i3=1;i3<=3;i3++){cnt[i3]++;sum+=a[3][i3];for(int i4=1;i4<=3;i4++){cnt[i4]++;sum+=a[4][i4];if(judge(n) && maxn<sum){maxn=sum;}cnt[i4]--;sum-=a[4][i4];}cnt[i3]--;sum-=a[3][i3];}cnt[i2]--;sum-=a[2][i2];}cnt[i]--;sum-=a[1][i];}}else if(n==10){for(int i=1;i<=3;i++){cnt[i]++;sum+=a[1][i];for(int i2=1;i2<=3;i2++){cnt[i2]++;sum+=a[2][i2];for(int i3=1;i3<=3;i3++){cnt[i3]++;sum+=a[3][i3];for(int i4=1;i4<=3;i4++){cnt[i4]++;sum+=a[4][i4];for(int i5=1;i5<=3;i++){cnt[i5]++;sum+=a[5][i5];for(int i6=1;i6<=3;i6++){cnt[i6]++;sum+=a[6][i6];for(int i7=1;i7<=3;i7++){cnt[i7]++;sum+=a[7][i7];for(int i8=1;i8<=3;i8++){cnt[i8]++;sum+=a[8][i8];for(int i9=1;i9<=3;i9++){cnt[i9]++;sum+=a[9][i9];for(int ix=1;ix<=3;ix++){cnt[ix]++;sum+=a[10][ix];if(judge(n) && maxn<sum){maxn=sum;}cnt[ix]--;sum-=a[10][ix];}cnt[i9]--;sum-=a[9][i9];}cnt[i8]--;sum-=a[8][i8];}cnt[i7]--;sum-=a[7][i7];}cnt[i6]--;sum-=a[6][i6];}cnt[i5]--;sum-=a[5][i5];}cnt[i4]--;sum-=a[4][i4];}cnt[i3]--;sum-=a[3][i3];}cnt[i2]--;sum-=a[2][i2];}cnt[i]--;sum-=a[1][i];}}:::## JS-S00500:::info[[club.cpp] 给初赛 $98$ pts 的卡头了]```cpp//luogu914813 Undercraft//acta est fabula,plaudite//vivid/stasis//fu sai JS-J00492 JS-S00500//chu sai -j 98 -s 72//csp-s//xi wang neng jin noip//15:07 fa xian bu shi tan xin,zai xie fen zu bei bao```:::## JS-S00503:::info[[club.cpp] 密码锁+1]```cppif(n>10){if(cmp(n)){sort(a+1,a+n+1,cm);for(int i=1;i<=n/2;i++){ans+=a[i];}}else{cout<<1876432;}}else if(n==2){for(int i=1;i<=3;i++){for(int j=1;j<=3 && j!=i;j++){ans=max(ans,de(i,1)+de(j,2));}}}else if(n==4){for(int a=1;a<=3;a++){for(int b=1;b<=3;b++){for(int c=1;c<=3;c++){for(int d=1;d<=3;d++){df(a);df(b);df(c);df(d);if(k>n/2 || l>n/2 || m>n/2) continue;ans=max(ans,de(a,1)+de(b,2)+de(c,3)+de(d,4));}}}}}else{for(int a=1;a<=3;a++){for(int b=1;b<=3;b++){for(int c=1;c<=3;c++){for(int d=1;d<=3;d++){for(int e=1;e<=3;e++){for(int f=1;f<=3;f++){for(int g=1;g<=3;g++){for(int h=1;h<=3;h++){for(int i=1;i<=3;i++){for(int j=1;j<=3;j++){df(a);df(b);df(c);df(d);df(e);df(f);df(g);df(h);df(i);df(j);if(k>n/2 || l>n/2 || m>n/2) continue;ans=max(ans,de(a,1)+de(b,2)+de(c,3)+de(d,4)+de(e,5)+de(f,6)+de(g,7)+de(h,8)+de(i,9)+de(j,10));}}}}}}}}}}}```:::## JS-S00504:::info[[road.cpp] 卡常大师]看到回复一下,好奇过没过orz```cpp/*kkksc03 orz orz orz Orz Orz Orz Orz Orz Orz999ms 998ms*/```:::## JS-S00513:::info[[road.cpp] pdf大手子]**部分与原题面不符的为lg关键字屏蔽,与作者无关**```cpp/*2025 CCF 非专业级软件能力认证CSP-J/S 2025 第二轮认证提高级时间:2025 年 11 月 1 日 14:30 ∼ 18:30题目名称 社团招新 道路修复 谐音替换 员工招聘题目类型 传统型 传统型 传统型 传统型目录 club road replace employ可执行文件名 club road replace employ输入文件名 club.in road.in replace.in employ.in输出文件名 club.out road.out replace.out employ.out每个测试点时限 1.0 秒 1.0 秒 1.0 秒 1.0 秒内存限制 512 MiB 512 MiB 2048 MiB 512 MiB测试点数目 20 25 20 25测试点是否等分 是 是 是 是road.cpp replace.cpp employ.cpp提交源程序文件名对于 C++ 语言club.cpp编译选项对于 C++ 语言‐O2 ‐std=c++14 ‐static注. 意. 事. 项(. 请. 仔. 细. 阅. 读).1. 文件名(程序名和输入输出文件名)必须使用英文小写。2. main 函数的返回值类型必须是 int,程序正常结束时的返回值必须是 0。3. 若无特殊说明,结果的比较方式为全文比较(过滤行末空格及文末换行)。4. 选手提交的程序源文件大小不得超过 100 KiB。5. 提交的程序源文件的放置位置请参考各省的具体要求。6. 程序可使用的栈空间内存限制与题目的内存限制一致。7. 禁止在源代码中改变编译器参数(如使用 #pragma 命令),禁止使用系统结构相关指令(如内联汇编)或其他可能造成不公平的方法。8. 因违反上述规定而出现的问题,申诉时一律不予受理。9. 只提供 Linux 格式附加样例文件。10. 全国统一评测时采用的机器配置为:Intel Core Ultra 9 285K CPU @ 3.70 GHz(关闭睿频与能效核),内存 96 GB。上述时限以此配置为准。11. 评测在当前最新公布的 NOI Linux 下进行,各语言的编译器版本以此为准。2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 社团招新(club)社团招新(club)【题目描述】小 L 是学校算法协会的成员。在今年的学校社团招新中,小 L 一共招收了 n 个新成员,其中 n 为 偶L 希望将他们分到协会不同的部门。. 数。现在小.算法协会共设有三个部门,其中第 i (1 ≤ i ≤ n) 个新成员对第 j (1 ≤ j ≤ 3) 个部门的满意度为 a i,j 。定义一个分配方案的满意度为所有新成员对分配到的部门的满意度之和,也就是说,若将第 i (1 ≤ i ≤ n) 个新成员分配到了第 d i ∈ {1, 2, 3} 个部门,则该∑分配方案的满意度为 ni=1 a i,d i 。小 L 不希望某一个部门的新成员数量过多。具体地,他要求在分配方案中, 不. 存. 在.n一个部门被分配 多. 于. 2 个新成员。你需要帮助小 L 求出,满足他要求的分配方案的满意度的最大值。【输入格式】从文件 club.in 中读入数据。本. 题. 包. 含. 多. 组. 测. 试. 数. 据。.输入的第一行包含一个正整数 t,表示测试数据组数。接下来依次输入每组测试数据,对于每组测试数据:• 第一行包含一个正整数 n,表示新成员的数量。• 第 i + 1 (1 ≤ i ≤ n) 行包含三个非负整数 a i,1 , a i,2 , a i,3 ,分别表示第 i 个新成员对第 1, 2, 3 个部门的满意度。【输出格式】输出到文件 club.out 中。对于每组测试数据,输出一行一个非负整数,表示满足小 L 要求的分配方案的满意度的最大值。【样例 1 输入】1 32 43 4 2 14 3 2 45 5 3 46 3 5 17 4第 2 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证8 0 1 09 0 1 010 0 2 011 0 2 012 213 10 9 814 4 0 0提高级 社团招新(club)【样例 1 输出】1 182 43 13【样例 1 解释】该样例共包含三组测试数据。对于第一组测试数据,可以将四个新成员分别分配到第 1, 3, 1, 2 个部门,则三个部门的新成员数量分别为 2, 1, 1,均不超过42= 2,满意度为 4 + 4 + 5 + 5 = 18。对于第二组测试数据,可以将四个新成员分别分配到第 1, 1, 2, 2 个部门,则三个部门的新成员数量分别为 2, 2, 0,均不超过42= 2,满意度为 0 + 0 + 2 + 2 = 4。对于第三组测试数据,可以将两个新成员分别分配到第 2, 1 个部门,则三个部门的新成员数量分别为 1, 1, 0,均不超过22= 1,满意度为 9 + 4 = 13。【样例 2】见选手目录下的 club/club2.in 与 club/club2.ans。该样例满足测试点 3, 4 的约束条件。【样例 3】见选手目录下的 club/club3.in 与 club/club3.ans。该样例满足测试点 5 ∼ 8 的约束条件。【样例 4】见选手目录下的 club/club4.in 与 club/club4.ans。该样例满足测试点 9 的约束条件。第 3 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 社团招新(club)【样例 5】见选手目录下的 club/club5.in 与 club/club5.ans。该样例满足测试点 15, 16 的约束条件。【数据范围】对于所有测试数据,保证:• 1 ≤ t ≤ 5;• 2 ≤ n ≤ 10 5 ,且 n 为偶数;• 对于所有 1 ≤ i ≤ n,1 ≤ j ≤ 3,均有 0 ≤ a i,j ≤ 2 × 10 4 。测试点编号 n =1 22 43, 4 105 ∼ 8 30910, 11特殊性质20015, 16B无A1213, 14无10 517 ∼ 20BC无特殊性质 A:对于所有 1 ≤ i ≤ n,均有 a i,2 = a i,3 = 0。特殊性质 B:对于所有 1 ≤ i ≤ n,均有 a i,3 = 0。特殊性质 C:对于所有 1 ≤ i ≤ n,1 ≤ j ≤ 3,a i,j 均在 [0, 2 × 10 4 ] 中 独. 立. 均. 匀. 随. 机.生成。第 4 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 道路修复(road)道路修复(road)【题目描述】C 国的交通系统由 n 座城市与 m 条连接两座城市的双向道路构成,第 i (1 ≤ i ≤ m)条道路连接城市 u i 和 v i 。 任. 意. 两. 座. 城. 市. 都. 能. 通. 过. 若. 干. 条. 道. 路. 相. 互. 到. 达。.然而,近期由于一场大地震,所有 m 条道路都被破坏了,修复第 i (1 ≤ i ≤ m) 条道路的费用为 w i 。与此同时, C 国还有 k 个准备进行城市化改造的乡镇。对于第 j (1 ≤ j ≤ k)个乡镇, C 国对其进行城市化改造的费用为 c j 。在城市化改造完第 j (1 ≤ j ≤ k) 个乡镇后,可以在这个乡镇与原来的 n 座城市间建造若干条道路,其中在它与第 i (1 ≤ i ≤ n)座城市间建造一条道路的费用为 a j,i 。C 国可以在这 k 个乡镇中选择 任. 意. 多. 个进行城市.化改造,也可以不选择任何乡镇进行城市化改造。n 座城市两两连为尽快恢复城市间的交通,C 国政zheng府fu希望以最低的费用将 原. 有的.通,也即任意两座原有的城市都能通过若干条修复或新建造的道路相互到达。你需要帮助他们求出,将原有的 n 座城市两两连通的最小费用。【输入格式】从文件 road.in 中读入数据。输入的第一行包含三个非负整数 n, m, k,分别表示原有的城市数量、道路数量和准备进行城市化改造的乡镇数量。输入的第 i + 1 (1 ≤ i ≤ m) 行包含三个非负整数 u i , v i , w i ,表示第 i 条道路连接的两座城市与修复该道路的费用。输入的第 j + m + 1 (1 ≤ j ≤ k) 行包含 n + 1 个非负整数 c j , a j,1 , a j,2 , . . . , a j,n ,分别表示将第 j 个乡镇进行城市化改造的费用与在该乡镇与原有的城市间建造道路的费用。【输出格式】输出到文件 road.out 中。输出一行一个非负整数,表示将原有的 n 座城市两两连通的最小费用。【样例 1 输入】1 4 4 22 1 4 63 2 3 74 4 2 55 4 3 46 1 1 8 2 4第 5 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证7提高级 道路修复(road)100 1 3 2 4【样例 1 输出】113【样例 1 解释】C 国政zheng府fu可以选择修复第 3 条和第 4 条道路,然后将第 1 个乡镇进行城市化改造,并建造它与第 1, 3 座城市间的道路,总费用为 5 + 4 + 1 + 1 + 2 = 13。可以证明,不存在比 13 更小的费用能使原有的 4 座城市两两连通。【样例 2】见选手目录下的 road/road2.in 与 road/road2.ans。该样例满足测试点 11, 12 的约束条件。【样例 3】见选手目录下的 road/road3.in 与 road/road3.ans。该样例满足测试点 13, 14 的约束条件。【样例 4】见选手目录下的 road/road4.in 与 road/road4.ans。该样例满足测试点 15, 16 的约束条件。【数据范围】对于所有测试数据,保证:• 1 ≤ n ≤ 10 4 ,1 ≤ m ≤ 10 6 ,0 ≤ k ≤ 10;• 对于所有 1 ≤ i ≤ m,均有 1 ≤ u i , v i ≤ n,u i ̸ = v i 且 0 ≤ w i ≤ 10 9 ;• 对于所有 1 ≤ j ≤ k,均有 0 ≤ c j ≤ 10 9 ;• 对于所有 1 ≤ j ≤ k,1 ≤ i ≤ n,均有 0 ≤ a j,i ≤ 10 9 ;• 任意两座原有的城市都能通过若干条原有的道路相互到达。第 6 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 道路修复(road)测试点编号 n ≤ m ≤ k ≤ 特殊性质1 ∼ 4 10 4 10 6 0 无5, 67, 89, 1011, 12510 310 615, 1617, 1810421 ∼ 25无A无13, 1419, 20A10 510510A无A无特殊性质 A:对于所有 1 ≤ j ≤ k,均有 c j = 0 且均存在 1 ≤ i ≤ n 满足 a j,i = 0。第 7 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 谐音替换(replace)谐音替换(replace)【题目描述】小 W 是一名喜欢语言学的算法竞赛选手。在语言学中,谐音替换是指将原有的字词替换为读音相同或相近的字词。小 W 发现,谐音替换的过程可以用字符串来进行描述。具体地,小 W 将谐音替换定义为以下字符串问题:给定 n 个字符串二元组,第 i (1 ≤ i ≤ n) 个字符串二元组为 (s i,1 , s i,2 ),满足|s i,1 | = |s i,2 |,其中 |s| 表示字符串 s 的长度。对于字符串 s,定义 s 的 替. 换如下:.• 对于 s 的某个子串 y,若存在 1 ≤ i ≤ n 满足 y = s i,1 ,则将 y 替换为 y ′ = s i,2 。具体地,设 s = x + y + z,其中 x 和 z 可以为空,“+”表示字符串拼接,则 s的替换将得到字符串 s ′ = x + y ′ + z。t j,1 , t j,2 ,小 W 提出了 q 个问题,第 j (1 ≤ j ≤ m) 个问题会给定两个 不. 同的字符串.她想知道有多少种字符串 t j,1 的替换能够得到字符串 t j,2 。两种 s 的替换不同当且仅当子x, z 不同或 i 不同。你需要. 串. y 的. 位. 置. 不. 同. 或. 用. 于. 替. 换. 的. 二. 元. 组. (s i,1 , s i,2 ) 不. 同,即.回答小 W 提出的所有问题。【输入格式】从文件 replace.in 中读入数据。输入的第一行包含两个正整数 n, q,分别表示字符串二元组的数量和小 W 提出的问题的数量。输入的第 i + 1 (1 ≤ i ≤ n) 行包含两个字符串 s i,1 , s i,2 ,表示第 i 个字符串二元组。输入的第 j + n + 1 (1 ≤ j ≤ q) 行包含两个字符串 t j,1 , t j,2 ,表示小 W 提出的第 j个问题。【输出格式】输出到文件 replace.out 中。输出 q 行,其中第 j (1 ≤ j ≤ q) 行包含一个非负整数,表示替换后得到字符串 t j,2的字符串 t j,1 的替换的数量。【样例 1 输入】1 4 22 xabcx xadex3 ab cd4 bc de第 8 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证5 aa bb6 xabcx xadex7 aaaa bbbb提高级 谐音替换(replace)【样例 1 输出】1 22 0【样例 1 解释】对于小 W 的第一个询问,共有 2 种 t 1,1 的替换能够得到 t 1,2 :1. 令 x, z 均为空串,y = xabcx,i = 1,则 y ′ = xadex,替换后得到 xadex;2. 令 x = xa,y = bc,z = x,i = 3,则 y ′ = de,替换后得到 xadex。【样例 2 输入】1 3 42 a b3 b c4 c d5 aa bb6 aa b7 a c8 b a【样例 2 输出】1 02 03 04 0【样例 3】见选手目录下的 replace/replace3.in 与 replace/replace3.ans。该样例满足测试点 11, 12 的约束条件。第 9 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 谐音替换(replace)【样例 4】见选手目录下的 replace/replace4.in 与 replace/replace4.ans。该样例满足测试点 15, 16 的约束条件。【数据范围】设 L 1 =∑ ni=1 |s i,1 | + |s i,2 |,L 2 =∑ qj=1 |t j,1 |+ |t j,2 |。对于所有测试数据,保证:• 1 ≤ n, q ≤ 2 × 10 ;5• 2 ≤ L 1 , L 2 ≤ 5 × 10 6 ;• 对于所有 1 ≤ i ≤ n,s i,1 , s i,2 均仅包含小写英文字母,且 |s i,1 | = |s i,2 |;• 对于所有 1 ≤ j ≤ q,t j,1 , t j,2 均仅包含小写英文字母,且 t j,1 ̸ = t j,2 。测试点编号1, 23 ∼ 567, 8n, q ≤10210 310 4L 1 , L 2 ≤2002, 000无AB10 6AB9, 102 × 10 611, 1213, 14特殊性质2 × 10 5A5 × 1015, 16无617 ∼ 20B无特殊性质 A:q = 1。特殊性质 B:定义字符串 s 为 特s 仅包含字符 a 和 b,且. 别. 的,当且仅当字符串.字符 b 在 s 中出现 恰1 ≤ i ≤ n,s i,1 , s i,2 均为特别的,且对于所有. 好一次。对于所有.1 ≤ j ≤ q,t j,1 , t j,2 均为特别的。第 10 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 员工招聘(employ)员工招聘(employ)【题目描述】小 Z 和小 H 想要合伙开一家公司,共有 n 人前来应聘,编号为 1 ∼ n。小 Z 和小H 希望录用至少 m 人。小 H 是面试官,将在接下来 n 天每天面试一个人。小 Z 负责决定应聘人前来面试的顺序。具体地,小 Z 可以选择一个 1 ∼ n 的排列 p,然后在第 i (1 ≤ i ≤ n) 天通知编号为 p i 的人前来面试。小 H 准备了 n 套难度不一的面试题。由于 n 个前来应聘的人水平大致相同,因此对于同一套题,所有人的作答结果是一致的。具体地,第 i (1 ≤ i ≤ n) 天的面试题的难度为 s i ∈ {0, 1},其中 s i = 0 表示这套题的难度较高,没有人能够做出;s i = 1 表示这套题的难度较低,所有人均能做出。小 H 会根据面试者的作答结果决定是否录用,即如果面试者没有做出面试题,则会拒绝,否则会录用。然而,每个人的耐心都有一定的上限,如果在他面试之前未录用的人数过多,则他会直接放弃参加面试。具体地,编号为 i (1 ≤ i ≤ n) 的人的耐心上限可以用非负整数 c i描述,若在他之前已经有 不. 少. 于. c i 人被拒绝或放弃参加面试,则他也将放弃参加面试。小 Z 想知道一共有多少种面试的顺序 p 能够让他们录用至少 m 人。你需要帮助小Z 求出,能够录用至少 m 人的排列 p 的数量。由于答案可能较大,你只需要求出答案对 998, 244, 353 取模后的结果。【输入格式】从文件 employ.in 中读入数据。输入的第一行包含两个正整数 n, m,分别表示前来应聘的人数和希望录用的人数。输入的第二行包含一个长度为 n 的字符串 s 1 . . . s n ,表示每一天的面试题的难度。输入的第三行包含 n 个非负整数 c 1 , c 2 , . . . , c n ,表示每个人的耐心上限。【输出格式】输出到文件 employ.out 中。输出一行一个非负整数,表示能够录用至少 m 人的排列 p 的数量对 998, 244, 353取模后的结果。【样例 1 输入】1 3 22 1013 1 1 2第 11 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 员工招聘(employ)【样例 1 输出】12【样例 1 解释】共有以下 2 种面试的顺序 p 能够让小 Z 和小 H 录用至少 2 人:1. p = [1, 2, 3],依次录用编号为 1 的人和编号为 3 的人;2. p = [2, 1, 3],依次录用编号为 2 的人和编号为 3 的人。【样例 2 输入】1 10 52 11011110113 6 0 4 2 1 2 5 4 3 3【样例 2 输出】12204128【样例 3】见选手目录下的 employ/employ3.in 与 employ/employ3.ans。该样例满足测试点 6 ∼ 8 的约束条件。【样例 4】见选手目录下的 employ/employ4.in 与 employ/employ4.ans。该样例满足测试点 12 ∼ 14 的约束条件。【样例 5】见选手目录下的 employ/employ5.in 与 employ/employ5.ans。该样例满足测试点 18 ∼ 21 的约束条件。第 12 页共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证提高级 员工招聘(employ)【数据范围】对于所有测试数据,保证:• 1 ≤ m ≤ n ≤ 500;• 对于所有 1 ≤ i ≤ n,均有 s i ∈ {0, 1};• 对于所有 1 ≤ i ≤ n,均有 0 ≤ c i ≤ n。测试点编号 n ≤1, 2 103 ∼ 5 186 ∼ 8 29 ∼ 1110m无≤ n12 ∼ 14 =115 = n16, 17特殊性质无A50018 ∼ 21A≤ n22 ∼ 25B无特殊性质 A:对于所有 1 ≤ i ≤ n,均有 s i = 1。特殊性质 B:在 s 1 , s 2 , . . . , s n 中最多只有 18 个取值为 1,即第 13 页共 13 页∑ ni=1s i ≤ 18。*/```:::## JS-S00515:::info[[club.cpp] 密码锁再加一]```cppif(n==2){for(int i=1;i<=3;i++){for(int j=1;j<=3;j++){if(j!=i)ans=max(ans,a[1][i]+a[2][j]);}}cout<<ans<<endl;}else if(n==4){for(int i=1;i<=3;i++){for(int j=1;j<=3;j++){for(int k=1;k<=3;k++){for(int k1=1;k1<=3;k1++){if((i==j&&j==k)||(i==j&&j==k1)||(i==k&&k==k1)||(j==k&&k==k1))continue;ans=max(ans,a[1][i]+a[2][j]+a[3][k]+a[4][k1]);}}}}cout<<ans<<endl;}else{vector<int>b(n+1,0);for(int i=1;i<=n;i++)b[i]=a[i][1];sort(b.begin()+1,b.end(),cmp);cout<<b[1]+b[2]<<endl;}```:::## JS-S00516:::info[[club.cpp] 默哀]```cppfreopen("club2.in", "r", stdin);```:::## JS-S00518:::info[[road.cpp] saki,移动]```cppint main(){freopen("road.in","r",stdin);freopen("road.out","w",stdout);cout<<10086<<endl;return 0;}```:::## JS-S00522:::info[[club/employ/replace.cpp] woc,铁]```cpp//AD ASTRA PER ASPERA//i wanna ak``````cpp/*It's not easy so we should think it twice.We get the different part of each pair of (S1,S2) and (T1,T2)if a pair of (S1,S2) is the same we should ignore itThus, a pair of (T1,T2) can only match the pairs of (S1,S2) with the same difference of it.We hash the difference and put pairs into buckets by their difference.Insert the prefixes and suffixes into trie.3h could be enough for me, so I can get 300+.*/``````cpp//What's meant by miracle, a word outside my days?```:::## JS-S00593:::info[[employ.cpp] 焗雪梨好吃吗(&&@[wmyr](luogu://user/616733) is pretty]```cpp//ksmksmksmksmksmksm/*bu hui ying yu , jiu yong pin yin ba.ke neng shi zui hou yi ci csp le,noip 2025 rp++;wmyr is pretty.2025.11.01 17:30freopen("employ1.in","r",stdin);wei da de hyzx , chu le shi tang nan chi dao bao.zhe li ying gai you yi ge ju xue li biao qing bao zhi lei de ^(=w=^)~ , dan shi xian ran sai chang shang mei you zhe wan yi.*/```你要的,补上。:::--------------$1501\sim 1915$ author:[LuoFeng_Nanami](https://www.luogu.com.cn/user/759710)## JS-S01504210 行未改动全部展开int n;cin>>n;int a[n+5][4];for(inti=1;i<=n;i++){cin>>a[i][1]>>a[i][2]>>a[i][3] ; }intcnt[4]={0 },c[n+1],f[n+1];long long tot=0;for(int i=1;i<=n;i++){int m=max(a[i][1], max(a[i][2],a[i][3])); for(intj=1;j<=3;j++){if(a[i][j]==m)8 行未改动i][3]};sort(x,x+3); c[i]=x[2]-x[1];} /* for(inti=1;i<=n;i++){cout<<f[i]<<ppp;}cout<<endlpp>>>>>>*/for(int i=1;i<=3;i++){if(cnt[i]>n/2){int cn[cnt[i]+1];for(intj=1,k=1;j<=n;j++){if(f[j]==i){cn15 行未改动stdout);ACplzzz;}```获得了 $75$pts。::::::info[[employ.cpp] **I'm so bored**]```cpp16 行未改动using namespace std;#define NetEase 998244353int main(){freopen("employ.in","r",stdin);freopen("employ.out","w",stdout);int miHoYo,SEGA;cin>>miHoYo>>SEGA;string SONY;cin>>SONY;253 行未改动全部展开:::## JS-S01606:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] 没有人比我更懂 //freopen !][club.cpp]```cppint main(){// freopen("club.in","r"stdin);// freopen("club.out","w"stdout);cout<<"18"<<endl;cout<<"4"<<endl;cout<<"13"<<endl;return 0;}```[road.cpp]```cppint main(){// freopen("road.in","r"stdin);// freopen("road.out","w"stdout);cout<<"13"<<endl;return 0;}```[replace.cpp]```cppint main(){// freopen("replace.in","r"stdin);// freopen("replace.out","w"stdout);cout<<"2"<<endl;cout<<"0"<<endl;return 0;}```[employ.cpp]```cppint main(){// freopen("employ.in","r"stdin);// freopen("employ.out","w"stdout);cout<<"2"<<endl;return 0;}```:::## JS-S01634:::info[[road.cpp] **想从 ccf 身上捞一笔?**]```cpp//csp kao chang yu dao zhe zhong qing kuan ccf huei chu duo shao qian```66 行未改动return 0;}```三道题的代码都是这个。:::## JS-S01671:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] jy 姐姐下午好 /se]150 行未改动全部展开wo yao shang qi pa he ji!!!!!!!!!!! :(//freopen()//freopen()//freopen()//freopen()55 行未改动*/```:::## JS-S01747:::info[[club.cpp] 考场稳定发挥,那很好了]```cpp//Oh my god! I can see the problem only on 14:39!```:::73 行未改动```:::## JS-S01795:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] 所以我放弃了 stdin/stdout][club.cpp]```cppint main(){freopen("club.in","r");freopen("club.out","w");```[road.cpp]```cppint main(){freopen("road.in","r");freopen("road.out","w");```[replace.cpp]```cppint main(){freopen("replace.in","r");freopen("replace.out","w");```[employ.cpp]```cppint main(){freopen("employ.in","r");freopen("employ.out","w");```:::## JS-S01801:::info[[club.cpp/road.cpp/replace.cpp/employ.cpp] gzx 老师你好呀]```cpp49 行未改动