2013年8月11日

ZOJ1455

摘要: 题意:给定N个任务,每个任务有一个完成时间。这些任务之间有完成的四种先后顺序,假设这种二元关系建立在x,y之间: SAS:x至少在y开始时开始 SAF:x至少在y完成时开始 FAS:x至少在y开始时完成 FAF:x至少在y完成时完成 现在问这些任务在最短时间内都被完成的任务安排如何?输出每个任务开始的时刻,如果不能的话输出impossible。最长路做法:虚拟出一个0点,S0 = 0 ; Si - S0 >= 0 ; 建图如下for(int i=1; i 2 #include 3 #include 4 #include 5 #include 6 #include ... 阅读全文

posted @ 2013-08-11 23:27 爱∪ 阅读(163) 评论(0) 推荐(0) 编辑

POJ1364

摘要: 4 21 2 gt 02 2 lt 2if(s[0]=='g') S3-S0>0 S3-S0>=1 S0-S3 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define inf 9999999 9 #define N 10510 #define M 2000011 int dis[N],vis[N],head[N],in[N];12 int size , n ,m ;13 struct Edge14 {15 int v,w,next;16 Edge( 阅读全文

posted @ 2013-08-11 11:54 爱∪ 阅读(170) 评论(0) 推荐(0) 编辑

导航