pta 7-10 ZZU联盟 (25分) 简单题

2018年11月3日,万众瞩目的英雄联盟S8世界赛总决赛在韩国仁川开打,8年来第一次同组两支战队在总决赛争夺冠军,IG和FNC的对决引玩家期待。最终S8世界赛冠军诞生!IG3:0击溃FNC拿下胜利!中国LOL拿下世界冠军!

ig.jpg

ACM-ICPC实验室(对编程、算法感兴趣的小伙伴欢迎加QQ群号:562888278)的成员得知消息后激动不已,决定自己开发一款游戏——ZZU联盟。小J是负责每场比赛后MVP评选模块设计的,如何根据每个队员在游戏中的表现,评选出当场的MVP难住了他,需要你来帮忙。在真实的LOL游戏中,MVP的评选涉及伤害输出、承受伤害与死亡比、平均每分钟获得金钱、对塔伤害 10%、大小龙及野怪的控制、对敌方的控制时间 2.5%、技能躲闪与命中、多杀、连杀、团队装与团队贡献(团战效率比)、支援效率(参团率)、所用英雄位置与熟练度预期(游戏默认)、KDA(击杀Kill、死亡Death、助攻Assist)等等好多因素。而ZZU联盟在其第一个版本中,决定先不考虑那么复杂,采用的评选指标如下:

(1)伤害输出值 Dps (0 =< Dps <= 50000)

(2)累计获得金钱数 M (0 =< M <= 30000)

(3)对塔伤害 Tow (0 =< Tow <= 10000)

(4)支援率 S (0 =< S <= 100)

(5)击杀K、死亡D、助攻A (0 =< K, D, A <= 30)

其中,每个值都为整数。

最终,对于每个选手都有一个MVP候选值(双精度实数)

V = Dps/50000 + M / 30000 + Tow / 10000 + S / 100 + (K + A) / (D+1)

而MVP获得者是获胜方中V值最大的玩家,数据保证每场比赛的MVP是唯一的。
输入格式:

第一行一个整数T(1=<T<=200),表示接下来共有T组测试数据

对于每组测试数据来说,

第一行, win/lose,表示蓝色军团获胜/失败 接下来5行,分别为5名玩家的赛后指标统计值,其中每一行的格式都为

玩家ID Dps M Tow S K D A(玩家ID字符长度不超过20,所有内容全用空格隔开)

紧接着一行为win/lose,表示紫色军团获胜/失败

接下来5行同样为紫色军团中5名玩家的战绩,格式同样为

玩家ID Dps M Tow S K D A
输出格式:

T行,对于每组测试数据,输出该场比赛Mvp选手的玩家ID
输入样例:

2
win
zxy 23197 13453 8636 61 6 3 3
fxr 12155 9854 8769 57 2 4 10
sgl 21232 23717 5215 67 24 23 25
cy 8268 201 3151 21 0 27 8
lzh 22306 15051 6246 54 22 28 5
lose
chj 16800 14340 4185 90 19 20 23
cwc 2646 1759 6548 60 0 7 5
wjk 11467 951 9615 52 4 16 11
lmc 29038 11256 173 64 8 3 3
lx 4686 11291 2677 77 16 26 22
lose
lzl 7670 14713 4174 42 6 23 7
gy 13955 5514 5087 91 15 29 4
sq 253 4773 7454 13 9 6 1
gxb 32055 7682 6093 83 16 7 26
gxh 24687 12611 3652 70 10 25 29
win
zyj 5074 12640 1414 64 29 8 6
hzy 23484 20429 6293 54 22 16 2
hzp 14823 20893 448 58 9 9 10
sjf 13059 6451 2344 72 5 13 17
tjt 26347 13267 5171 46 6 23 15

输出样例:

zxy
zyj

注:由于获取游戏的真实统计数据较为复杂,以上数据可能不一定完全符合真实情况,但是对于题目求解来说不影响。
作者
吴云鹏
单位
郑州大学
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB


简单题,题目长会劝退不想读题的懒人,乱搞就完事了


#ifdef debug
#include <time.h>
#include "win_majiao.h"
#endif

#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>

#define MAXN ((int)1e5+7)
#define ll long long int
#define INF (0x7f7f7f7f)
#define QAQ (0)

using namespace std;
typedef vector<vector<int> > VVI;

#define show(x...) \
	do { \
		cout << "[" << #x << " -> "; \
		err(x); \
	} while (0)

void err() { cout << "]" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }

namespace FastIO{

	char print_f[105];
	void read() {}
	void print() { putchar('\n'); }

	template <typename T, typename... T2>
	   inline void read(T &x, T2 &... oth) {
		   x = 0;
		   char ch = getchar();
		   ll f = 1;
		   while (!isdigit(ch)) {
			   if (ch == '-') f *= -1; 
			   ch = getchar();
		   }
		   while (isdigit(ch)) {
			   x = x * 10 + ch - 48;
			   ch = getchar();
		   }
		   x *= f;
		   read(oth...);
	   }
	template <typename T, typename... T2>
	   inline void print(T x, T2... oth) {
		   ll p3=-1;
		   if(x<0) putchar('-'), x=-x;
		   do{
				print_f[++p3] = x%10 + 48;
		   } while(x/=10);
		   while(p3>=0) putchar(print_f[p3--]);
		   putchar(' ');
		   print(oth...);
	   }
} // namespace FastIO
using FastIO::print;
using FastIO::read;

int n, m, Q, K;

struct Node {
	string name;
	double Dps, M, Tow, S, K, D, A;
	double calc() {
		double V = Dps/50000 + M / 30000 + Tow / 10000 + S / 100 + (K + A) / (D+1);
		return V;
	}
} ;

bool cmp(Node& x, Node& y) { return x.calc() < y.calc(); }

signed main() {
#ifdef debug
	freopen("test.txt", "r", stdin);
	clock_t stime = clock();
#endif
	cin >> Q;
	while(Q--) {
		int p = 2, doit = 0;
		string win;
		vector<Node> vec;
		while(p--) {
			cin >> win;
			doit = (win == "win");
			Node no;
			for(int i=1; i<=5; i++) {
				cin >> no.name >> no.Dps >> no.M >> no.Tow >> no.S >> no.K >> no.D >> no.A;
				if(doit) {
					vec.push_back(no);
				}
			}
		}
		sort(vec.begin(), vec.end(), cmp);
		cout << vec.back().name << endl;
	}





#ifdef debug
	clock_t etime = clock();
	printf("rum time: %lf 秒\n",(double) (etime-stime)/CLOCKS_PER_SEC);
#endif 
	return 0;
}




  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
BP神经网络类程序是一种用于图像类的程序,可以参考学习。不过需要注意的是,神经网络需要大量的样本才能得到较高的类精度,而这个程序只有十个样本,因此类精度可能不够高。程序使用MATLAB建立了一个具有3个输入值和4个隐藏层的神经网络结构。训练参数设置为最大迭代次数为1000次,训练目标为10-3,学习率为0.01。程序的具体实现和设计参考资料可以在目录中找到。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [BP神经网络类程序](https://download.csdn.net/download/wn123/3851356)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [模式类识别 | BP神经网络多特征类预测(Matlab完整程序)](https://blog.csdn.net/m0_57362105/article/details/128011186)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [基于BP神经网络的类](https://blog.csdn.net/zzu_seu/article/details/90321695)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值