摘要: 知名美食家小 A被邀请至ATM 大酒店,为其品评菜肴。 ATM 酒店为小 A 准备了 N 道菜肴,酒店按照为菜肴预估的质量从高到低给予1到N的顺序编号,预估质量最高的菜肴编号为1。 由于菜肴之间口味搭配的问题,某些菜肴必须在另一些菜肴之前制作,具体的,一共有 M 条形如”i 号菜肴'必须'先于 j 阅读全文
posted @ 2017-10-30 20:26 探险家Mr.H 阅读(169) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #define P pair #define mp(a,b) make_pair(a,b) using namespace std; const int maxn=500100; int first[maxn],to[maxn],next[maxn],cnt,val[ma... 阅读全文
posted @ 2017-10-30 20:26 探险家Mr.H 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include using namespace std; const int maxn=50010; int first[maxn],to[maxn],next[maxn],cnt; inline int read() { int x=0,f=1; char ch=get... 阅读全文
posted @ 2017-10-30 20:10 探险家Mr.H 阅读(147) 评论(0) 推荐(0) 编辑