CSGO
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CSGO,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3162字,纯文字阅读大概需要5分钟。
内容图文
CSGO
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
There are n Main Weapons and m Secondary Weapons in CSGO. You can only choose one Main Weapon and one Secondary Weapon. For each weapon, it has a composite score S.
The higher the composite score of the weapon is, the better for you.
Also each weapon has K performance evaluations x[1], x[2], …, x[K].(range, firing rate, recoil, weight…)
So you shold consider the cooperation of your weapons, you want two weapons that have big difference in each performance, for example, AWP + CZ75 is a good choose, and so do AK47 + Desert Eagle.
All in all, you will evaluate your weapons by this formula.(MW for Main Weapon and SW for Secondary Weapon)
Now you have to choose your best Main Weapon & Secondary Weapon and output the maximum evaluation.
On the first line, there is a positive integer T, which describe the number of data. Next there are T groups of data.
for each group, the first line have three positive integers n, m, K.
then, the next n line will describe n Main Weapons, K+1 integers each line S, x[1], x[2], …, x[K]
then, the next m line will describe m Secondary Weapons, K+1 integers each line S, x[1], x[2], …, x[K]
There is a blank line before each groups of data.
T<=100, n<=100000, m<=100000, K<=5, 0<=S<=1e9, |x[i]|<=1e9, sum of (n+m)<=300000
#include <stdio.h> #define INF 100000000000 #define M 200005//坐标个数int D = 6;//空间维数struct Point { longlong x[6]; }pt[M]; longlong dis[1<<6][M],minx[1<<6],maxx[1<<6];//去掉绝对值后有2^D种可能void Get(int N)//取得所有点在指定状态(S)下的“本点有效距离”{ int tot=(1<<D); for(int s=0;s<tot;s++)//遍历所有维数正负状态 { int coe[D]; for(int i=0;i<D;i++)//设定当前状态的具体正负参数if(s&(1<<i)) coe[i]=-1.0; else coe[i]=1.0; for(int i=0;i<N;i++)//遍历所有点,确定每个点在当前状态下的“本点有效距离” { dis[s][i]=0; for(int j=0;j<D;j++) dis[s][i]=dis[s][i]+coe[j]*pt[i].x[j]; } } } //取每种可能中的最大差距void Solve(int N) { int tot=(1<<D); longlong tmp,ans; for(int s=0;s<tot;s++) { minx[s]=INF; maxx[s]=-INF; for(int i=0;i<N;i++) { if (minx[s]>dis[s][i]) minx[s]=dis[s][i]; if (maxx[s]<dis[s][i]) maxx[s]=dis[s][i]; } } ans=0; for(int s=0;s<tot;s++) { tmp=maxx[s]-minx[s]; if(tmp>ans) ans=tmp; } printf("%lld\n", ans-INF); } int main() { int t; scanf("%d",&t); while(t--) { int n,m,k; scanf("%d %d %d",&n,&m,&k); D=k+1; for(int i=0;i<n;i++) { for(int j=0;j<=k;j++) { scanf("%lld",&pt[i].x[j]); } pt[i].x[0]+=INF; } for(int i=0;i<m;i++) { for(int j=0;j<=k;j++) { scanf("%lld",&pt[i+n].x[j]); } pt[i+n].x[0]=-pt[i+n].x[0]; } Get(n+m); Solve(n+m); } return0; }
原文:https://www.cnblogs.com/tian-luo/p/9519978.html
内容总结
以上是互联网集市为您收集整理的CSGO全部内容,希望文章能够帮你解决CSGO所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。