• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Keep Strive

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

随笔分类 -  拓扑图

 
HDU 2647Reward(拓扑图)
摘要:题意:过年发奖金,起始奖金为888.越后者比前者多1元。问一共发了多少奖金。注意:数据中2 1 表示有两个员工,一组数据。接下来一组数据1 2 表示先给2发奖金,再给1发奖金。也就是1的奖金为889,2的奖金为888.连接:http://acm.hdu.edu.cn/showproblem.php?pid=2647View Code #include <iostream>using namespace std;#include <vector>const int MAX=10000+10;vector<int >map[MAX];int used[MAX]; 阅读全文
posted @ 2012-09-10 15:59 Keep Strive 阅读(230) 评论(0) 推荐(0)
HDU 3342 Legal or Not(深搜+拓扑)
摘要:解题思路:没有环的拓扑图、连接:http://acm.hdu.edu.cn/showproblem.php?pid=3342View Code #include <iostream>using namespace std;const int MAX=100+10;int c[MAX];int topo[MAX][MAX];int map[MAX][MAX];int m;int n;int t;bool dfs(int k){ c[k]=-1; for(int i=0;i<n;i++) { if(map[k][i]) { if(... 阅读全文
posted @ 2012-09-07 21:35 Keep Strive 阅读(190) 评论(0) 推荐(0)
hdu 1285 确定名次排名(拓扑排序)
摘要:题意:确定名次排名,符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排。注意事项:判重连接:http://acm.hdu.edu.cn/showproblem.php?pid=1285View Code #include <iostream>using namespace std;const int MAX=500+10;int map[MAX][MAX];int indegree[MAX];int main(){ int n; int m; while(~scanf("%d%d",& 阅读全文
posted @ 2012-09-07 19:24 Keep Strive 阅读(255) 评论(0) 推荐(0)