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

文章分类 -  JOJ

2746 Problem F: Actualist - 离散化

摘要:题意:区间染色,求染色次数大于等于k的长度。思路:因为n的范围比较小,直接离散化。----经典好题!!题目链接:http://acm.jlu.edu.cn/joj/showproblem.php?pid=2746例:View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 #include <map> 阅读全文
posted @ 2012-05-10 19:40 Hug_Sea 阅读(140) 评论(0) 推荐(0)
2680 Problem F: Coin Game

摘要:题意:给出两个序列a[],b[],第一个递减,第二个随机,问怎样交换第二个序列(每次相邻两个互换),使得第二个序列每个位置上的数都小于等于第一个序列。例:sample input:33 2 12 2 133 2 11 2 346 5 3 11 3 5 5sample output:035思路:a,b都从最后开始遍历,若a[i]<b[i],则将b[i]移到a[i]后面,否则标记b[i]。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include < 阅读全文
posted @ 2012-05-09 15:49 Hug_Sea 阅读(128) 评论(0) 推荐(0)
2682 Problem H: New Feature in Windows 7

摘要:题意:给出n个字符串,按要求排序,要求如下:Iftwo filenames are same before certain position including start, theorder should be decided by these conditions:a) If both of them are alphabets, the result depends on the alphabet order.b) If one is alphabet and the other is number, the number is smaller.c) If both of them ar 阅读全文
posted @ 2012-05-09 15:12 Hug_Sea 阅读(119) 评论(0) 推荐(0)

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