博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
魔兽1 -备战
阅读量:6299 次
发布时间:2019-06-22

本文共 12008 字,大约阅读时间需要 40 分钟。

写得虚脱,然而欣慰的是,它挺短 【捂脸】,最后debug,发现竟然是Case 首字母忘记大写......这告诉我们一个道理,要看清题目,注意细节 qwq

 

随手奉上测试数据~   如果都正确应该就没问题了!

//input

7

20

3 4 5 6 7

40

3 14 5 6 7

30

40 50 60 70 80

100

10 20 30 40 50

400

20 3 300 60 98

1000

332 90 47 8989 83

5000

200 400 6 70 20

 

//output:

 

Case:1

000 red iceman 1 born with strength 5,1 iceman in red headquarter
000 blue lion 1 born with strength 6,1 lion in blue headquarter
001 red lion 2 born with strength 6,1 lion in red headquarter
001 blue dragon 2 born with strength 3,1 dragon in blue headquarter
002 red wolf 3 born with strength 7,1 wolf in red headquarter
002 blue ninja 3 born with strength 4,1 ninja in blue headquarter
003 red headquarter stops making warriors
003 blue iceman 4 born with strength 5,1 iceman in blue headquarter
004 blue headquarter stops making warriors
Case:2
000 red iceman 1 born with strength 5,1 iceman in red headquarter
000 blue lion 1 born with strength 6,1 lion in blue headquarter
001 red lion 2 born with strength 6,1 lion in red headquarter
001 blue dragon 2 born with strength 3,1 dragon in blue headquarter
002 red wolf 3 born with strength 7,1 wolf in red headquarter
002 blue ninja 3 born with strength 14,1 ninja in blue headquarter
003 red ninja 4 born with strength 14,1 ninja in red headquarter
003 blue iceman 4 born with strength 5,1 iceman in blue headquarter
004 red dragon 5 born with strength 3,1 dragon in red headquarter
004 blue wolf 5 born with strength 7,1 wolf in blue headquarter
005 red iceman 6 born with strength 5,2 iceman in red headquarter
005 blue dragon 6 born with strength 3,2 dragon in blue headquarter
006 red headquarter stops making warriors
006 blue headquarter stops making warriors
Case:3
000 red headquarter stops making warriors
000 blue headquarter stops making warriors
Case:4
000 red iceman 1 born with strength 30,1 iceman in red headquarter
000 blue lion 1 born with strength 40,1 lion in blue headquarter
001 red lion 2 born with strength 40,1 lion in red headquarter
001 blue dragon 2 born with strength 10,1 dragon in blue headquarter
002 red ninja 3 born with strength 20,1 ninja in red headquarter
002 blue ninja 3 born with strength 20,1 ninja in blue headquarter
003 red dragon 4 born with strength 10,1 dragon in red headquarter
003 blue iceman 4 born with strength 30,1 iceman in blue headquarter
004 red headquarter stops making warriors
004 blue headquarter stops making warriors
Case:5
000 red iceman 1 born with strength 300,1 iceman in red headquarter
000 blue lion 1 born with strength 60,1 lion in blue headquarter
001 red lion 2 born with strength 60,1 lion in red headquarter
001 blue dragon 2 born with strength 20,1 dragon in blue headquarter
002 red ninja 3 born with strength 3,1 ninja in red headquarter
002 blue ninja 3 born with strength 3,1 ninja in blue headquarter
003 red dragon 4 born with strength 20,1 dragon in red headquarter
003 blue iceman 4 born with strength 300,1 iceman in blue headquarter
004 red ninja 5 born with strength 3,2 ninja in red headquarter
004 blue ninja 5 born with strength 3,2 ninja in blue headquarter
005 red ninja 6 born with strength 3,3 ninja in red headquarter
005 blue ninja 6 born with strength 3,3 ninja in blue headquarter
006 red ninja 7 born with strength 3,4 ninja in red headquarter
006 blue ninja 7 born with strength 3,4 ninja in blue headquarter
007 red ninja 8 born with strength 3,5 ninja in red headquarter
007 blue ninja 8 born with strength 3,5 ninja in blue headquarter
008 red ninja 9 born with strength 3,6 ninja in red headquarter
008 blue ninja 9 born with strength 3,6 ninja in blue headquarter
009 red headquarter stops making warriors
009 blue headquarter stops making warriors
Case:6
000 red iceman 1 born with strength 47,1 iceman in red headquarter
000 blue dragon 1 born with strength 332,1 dragon in blue headquarter
001 red wolf 2 born with strength 83,1 wolf in red headquarter
001 blue ninja 2 born with strength 90,1 ninja in blue headquarter
002 red ninja 3 born with strength 90,1 ninja in red headquarter
002 blue iceman 3 born with strength 47,1 iceman in blue headquarter
003 red dragon 4 born with strength 332,1 dragon in red headquarter
003 blue wolf 4 born with strength 83,1 wolf in blue headquarter
004 red iceman 5 born with strength 47,2 iceman in red headquarter
004 blue dragon 5 born with strength 332,2 dragon in blue headquarter
005 red wolf 6 born with strength 83,2 wolf in red headquarter
005 blue ninja 6 born with strength 90,2 ninja in blue headquarter
006 red ninja 7 born with strength 90,2 ninja in red headquarter
006 blue headquarter stops making warriors
007 red iceman 8 born with strength 47,3 iceman in red headquarter
008 red wolf 9 born with strength 83,3 wolf in red headquarter
009 red ninja 10 born with strength 90,3 ninja in red headquarter
010 red headquarter stops making warriors
Case:7
000 red iceman 1 born with strength 6,1 iceman in red headquarter
000 blue lion 1 born with strength 70,1 lion in blue headquarter
001 red lion 2 born with strength 70,1 lion in red headquarter
001 blue dragon 2 born with strength 200,1 dragon in blue headquarter
002 red wolf 3 born with strength 20,1 wolf in red headquarter
002 blue ninja 3 born with strength 400,1 ninja in blue headquarter
003 red ninja 4 born with strength 400,1 ninja in red headquarter
003 blue iceman 4 born with strength 6,1 iceman in blue headquarter
004 red dragon 5 born with strength 200,1 dragon in red headquarter
004 blue wolf 5 born with strength 20,1 wolf in blue headquarter
005 red iceman 6 born with strength 6,2 iceman in red headquarter
005 blue lion 6 born with strength 70,2 lion in blue headquarter
006 red lion 7 born with strength 70,2 lion in red headquarter
006 blue dragon 7 born with strength 200,2 dragon in blue headquarter
007 red wolf 8 born with strength 20,2 wolf in red headquarter
007 blue ninja 8 born with strength 400,2 ninja in blue headquarter
008 red ninja 9 born with strength 400,2 ninja in red headquarter
008 blue iceman 9 born with strength 6,2 iceman in blue headquarter
009 red dragon 10 born with strength 200,2 dragon in red headquarter
009 blue wolf 10 born with strength 20,2 wolf in blue headquarter
010 red iceman 11 born with strength 6,3 iceman in red headquarter
010 blue lion 11 born with strength 70,3 lion in blue headquarter
011 red lion 12 born with strength 70,3 lion in red headquarter
011 blue dragon 12 born with strength 200,3 dragon in blue headquarter
012 red wolf 13 born with strength 20,3 wolf in red headquarter
012 blue ninja 13 born with strength 400,3 ninja in blue headquarter
013 red ninja 14 born with strength 400,3 ninja in red headquarter
013 blue iceman 14 born with strength 6,3 iceman in blue headquarter
014 red dragon 15 born with strength 200,3 dragon in red headquarter
014 blue wolf 15 born with strength 20,3 wolf in blue headquarter
015 red iceman 16 born with strength 6,4 iceman in red headquarter
015 blue lion 16 born with strength 70,4 lion in blue headquarter
016 red lion 17 born with strength 70,4 lion in red headquarter
016 blue dragon 17 born with strength 200,4 dragon in blue headquarter
017 red wolf 18 born with strength 20,4 wolf in red headquarter
017 blue ninja 18 born with strength 400,4 ninja in blue headquarter
018 red ninja 19 born with strength 400,4 ninja in red headquarter
018 blue iceman 19 born with strength 6,4 iceman in blue headquarter
019 red dragon 20 born with strength 200,4 dragon in red headquarter
019 blue wolf 20 born with strength 20,4 wolf in blue headquarter
020 red iceman 21 born with strength 6,5 iceman in red headquarter
020 blue lion 21 born with strength 70,5 lion in blue headquarter
021 red lion 22 born with strength 70,5 lion in red headquarter
021 blue dragon 22 born with strength 200,5 dragon in blue headquarter
022 red wolf 23 born with strength 20,5 wolf in red headquarter
022 blue ninja 23 born with strength 400,5 ninja in blue headquarter
023 red ninja 24 born with strength 400,5 ninja in red headquarter
023 blue iceman 24 born with strength 6,5 iceman in blue headquarter
024 red dragon 25 born with strength 200,5 dragon in red headquarter
024 blue wolf 25 born with strength 20,5 wolf in blue headquarter
025 red iceman 26 born with strength 6,6 iceman in red headquarter
025 blue lion 26 born with strength 70,6 lion in blue headquarter
026 red lion 27 born with strength 70,6 lion in red headquarter
026 blue dragon 27 born with strength 200,6 dragon in blue headquarter
027 red wolf 28 born with strength 20,6 wolf in red headquarter
027 blue ninja 28 born with strength 400,6 ninja in blue headquarter
028 red ninja 29 born with strength 400,6 ninja in red headquarter
028 blue iceman 29 born with strength 6,6 iceman in blue headquarter
029 red dragon 30 born with strength 200,6 dragon in red headquarter
029 blue wolf 30 born with strength 20,6 wolf in blue headquarter
030 red iceman 31 born with strength 6,7 iceman in red headquarter
030 blue lion 31 born with strength 70,7 lion in blue headquarter
031 red lion 32 born with strength 70,7 lion in red headquarter
031 blue dragon 32 born with strength 200,7 dragon in blue headquarter
032 red wolf 33 born with strength 20,7 wolf in red headquarter
032 blue ninja 33 born with strength 400,7 ninja in blue headquarter
033 red ninja 34 born with strength 400,7 ninja in red headquarter
033 blue iceman 34 born with strength 6,7 iceman in blue headquarter
034 red dragon 35 born with strength 200,7 dragon in red headquarter
034 blue wolf 35 born with strength 20,7 wolf in blue headquarter
035 red iceman 36 born with strength 6,8 iceman in red headquarter
035 blue lion 36 born with strength 70,8 lion in blue headquarter
036 red lion 37 born with strength 70,8 lion in red headquarter
036 blue iceman 37 born with strength 6,8 iceman in blue headquarter
037 red wolf 38 born with strength 20,8 wolf in red headquarter
037 blue wolf 38 born with strength 20,8 wolf in blue headquarter
038 red iceman 39 born with strength 6,9 iceman in red headquarter
038 blue iceman 39 born with strength 6,9 iceman in blue headquarter
039 red wolf 40 born with strength 20,9 wolf in red headquarter
039 blue wolf 40 born with strength 20,9 wolf in blue headquarter
040 red iceman 41 born with strength 6,10 iceman in red headquarter
040 blue iceman 41 born with strength 6,10 iceman in blue headquarter
041 red headquarter stops making warriors
041 blue headquarter stops making warriors

 

#include 
#include
#include
#include
using namespace std;class Headquarter{ char NAME[5]; int Wlife[5]; char WName[5][10]; int WNum[5]={
0}; int WRemain[5]={
0}; int Tolife; int t=0,Min; int r=0; int num=0; int* pw=Wlife; int* pw1=Wlife; public: int stop=0,d=0; Headquarter(int* W_life,char* W_name[],int Tol_life,char* name,int n){ Min = n; strcpy(NAME,name); Tolife=Tol_life; for(int i=0;i<5;i++){ Wlife[i]=W_life[i]; strcpy(WName[i],W_name[i]); } } void begin(){ if(Tolife>=Min){ for(r=0;r<5;r++){ if(pw-pw1>4){ pw -=5; } if(Tolife>=*pw){ Tolife -= *pw; num++; WNum[pw-pw1]++; WRemain[pw-pw1]++; print1(); t++; pw++; break; } pw++; } } else{ if(d==0){ print2(); } } } void print1(){ int r = pw-pw1; cout.fill('0'); cout.width(3); cout<
>n; int stop; for(int i=0;i
>M; for(r=0;r<5;r++){ cin>>Warrior[r]; } MIN = Warrior[0]; for(r=1;r<5;r++){ if(Warrior[r]

 

转载于:https://www.cnblogs.com/Latticeeee/p/8604429.html

你可能感兴趣的文章
ES6新特性概览
查看>>
如何下载oschina源码并打包到maven本地仓库
查看>>
使用maven时出现Failure to transfer 异常的解决办法
查看>>
作业3 :JSP指令与动作熟悉
查看>>
Nginx配置文件nginx.conf
查看>>
第n位数 Nth Digit
查看>>
【原创】RabbitMQ 之 Distributed brokers(翻译)
查看>>
又一堆废话!
查看>>
rmi初步----安全管理器的使用
查看>>
ListView中重写overScrollBy()方法 实现拉出回弹结果
查看>>
ASP.NET MVC 多语言方案
查看>>
外部脚本调用 django 中的 Model
查看>>
一个网工的Linux学习过程
查看>>
ngrok
查看>>
mysql启动失败
查看>>
Curl是Linux下一个很强大的http命令行工具,其功能十分强大。
查看>>
查看那个进程占用了8080端口-windows
查看>>
freeipa 管理 nfs 配置
查看>>
数据库优化
查看>>
Cocos2d-x Lua Bindings 各种配置备忘
查看>>