Time Limit: 3000MS Memory Limit: 131072K Description The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a straight line with N defense stations. Because…
Description The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a straight line with N defense stations. Because of the cooperation of the stations, Zibu…
http://poj.org/problem?id=2983 题目大意: 星际大战开始了.你购买了情报,需要判断它的准确性.已知地方的根据地在由南向北排成一条直线.P A B X,表示A在B北面距离X光年的地方,另一种是V A B,表示只知道A在B的北面至少1光年的地方. 思路: 可转化为差分约束. 对于P A B X来说因为A-B=X (因为他们相距X光年,我们取北边为正方向) 可以记做: A-B >=X && A-B<=X,即A-B>=X && B…
Is the Information Reliable? Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 11125 Accepted: 3492 Description The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defe…
id=2983">[POJ 2983]Is the Information Reliable? (差分约束系统) Is the Information Reliable? Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 12244 Accepted: 3861 Description The galaxy war between the Empire Draco and the Commonwealth of…
http://poj.org/problem?id=2983 题意:N 个 defense stations,M条消息,消息有精确和模糊之分,若前边为P.则为精确消息,有两个defense stations和他们之间的距离,若为P A B X 则是精确消息,并且A在B北边X光年远,V A B则是模糊消息,A在B北边,不知道距离,但至少是1光年远. 思路 :这个题要转化成差分约束.因为dist[a]-dist[b] = x,所以转化成差分约束x<=dist[a]-dist[b]<=x ,模糊消息…