CSGO

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)

Problem Description
You are playing CSGO.
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.
 
Input
Multiple query.
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
 
Output
Your output should include T lines, for each line, output the maximum evaluation for the corresponding datum.
 
Sample Input
2
2 2 1
0 233
0 666
0 123
0 456
2 2 1
100 0 1000 100 1000 100
100 0
 
Sample Output
543
2000
 

题意:求上面那个表达式的最大值。
这个表达式的后面很像曼哈顿距离,所以可以转换为求最远曼哈顿距离。
如何处理前面那两个正数:在每个点上再加一维,主武器权值为正,副武器权值为负。
如何让程序选的两个点分别在主武器集合和副武器集合里:更改主武器的某一维的权值,让其加上一个INF,这样选的最远曼哈顿距离肯定不会是同一个集合里的了,最后答案减去INF。
#include <stdio.h>
#define INF 100000000000
#define M 200005//坐标个数 int D = ;//空间维数
struct Point
{
long long x[];
}pt[M]; long long dis[<<][M],minx[<<],maxx[<<];//去掉绝对值后有2^D种可能
void Get(int N)//取得所有点在指定状态(S)下的“本点有效距离”
{
int tot=(<<D);
for(int s=;s<tot;s++)//遍历所有维数正负状态
{
int coe[D];
for(int i=;i<D;i++)//设定当前状态的具体正负参数
if(s&(<<i)) coe[i]=-1.0;
else coe[i]=1.0; for(int i=;i<N;i++)//遍历所有点,确定每个点在当前状态下的“本点有效距离”
{
dis[s][i]=;
for(int j=;j<D;j++)
dis[s][i]=dis[s][i]+coe[j]*pt[i].x[j];
}
}
}
//取每种可能中的最大差距
void Solve(int N)
{
int tot=(<<D);
long long tmp,ans;
for(int s=;s<tot;s++)
{
minx[s]=INF;
maxx[s]=-INF;
for(int i=;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=;
for(int s=;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+;
for(int i=;i<n;i++)
{
for(int j=;j<=k;j++)
{
scanf("%lld",&pt[i].x[j]);
}
pt[i].x[]+=INF;
} for(int i=;i<m;i++)
{
for(int j=;j<=k;j++)
{
scanf("%lld",&pt[i+n].x[j]);
}
pt[i+n].x[]=-pt[i+n].x[];
}
Get(n+m);
Solve(n+m);
}
return ;
}

CSGO的更多相关文章

  1. GJM : 用Unity模仿CSGO里的火焰效果 [转载]

    感谢您的阅读.喜欢的.有用的就请大哥大嫂们高抬贵手"推荐一下"吧!你的精神支持是博主强大的写作动力以及转载收藏动力.欢迎转载! 版权声明:本文原创发表于 [请点击连接前往] ,未经 ...

  2. 用Unity模仿CSGO里的火焰效果

    CSGO里的火焰效果和真实的情况比较像,能沿着遮挡物前进,如下是模仿效果. 思路比较简单,开始想的是一圈一圈发出去,但是前圈与后圈的联系不好做,换种思路,每个方向发射一条线,这样根据上一个位置的方位先 ...

  3. 2017 Multi-University Training Contest - Team 9 1003&&HDU 6163 CSGO【计算几何】

    CSGO Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Subm ...

  4. hdu 6435 CSGO(最大曼哈顿距离)

    题目链接 Problem Description You are playing CSGO. There are n Main Weapons and m Secondary Weapons in C ...

  5. 杭电多校第十场 hdu6435 CSGO 二进制枚举子集

    CSGO Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Subm ...

  6. 联盟周赛2019810 csgo (动态规划、不下降子序列)

    今天起晚了...就做了俩题 难受的一批... 题目描述 著名第一人称射击游戏 csgo 因其优秀的平衡性,爽快的射击感和科学的战术配比赢得了世界广大玩家的好评. 在一局游戏中,分为两个阵营,他们的目标 ...

  7. CSGO 服务端扩展插件开发记录之"DropClientReason"(1)

    最近开始接触到了CSGO这款游戏,还是老套路,就是想千方百计的从里面增添新的游戏功能,当然刚开始想做到游刃有余是有点困难, 跟之前做CS1.6的第三方开发一样,都得自己慢慢的摸索过来,纵然CSGO所使 ...

  8. CSGO项目

    #include <Windows.h> #include <sstream> #include <iostream> #include <math.h> ...

  9. 阿里云Centos7部署私人CSGO服务器

    大四毕业生,论文和答辩分别以1.8%的重复率和只答不辨的态度双双过关.现在就是在家等着学校发毕业证了.顺带学学驾驶...可是我这么一个喜欢折腾的人,怎么能够让自己接受这么无聊的咸鱼时光呢?因为这个寒假 ...

随机推荐

  1. ubuntu 14.04 配置java 1.8环境变量

    从官网上下载jdk 源文件,并解压 root@hett-PowerEdge-T30:/usr/local/src# tar -xzvf jdk-8u151-linux-x64.tar.gz 解压完成之 ...

  2. 在一个工程中同时使用Swift和Objective-C

    Swift 与 Objective-C 的兼容能力使你可以在同一个工程中同时使用两种语言.你可以用这种叫做 mix and match 的特性来开发基于混合语言的应用,可以用 Swfit 的最新特性实 ...

  3. python已安装好第三方库,pycharm import时仍标红的解决办法

    pip install pymysql之后导入import pymysql时候标红 发现 pymysql下方还是标红,不能正常导入 可以试用一下以下的办法 解决办法: 首先打开 Settings找到P ...

  4. ios软件设计中注意点

    1.取消系统自带渲染效果 2.取消屏幕旋转 3.项目中搜索丢失文件

  5. ios之UIActivityIndicatorView

    UIActivityIndicatorView和UIProgressView都继承自UIView,所以他们可以附属在其他视图上.UIActivityIndicatorView是一个进度提示器,显示一个 ...

  6. 如何让升级时AppleHDA不再折腾

    ---前提--- 1. 你得用 Clover 引导 (......) 2. 开启 kernelcache (开了也能 inject kext,还能patch kext,速度又快,为啥不开) 3. 你的 ...

  7. Leetcode 7 反转整数Reverse Integer

    给定一个 32 位有符号整数,将整数中的数字进行反转. 示例 1: 输入: 123 输出: 321  示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: 21 注意: ...

  8. js-DOM-css的className相关

    1.在非标准的浏览器,IE8及以下的浏览器不支持className的操作,包括getElementByClassName,addClassName,removeClassName;  2.getEle ...

  9. ajax以及文件上传的几种方式

    方式一:通过form表单中,html input 标签的“file”完成 # 前端代码uoload.html <form method="post" action=" ...

  10. (转)iOS开发之Pch预编译文件的创建

    本文转自 http://www.cnblogs.com/496668219long/p/4568265.html 在Xcode6之前,创建一个新工程xcode会在Supporting files文件夹 ...