随笔分类 - 差分约束
摘要:KingTime Limit:1000MSMemory Limit:10000KTotal Submissions:9331Accepted:3478DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born, and indeed, sh
阅读全文
摘要:Integer IntervalsTime Limit:1000MSMemory Limit:10000KTotal Submissions:12192Accepted:5145DescriptionAn integer interval [a,b], a 16 #include17 #include18 #define N 1000519 #define inf 0x7ffffff20 using namespace std;21 struct node{22 int s,e;23 }edge[N];24 int d[N];25 int n,up,down;26 void bellm...
阅读全文
摘要:LayoutTime Limit:1000MSMemory Limit:65536KTotal Submissions:5955Accepted:2842DescriptionLike everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 =d 6 求点1到点n的最长距离,无限远输出-2,不存在输出-1 7 8 差分约束: 9 对差分约束有一定的了解了,不过最大的问题还是在构图上,因为构图错了好几次。10 1...
阅读全文
摘要:THE MATRIX PROBLEMTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6380Accepted Submission(s): 1633Problem DescriptionYou have been given a matrix CN*M, each element E of CN*Mis positive and no more than 1000, The problem is that if there exist N nu
阅读全文
摘要:Is the Information Reliable?Time Limit:3000MSMemory Limit:131072KTotal Submissions:10303Accepted:3204DescriptionThe 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 withNdefense stations.
阅读全文
摘要:Schedule ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1085Accepted Submission(s): 448Special JudgeProblem DescriptionA project can be divided into several parts. Each part should be completed continuously. This means if a part should take
阅读全文
摘要:IntervalsTime Limit:10 Seconds Memory Limit:32768 KBYou are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn.Write a program that:> reads the number of intervals, their endpoints and integers c1, ..., cn from the standard input,> computes the minimal size of a set Z of int
阅读全文