• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
frankM
天下武功,唯快不破。
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

随笔分类 -  贪心策略

 
GCJ Crazy Rows
摘要:题目大意:给定一个由0和1组成的矩阵。只允许交换相邻的两行(第i行和第i+1行),要把矩阵化成下三角矩阵,最少需要交换几次?Small1#define MAX_N 45using namespace std;int n;char M[MAX_N][MAX_N];int a[MAX_N]; ... 阅读全文
posted @ 2014-08-05 15:32 frankM 阅读(192) 评论(0) 推荐(0)
HDU 4310 Hero
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=4310按比值排序:dps/hp...为了避免小数出现cmp函数写成相乘的形式#include #includeusing namespace std;class hero{public: int hp;... 阅读全文
posted @ 2014-06-25 11:11 frankM 阅读(153) 评论(0) 推荐(0)
BNUOJ 1013 YC大牛的判题任务
摘要:链接:http://www.bnuoj.com/bnuoj/problem_show.php?pid=1013水题..用结构体二级排序即可..#include #include using namespace std;typedef struct{ int num; int time;}pro;pr... 阅读全文
posted @ 2014-05-14 17:12 frankM 阅读(179) 评论(0) 推荐(0)
NYOJ 824 Greedy Mouse
摘要:描述A fat mouse prepared M pounds of cat food,ready to trade with the cats guarding the warehouse containing hisfavorite food:peanut. The warehouse has ... 阅读全文
posted @ 2014-04-14 20:30 frankM 阅读(160) 评论(0) 推荐(0)
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3