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. Servlet和JSP之有关Servlet和JSP的梳理(二)

    JSP JSP页面本质上是一个Servlet,JSP页面在JSP容器中运行,一个Servlet容器通常也是JSP容器. 当一个JSP页面第一次被请求时,Servlet/JSP容器主要做一下两件事情: ...

  2. leetcode_1095. Find in Mountain Array_[Binary Search]

    https://leetcode.com/problems/find-in-mountain-array/ 题意:给定一个MountainArray(定义见题目),找到其中最早出现的target值的下 ...

  3. 高精度A+B

    #include<stdio.h> #include<string.h> int main() { int lenth1,lenth2,n,i,j,k,s; scanf(&qu ...

  4. 数据库_4_SQL介绍

    SQL SQL:Structured Query Language,结构化查询语言(数据已查询为主:99%是在进行查询操作)    what型语言,而非how型的语言. SQL分为三个部分: DDL: ...

  5. vue 使用element-ui实现城市三级联动

    <template> <div> <el-select v-model="prov" style="width:167px;margin-r ...

  6. [HIHO] 1050 树中的最长路

    #1050 : 树中的最长路 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 上回说到,小Ho得到了一棵二叉树玩具,这个玩具是由小球和木棍连接起来的,而在拆拼它的过程中, ...

  7. usb3.0驱动

    usb3.0驱动下载地址 华硕注入usb3.0驱动工具下载地址 https://dlsvr04.asus.com/pub/ASUS/misc/utils/ASUS_EZInstaller_V10306 ...

  8. 【mysql】 load local data infield 报错 ERROR 1148 (42000): The used command is not allowed with this MySQL version

    mysql> load data local infile '/Users/flint/learn/mysql/pet' into table bx_pet; 执行报错 ERROR 1148 ( ...

  9. python爬虫入门七:pymysql库

    我们使用python爬取得到的数据,有时候会数据量特别大,需要存入数据库. 需要注意的是,MySQL是一种关系型数据库管理系统,利用MySQL可以对数据库进行操作,而MySQL并不是一个数据库. 而p ...

  10. Verilog学习笔记基本语法篇(八)········ 结构说明语句

    Verilog中的任何过程都可以属于以下四种结构的说明语句; 1) initial;  2) always;  3) task;   4) function; 1) initial说明语句: 一个程序 ...