会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Let_Life_Stop
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
59
下一页
2019年7月17日
字典序的第K小数字(十叉树的先序遍历)
摘要: 题目链接: https://leetcode-cn.com/problems/k-th-smallest-in-lexicographical-order/ 题目大意: 给定整数 n 和 k,找到 1 到 n 中字典序第 k 小的数字。 注意:1 ≤ k ≤ n ≤ 109。 具体思路: 首先遍历的
阅读全文
posted @ 2019-07-17 15:36 Let_Life_Stop
阅读(1007)
评论(0)
推荐(0)
2019年7月16日
字典序排数( dfs)
摘要: 题目连接: https://leetcode-cn.com/problems/lexicographical-numbers/ 题目大意: 给定一个整数 n, 返回从 1 到 n 的字典顺序。 例如, 给定 n =1 3,返回 [1,10,11,12,13,2,3,4,5,6,7,8,9] 。 请尽
阅读全文
posted @ 2019-07-16 21:43 Let_Life_Stop
阅读(874)
评论(0)
推荐(0)
2019年7月14日
根据身高重建队列(vector)
摘要: 题目连接: https://leetcode-cn.com/problems/queue-reconstruction-by-height/submissions/ 题目大意: 假设有打乱顺序的一群人站成一个队列。 每个人由一个整数对(h, k)表示,其中h是这个人的身高,k是排在这个人前面且身高大
阅读全文
posted @ 2019-07-14 16:01 Let_Life_Stop
阅读(584)
评论(0)
推荐(0)
K 连续位的最小翻转次数
摘要: 题目连接: https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips/ 题目大意: 在仅包含 0 和 1 的数组 A 中,一次 K 位翻转包括选择一个长度为 K 的(连续)子数组,同时将子数组中的每个 0 更
阅读全文
posted @ 2019-07-14 13:06 Let_Life_Stop
阅读(582)
评论(0)
推荐(0)
2019年7月13日
724. Find Pivot Index
摘要: 题目连接: https://leetcode-cn.com/problems/find-pivot-index/ 题目大意: 找一个点,左边和右边相等。 具体思路: 前缀和+后缀和,线性遍历一遍即可。一定注意存在空数组的情况。 AC代码:
阅读全文
posted @ 2019-07-13 20:20 Let_Life_Stop
阅读(127)
评论(0)
推荐(0)
Two Sum
摘要: 题目连接:https://leetcode-cn.com/problems/two-sum/ 题目大意: 找出两个数,相加等于给定的值。 AC代码: 方法二:
阅读全文
posted @ 2019-07-13 19:28 Let_Life_Stop
阅读(129)
评论(0)
推荐(0)
2019年6月29日
c
摘要: 1 #include 2 using namespace std; 3 const int maxn = 2e5+100; 4 class Base 5 { 6 public: 7 Base(); 8 Base(int a); 9 Base(const Base& other); 10 Base& operator = ( const Base ...
阅读全文
posted @ 2019-06-29 22:01 Let_Life_Stop
阅读(149)
评论(0)
推荐(0)
2019年6月27日
Most Powerful(状压DP水题)
摘要: 题目链接: https://ac.nowcoder.com/acm/problem/15832 题目大意: 自己翻译,注意每次碰撞是两个中的一个消失,并不是两个都消失 具体思路: dp[i]表示i这个状态最大的能量是多少,三重for循环枚举 AC代码: acm生涯应该就到此结束了
阅读全文
posted @ 2019-06-27 17:00 Let_Life_Stop
阅读(230)
评论(0)
推荐(0)
2019年6月24日
郊区春游(状压DP水题)+ 记录路径
摘要: 题目链接: https://ac.nowcoder.com/acm/problem/16122 题目大意: 中文 具体思路: 首先对全图跑一遍floyed,然后dp[i][j]表示第i个状态在j点停下来的最短距离。 AC代码: 记录路径
阅读全文
posted @ 2019-06-24 20:42 Let_Life_Stop
阅读(401)
评论(0)
推荐(0)
A - Bus Planning Kattis - busplanning (状压DP)
摘要: 题目链接: https://cn.vjudge.net/problem/Kattis-busplanning 题目大意: 自己翻译 具体思路: 问的别的,不是我的思路,, 二进制枚举这n个人的子集,判断哪几个状态是能够在一辆车上的,然后对于所有状态判断他的哪两个互补的子集能使得这个状态的人最少。 记
阅读全文
posted @ 2019-06-24 17:05 Let_Life_Stop
阅读(363)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
59
下一页
公告