题目传送门

解题思路:

本题说有些杂务是有前提条件的,而有一个特性就是某个杂务的前提一定在这个杂务前面输入,那么,这个题就瞬间沦为了黄题.对于那些有前提条件的杂务,我们只需要找它的前提条件中最晚完成的那个加上自己的时间就是这个杂务最早完成的时间.再在全部杂务中找最晚的那个,就是答案.

AC代码:

 #include<cstdio>
#include<iostream>
#include<vector> using namespace std; int n,p,a;
struct kkk {
int v;
vector<int> l;
}e[]; inline void solve() {
for(int i = ;i <= n; i++) {
int ans = ;
for(int j = ;j < e[i].l.size(); j++)
ans = max(ans,e[e[i].l[j]].v);
e[i].v += ans;
a = max(a,e[i].v);
}
} int main()
{
scanf("%d",&n);
for(int i = ;i <= n; i++) {
scanf("%d%d",&p,&e[i].v);
while(true) {
scanf("%d",&p);
if(p == ) break;
e[i].l.push_back(p);
}
}
solve();
printf("%d",a);
return ;
}

最新文章

  1. [LeetCode] Meeting Rooms 会议室
  2. iis上如何架设HTTPS网站
  3. USB hacker Collection
  4. 解决Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的报错问题
  5. java内存溢出分析(二)
  6. Go 命令之 godep
  7. SSIS --&gt;&gt; Variable
  8. Android下拉刷新-SwipeRefreshLayout,RecyclerView完全解析之下拉刷新与上拉加载SwipeRefreshLayout)
  9. NSMutableArray 排序
  10. JavaScript 风格指导(Airbnb版)
  11. sublime text There are no packages 解决!
  12. 向Int数组插入随机1到100
  13. 纯js实现积木(div)拖动效果
  14. Framework7功能齐全的 iOS7 App 前端框架
  15. 设计模式 ( 十四 ) 迭代器模式Iterator(对象行为型)
  16. ACL in 和 out 区别 (重要)
  17. 控制结构(1) 分枝/叶子(branch/leaf)
  18. 【Python 22】52周存钱挑战2.0(列表list和math函数)
  19. mobile_音悦台
  20. word中替换【换行符】与【回车符】

热门文章

  1. code first网站发布后数据表中没有数据问题
  2. USB2.0主机控制器 UPD720114 简单详解
  3. spring的一些annotation
  4. Hibernate--起步
  5. opencv python运动人体检测
  6. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-text-width
  7. ES query does not support [auto_generate_synonyms_phrase_query]
  8. C# Stream篇(二) -- TextReader 和StreamReader
  9. Inheritance and the prototype chain 继承和 原型 链
  10. Dynamic Route Matching Vue路由(1)