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. activeandroid复制本地数据库问题总结

    activeandroid no such table 解决activeandroid no such table failed to read row 0 column 1 from a curso ...

  2. SQLite基础教程目录

    SQLite基础教程目录 SQLite主页 SQLite概述 SQLite -安装 SQLite -命令 SQLite -语法 SQLite -数据类型 SQLite -创建数据库 SQLite -附 ...

  3. Objective-C相关Category的收集(更新)

    Categories是给你得不到源码的classes增加功能的一种方法.这个页面收集一些相关的Category,并且持续更新,你可以订阅关注.作者是Fille ?str?m,是@ IMGNRY的联合创 ...

  4. Dijkstra算法——单源最短路算法

    一.介绍 迪杰斯特拉(Dijkstra)算法是典型最短路径算法,用于计算一个节点到其他各个节点的最短路径. 它的主要特点是以起始点为中心向外层层扩展(广度优先搜索思想),直到扩展到终点为止. 适用于有 ...

  5. nodejs:遍历文件夹文件统计文件大小

    根据 http://blog.csdn.net/hero82748274/article/details/45700465这里的思路对读写文件做了一个 封装: webpack在打包的时候可以借助ass ...

  6. leetcode_day1

    1.给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标. 你可以假设每种输入只会对应一个答案.但是,你不能重复利用这个数组中同样 ...

  7. |chromosomal walk |zoo blot|鉴定疾病gene|

    5.6基于外显子的保守性鉴定真核生物编码蛋白质的基因 鉴定功能性基因的流程是:1.连锁分析找到该基因的染色体的特定区域:2.在这段序列中选择一条短序列,寻找满足两个条件的基因(条件一:因为功能性基因是 ...

  8. 看结果,测试?java中的String类 字符串拆分成字符串数组 判定邮箱地址 字符串比较 参数传递?

    看结果1? package com.swift; class ArrayString { public static void main(String[] args) { String str = & ...

  9. C++高精度乘法

    #include <cstdio> #include <iostream> #include <algorithm> void highPrecision (int ...

  10. OpenWrt 路由器如何让 lan 口主机获得 ipv6 网络访问 -- 知乎

    本文转自知乎: OpenWrt 路由器如何让 lan 口主机获得 ipv6 网络访问? - mistforest的回答 - 知乎https://www.zhihu.com/question/29667 ...