JS-S00302
[club/road/replace/employ.cpp] 惊世智慧
#define x0 ak_cspj
#define x1 ak_csps
#define y0 ak_noi
#define y1 ak_noiJS-S00306
[replace.cpp] 听我说谢谢你
//Thanks CCF qwq;JS-S00311
[road.cpp] 匿名这一块
// Name: XK
// Identity: XXXXXXKKKKKKKK-xk-XXX-KKK-XKXKXKXKXKXKXK123456789X[replace.cpp] 同上
//XKXKXKXKXKXKXKXKKXKXKXKXKKXKX
//XKXKXKXKKXKXKXKXKKXKXKXKKXKXK
//XKXKXKXKXKXKXKKXKXKXKXKXKKXKXJS-S00320
[road/replace/employ] 砖 业 片 分,三题都在骗分但是没写文件
int 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
[employ.cpp] 西西艾副亦有情,给我五分行不行
//dear CCF,please give me 5 pointsJS-S00324
[road/replace/employ.cpp] 和 00320 坐一桌
//freopen("club.in","r",stdin);
//freopen("club.out","w",stdout);JS-S00326
[employ.cpp] rp++
//
// || |||||||||| |||||||||||
// || || || ||
// || || || || || ||
// |||| || || || ||
// || ||||||||||| |||||||||| ||||||||||
// || || || ||
// || || || ||
// || ||
// || ||
// || ||
//
//project Moon StartJS-S00330
[club.cpp] 这也有车迷
//tefosi[replace.cpp] 嘟嘟嘟嘟~
//dududuDuJS-S00331
[club/road/replace/employ.cpp] 小剧场+1
//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 was
Zhong1 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 live
a 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 time
to 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 coins
happily. 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 king
smiled 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 that
her 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 a
cough.
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 and
clever, 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 back
quickly. 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, my
dear daughter..."
*/JS-S00335
[club.cpp] 邮寄+1
/*
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 alogithm
Finally......
When I looked the content above the requires again,
I had found that was impoosible in this task......
*/JS-S00338
[club.cpp] 你说的对,但是研究科学的最佳方式是(逃
/*
置身天上之森
*/JS-S00346
[employ.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
[club.cpp] 不写文件+1
[employ.cpp] 神秘文件+1
freopen("employ3.in","r",stdin);JS-S00362
[employ.cpp] 自信骗分
cout<<rand()%mod<<"\n";JS-S00367
[road.cpp] 文件+1
//freopen("road.in","r",stdin);
//freopen("road.out","w",stdout);JS-S00369
[road.cpp] made mom
/* for(int i=0;i<1000;i++)
{
cout<<"CCF I made you mom!!!";
}
*/JS-S00374
[club.cpp] 大法师来了
// let me try force(dfs)!!!
// then write ji yi hua sou suoJS-S00391
[club/road/replace/employ.cpp] 逆天文件,club甚至连文件名都是错的
freopen("culb.ans","w",stdout);freopen("road.ans","w",stdout);JS-S00400
[replace/employ.cpp] I don’t know
printf("😡👎I don't know👎😡\n");JS-S00403
[road.cpp] wo bu hui a
//prim?
//wo bu hui a wwwww
//yao afo lJS-S00415
[road.cpp] 美术家+1
/*
~ ~ ~
| | |
| | |
___|___|___|___
/ \
\ /
\_____________/*/JS-S00419
[club.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
//ahhhhhh
//ccfnengduogeiwoyidianfenma[employ.cpp] 自信随机
//baolimaosifenhaitingduode
//suijishusuanfa!!JS-S00429
[club.cpp] 循环展开???
if(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
[road.cpp] road1.in
freopen("road1.in","r",stdin);JS-S00447
[road/replace/employ.cpp] 默哀
//freopen("road.in","w",stdin);JS-S00454
[replace.cpp] 默哀+1
//freopen("replace.in","r",stdin);JS-S00455
[club.cpp] 卡哇伊
//(QWQ) (^_^) =) =( (qwq) (QAQ) ( !&@#!& )( !&)!!& ) (*_*) (*o*) (^o^) ($o$) ($_$)JS-S00456
[club/road/replace/employ.cpp] 六条戒律哪够,来个 条
/*
1. keep calm, one mistake can't ruin ur test, but mental breakdown can
2. read the problem carefully, at least twice
3. think calmly: think twice code once, think once code forever
4. check freopen and filename
5. array limits, corner cases(0), int/long long overflow, init if multicases
6. trust urself, u r the best version of urself, don't compare with others
that one day, when we look back, we will be amazed by how far we've comed!
*/JS-S00468
[club.cpp] 密码锁这一块
if(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
[club/road/replace/employ.cpp] 膜拜来了
//mo bai xst dalao
//mo bai wyx dalao
//mo bai cyh dalao
//I AK IOI
//Ren5Jie4Di4Ling5%JS-S00479
[club.cpp] ready for afo
//t2 zhale.
//ready for afo.JS-S00493
[club.cpp] 循环展开喜加一
if(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
[club.cpp] 给初赛 pts 的卡头了
//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 baoJS-S00503
[club.cpp] 密码锁+1
if(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
[road.cpp] 卡常大师
看到回复一下,好奇过没过orz
/*
kkksc03 orz orz orz Orz Orz Orz Orz Orz Orz
999ms 998ms
*/JS-S00513
[road.cpp] pdf大手子
部分与原题面不符的为lg关键字屏蔽,与作者无关
/*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 3
2 4
3 4 2 1
4 3 2 4
5 5 3 4
6 3 5 1
7 4
第 2 页
共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证
8 0 1 0
9 0 1 0
10 0 2 0
11 0 2 0
12 2
13 10 9 8
14 4 0 0
提高级 社团招新(club)
【样例 1 输出】
1 18
2 4
3 13
【样例 1 解释】
该样例共包含三组测试数据。
对于第一组测试数据,可以将四个新成员分别分配到第 1, 3, 1, 2 个部门,则三个部
门的新成员数量分别为 2, 1, 1,均不超过
4
2
= 2,满意度为 4 + 4 + 5 + 5 = 18。
对于第二组测试数据,可以将四个新成员分别分配到第 1, 1, 2, 2 个部门,则三个部
门的新成员数量分别为 2, 2, 0,均不超过
4
2
= 2,满意度为 0 + 0 + 2 + 2 = 4。
对于第三组测试数据,可以将两个新成员分别分配到第 2, 1 个部门,则三个部门的
新成员数量分别为 1, 1, 0,均不超过
2
2
= 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 2
2 4
3, 4 10
5 ∼ 8 30
9
10, 11
特殊性质
200
15, 16
B
无
A
12
13, 14
无
10 5
17 ∼ 20
B
C
无
特殊性质 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 2
2 1 4 6
3 2 3 7
4 4 2 5
5 4 3 4
6 1 1 8 2 4
第 5 页
共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证
7
提高级 道路修复(road)
100 1 3 2 4
【样例 1 输出】
1
13
【样例 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, 6
7, 8
9, 10
11, 12
5
10 3
10 6
15, 16
17, 18
10
4
21 ∼ 25
无
A
无
13, 14
19, 20
A
10 5
10
5
10
A
无
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 2
2 xabcx xadex
3 ab cd
4 bc de
第 8 页
共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证
5 aa bb
6 xabcx xadex
7 aaaa bbbb
提高级 谐音替换(replace)
【样例 1 输出】
1 2
2 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 4
2 a b
3 b c
4 c d
5 aa bb
6 aa b
7 a c
8 b a
【样例 2 输出】
1 0
2 0
3 0
4 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 =
∑ n
i=1 |s i,1 | + |s i,2 |,L 2 =
∑ q
j=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, 2
3 ∼ 5
6
7, 8
n, q ≤
10
2
10 3
10 4
L 1 , L 2 ≤
200
2, 000
无
AB
10 6
A
B
9, 10
2 × 10 6
11, 12
13, 14
特殊性质
2 × 10 5
A
5 × 10
15, 16
无
6
17 ∼ 20
B
无
特殊性质 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 2
2 101
3 1 1 2
第 11 页
共 13 页2025 CCF 非专业级软件能力认证 CSP-J/S 2025 第二轮认证
提高级 员工招聘(employ)
【样例 1 输出】
1
2
【样例 1 解释】
共有以下 2 种面试的顺序 p 能够让小 Z 和小 H 录用至少 2 人:
1. p = [1, 2, 3],依次录用编号为 1 的人和编号为 3 的人;
2. p = [2, 1, 3],依次录用编号为 2 的人和编号为 3 的人。
【样例 2 输入】
1 10 5
2 1101111011
3 6 0 4 2 1 2 5 4 3 3
【样例 2 输出】
1
2204128
【样例 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 10
3 ∼ 5 18
6 ∼ 8 2
9 ∼ 11
10
m
无
≤ n
12 ∼ 14 =1
15 = n
16, 17
特殊性质
无
A
500
18 ∼ 21
A
≤ n
22 ∼ 25
B
无
特殊性质 A:对于所有 1 ≤ i ≤ n,均有 s i = 1。
特殊性质 B:在 s 1 , s 2 , . . . , s n 中最多只有 18 个取值为 1,即
第 13 页
共 13 页
∑ n
i=1
s i ≤ 18。
*/JS-S00515
[club.cpp] 密码锁再加一
if(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
[club.cpp] 默哀
freopen("club2.in", "r", stdin);JS-S00518
[road.cpp] saki,移动
int main()
{
freopen("road.in","r",stdin);
freopen("road.out","w",stdout);
cout<<10086<<endl;
return 0;
}JS-S00522
[club/employ/replace.cpp] woc,铁
//AD ASTRA PER ASPERA
//i wanna ak/*
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 it
Thus, 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+.
*///What's meant by miracle, a word outside my days?JS-S00528
[employ.cpp] 疑似月老
//Devil_donna plz give me power to fight against evil Chi-Chi-Fan Chi-Shu_Pian contest.
//yzy&myh 99 hzc&gjh 99 wjh&bubble fish 99 gtl&??? 99
//A: people that not come equals to ???.
//s[i]==0 equals to force a[i]=0.
//wo zhi neng yong yuan du zhe dui baiJS-S00593
[employ.cpp] 焗雪梨好吃吗(&&@wmyr is pretty
//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:30
freopen("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.
*/你要的,补上。
