ZOj 3466 The Hive II】的更多相关文章

There is a hive in the village. Like this. There are 8 columns(from A to H) in this hive. Different colums have the same number of grids. Every grid has its own coordinate, which is formed by two uppercases, representing the row index and the column…
题意:有一个n*8的蜂房(6边形的格子),其中部分是障碍格子,其他是有蜂蜜的格子,每次必须走1个圈取走其中的蜂蜜,在每个格子只走1次,且所有蜂蜜必须取走,有多少种取法? 思路: 以前涉及的只是n*m的矩阵,也就是四边形的,现在变成了6边形,那么每个格子也就有6个方向可以出/进.为了方便考虑,将蜂房变成按列来扫,那么轮廓线需要2*n+1个插头信息.这里不需要用到括号表示法或者最小表示法,只需要表示该位置是否有线即可,所以每个插头仅需1个位就可以表示了. 转置一下后的蜂房应该是这样的: 轮廓线是一个…
题目链接: 题目 Escape Time II Time Limit: 20 Sec Memory Limit: 256 MB 问题描述 There is a fire in LTR ' s home again. The fire can destroy all the things in t seconds, so LTR has to escape in t seconds. But there are some jewels in LTR ' s rooms, LTR love jewe…
在了解别人hive能力水平的时候,不管是别人问我还是我了解别人,有一些都是必然会问的东西.问的问题也大都大同小异.这里总结一下我遇到的那些hive方面面试可能涉及的问题 1.行转列(列转行) 当我们建设数据仓库时,我们对来自OLAP的数据进行加工以便处理成维度模型.在维度模型设计的时候就需要面对这样的问题(其他时候可能也会用到) 数据准备 建表:create table shj_cnblogs(customer_id string,trans_year string,trans_amount i…
题目: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3356 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26732#problem/D Football Gambling II Time Limit: 3 Seconds      Memory Limit: 65536 KB The 2010 FIFA World Cup toke place betw…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4744 Escape Time II Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a fire in LTR ’ s home again. The fire can destroy all the things in t seconds, so LTR has to escape in t second…
Strange Country II Time Limit: 1 Second      Memory Limit: 32768 KB      Special Judge You want to visit a strange country. There are n cities in the country. Cities are numbered from 1 to n. The unique way to travel in the country is taking planes.…
题意: 输入数据n,m.n代表工厂的数量,m代表城市的数量. 接下来n+m行为工厂和城市的坐标. 规定如图所示方向刮风,工厂的air会污染风向地区的air. 注意,工厂和城市的坐标表示的是从x到x+1从y到y+1之间小正方形都是工厂区域,规定如果只有一个coner的air被污染那么该地区视为无污染. 要求输出有多少不被污染的城市. 坑: 思考了很多问题.... 1.加入某城市的正下方是工厂怎么办...这个是否算污染. 2.假如有两个角被污染了怎么办...算污染吗. 坑了一整天.没办法找大神的代码…
本文出自   http://blog.csdn.net/shuangde800 题目链接:zoj-3627 题意 直线上有n个城市, 第i个城市和i+1个城市是相邻的.  每个城市都有vi的金币.    Alice和Bob站在城市p, 他们每天可以选择走向一个相邻的城市, 也可以选择不走. 他们是单独行动的.    他们经过一个城市就可以获得相应的金币(不能重复获得)    作为一个队伍, 他们的最远距离不能操作M, 问T天内, 他们最多一共能拿多少金币? 思路 由于每次只能走一步,那么一定是一…
题意 有一个六边形格子,共 \(n\) 行,每行有 8 个位置,有一些格子不能走.求用一些环覆盖所有可走格子的方案数.\(n\le 10\) . 分析 插头dp,只不过是六边形上的,分奇数列和偶数列讨论,转移不太一样,但大同小异.编号需要插空,注意以下就行了.复杂度为 \(O(nm2^{2m})\) . 代码 cc_hash_table 多次用实力证明,他跑得比其他任何内置的 hash_map 都快! #include<bits/stdc++.h> #include<ext/pb_ds/…