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






canexjtuzju

记录
 
 

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

2014年9月15日

Colidity--CountDiv
摘要: 很巧妙的思路:先计算A之前的被K除的最大数,然后计算B-A之间能填充多少个K 1 // you can use includes, for example: 2 // #include 3 4 // you can write to stdout for debugging purposes, ... 阅读全文
posted @ 2014-09-15 22:23 canexjtuzju 阅读(151) 评论(0) 推荐(0)
 
Colidity--MinAvgTwoSlice
摘要: 这题挺有意思的,没想到规模大于3的slice的avg肯定要比它的子slice(小于3)的avg来得小的话,就不太好写。 1 int solution(vector &A) { 2 // write your code in C++98 3 int minStart = 0; 4 ... 阅读全文
posted @ 2014-09-15 22:07 canexjtuzju 阅读(214) 评论(0) 推荐(0)
 
Colidity--GenomicRangeQuery
摘要: 思路:统计每一个字符前面的四个字符的个数(利用前缀和数组),这样就能在O(1)时间得到某个区间某个字符的个数开始想到的是O(n^2)的空间,这个思路比较好 1 // you can use includes, for example: 2 // #include 3 4 // you can w... 阅读全文
posted @ 2014-09-15 21:58 canexjtuzju 阅读(423) 评论(0) 推荐(0)
 
Colidity--PassingCars
摘要: 1 // you can use includes, for example: 2 // #include 3 4 // you can write to stdout for debugging purposes, e.g. 5 // cout &A) { 8 // write y... 阅读全文
posted @ 2014-09-15 21:20 canexjtuzju 阅读(397) 评论(0) 推荐(0)