题目链接: Countries 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are two antagonistic countries, country A and country B. They are in a war, and keep launching missiles towards each other. It is known that country A will launch N missiles. The i-th missil…
hihoCoder挑战赛12 时间限制:1000ms 单点时限:1000ms 内存限制:256MB   描述 There is a strange storehouse in PKU. In this storehouse there are n slots for boxes, forming a line. In each slot you can pile up any amount of boxes. The limitation is that you can only pile a…
题目链接:http://hihocoder.com/problemset/problem/1391 题意:A国和B国向对方分别投射N枚和M枚导弹(发射时间,飞行时间,伤害值),同时两国各自都有防御系统,导弹碰到防御系统会发生反弹.B国防御时间固定,求A国受到的最小伤害. 思路:对于从A国发射的导弹,判断到达B时(a+b)是否在B国防御区间[x , x + Tb]内,如果不在就不用管了,在的话计算出导弹区间[l , r],如果A国防御区间不能覆盖导弹区间,将受到伤害.对B国发射的导弹同理. 处理出…
题目 Source http://hihocoder.com/problemset/problem/1388 Description Profess X is an expert in signal processing. He has a device which can send a particular 1 second signal repeatedly. The signal is A0 ... An-1 under n Hz sampling. One day, the device…
题目链接: http://hihocoder.com/problemset/problem/1233 题目描述: 给定最多七个箱子,每个箱子的重量都不相同,每次都可以将一个箱子放在相邻的位置上,如果相邻位置上的箱子的重量比它大,那么可以放在相邻位置上的箱子, 小就不可以,问通过这样的操作最少需要多少步可以将这些箱子排好序? 由于最多是7个箱子,而且每个箱子的重量都不相同,那么最多有7!个状态,通过bfs每次需要更新的状态最多有12个状态,可以承受. 接下来就是怎样表示状态了,由于某一个位置可能会…
题目链接: Sewage Treatment 时间限制:2000ms 单点时限:2000ms 内存限制:256MB 描述 After years of suffering, people could not tolerate the pollution in the city any more, and started a long-lasting protest. Eventually, the municipal government made up its mind to deal wit…
平面上有m个点,要从这m个点当中找出n个点,使得包含这n个点的圆的半径(圆心为n个点当中的某一点且半径为整数)最小,同时保证圆周上没有点. n > m 时要输出-1 样例输入43 2 0 0 1 0 1.2 02 2 0 0 1 02 1 0 0 1.2 02 1 0 0 1 0样例输出121-1 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm&…
Problem Description In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For example, in polar Coordinate system,ρ=cos3θ is like rose, ρ=1−sinθ is a Cardioid, and so on. Today, there…
官方题解: // 离线树状数组 hihocoder 1391 Countries #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <math.h> #include <memory.h> using namespace std; #define LL long l…
网赛的时候看了这道题,发现就是平常的那种基础搜索题. 由于加了一个特殊条件:可以一次消耗3秒或原地停留1秒. 那就不能使用简单的队列了,需要使用优先队列才行. 题意 告诉一副地图:一个起点,一个终点,若干墙,若干监视器,剩下的是空地. 起点,终点,监视器都算空地. 监视器初始值会指定一个方向,共有四个方向. 监视器每秒顺时针转动到下个方向. 监视器视野距离为2. 在监视器的位置或在监视器面向的格子是监视区域. 普通的移动一格需要消耗1秒时间. 在监视器下移动一格需要消耗3秒时间. 如果呆在原地不…