• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
日常任务
天天挖坑
博客园 首页 新随笔 联系 订阅 订阅 管理
上一页 1 2 3 4 5 6 7 下一页

2016年4月3日

去掉若干个字符后的最长回文字符串
摘要: 问一个字符串中若可以去掉若干个字符串,则最长字符串是多少? cabebfa 去掉c,e,f之后 是 abba, 4。 如果不能删除,则可以利用KMP,或者Manacher算法: http://hihocoder.com/problemset/problem/1032 其代码: 阅读全文
posted @ 2016-04-03 20:49 fripSide 阅读(318) 评论(0) 推荐(0)
 
 

2016年4月1日

2015-微软预科生计划-面试题-Swimming Plans
摘要: http://hihocoder.com/problemset/problem/1188 题目大意 Steven在时刻T到达了室内游泳池。 游泳池一共有N条泳道,游泳池两侧分别标记为0和1。 已知除了Steven,一共有Q个其他游泳者。每个游泳者有自己的游泳计划(t,l,n,d),表示他会在t时刻从 阅读全文
posted @ 2016-04-01 19:39 fripSide 阅读(341) 评论(0) 推荐(0)
 
 

2016年3月19日

Divisors
摘要: 计算小于n的数中,约数个数最多的数,若有多个最输出最小的一个数。 http://hihocoder.com/problemset/problem/1187 对于100有 60 = 2 * 2 * 3 * 5,共 (2 + 1) * (1 + 1) * (1 + 1) = 12个约数。 对于 n <= 阅读全文
posted @ 2016-03-19 00:40 fripSide 阅读(493) 评论(0) 推荐(0)
 
 

2016年2月29日

HDU2222
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2222 注意: 1. keyword可以相同,因此计算时要累计:cur->num++。 2. 同一个keyword在str中出现多次的话,只计算一次,所以算过后需要将num设为-1(表示已经计算了)。 对于 25s 阅读全文
posted @ 2016-02-29 11:02 fripSide 阅读(312) 评论(0) 推荐(0)
 
 

2015年11月10日

11-10 CC150第一章
摘要: 题目:1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? ________________... 阅读全文
posted @ 2015-11-10 12:27 fripSide 阅读(330) 评论(0) 推荐(0)
 
 

2015年10月21日

10-20日 && 抽签问题
摘要: Ants# include #include const int MAX_N = 100;int L, n, x[MAX_N];void solve() { int minT = 0; for (int i = 0; i 0) { scanf("%d%d", &L, &n... 阅读全文
posted @ 2015-10-21 00:09 fripSide 阅读(243) 评论(0) 推荐(0)
 
 

2015年9月9日

9月9日刷题
摘要: Sqrt(x)http://www.guokr.com/question/461510/ 牛顿开方法 public int sqrt(int x) { float X1 = 1f; float Xn = x; for (int i = 0; i < 20... 阅读全文
posted @ 2015-09-09 22:31 fripSide 阅读(111) 评论(0) 推荐(0)
 
 

2015年7月5日

7-4日刷题
摘要: Subarray Sum Closest1. 保存,然后对sum[i + 1]排序,然后找出相邻值之间的最小差。2. TreeMap:ceilingEntry返回一个键-值映射关系,它与大于等于给定键的最小键关联Value。floorEntry:返回小于等于给定键的最大键关联Value。 pu... 阅读全文
posted @ 2015-07-05 01:24 fripSide 阅读(225) 评论(0) 推荐(0)
 
 

2015年7月3日

7-3日刷题
摘要: 今天搜寒冬的面试杀手题——大草原,发现是以前的机试第四题,这道题跪了让我后悔一生。到现在我唯一知道的是这道题可以用贪心算法骗分。http://stackoverflow.com/questions/15882202/minimum-number-of-circles-with-radius-r-to... 阅读全文
posted @ 2015-07-03 12:24 fripSide 阅读(174) 评论(0) 推荐(0)
 
 

2015年7月2日

7-2日刷题
摘要: 3 Sum Closest public int threeSumClosest(int[] numbers ,int target) { // write your code here int minEr = Integer.MAX_VALUE; i... 阅读全文
posted @ 2015-07-02 00:11 fripSide 阅读(185) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 5 6 7 下一页

公告


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