码迷,mamicode.com
首页 >  
搜索关键字:15-puzzle problem    ( 37568个结果
[编程题] lc[236. 二叉树的最近公共祖先]
[编程题] lc:236. 二叉树的最近公共祖先 题目描述 输入输出例子 思路 使用后续遍历的思想,根据找到了左和右的情况,进行相应的返回结果。 Java代码 /** * Definition for a binary tree node. * public class TreeNode { * i ...
分类:其他好文   时间:2020-07-19 00:39:06    阅读次数:85
组合数学
卢卡斯定理 求组合数: 模板题:P3807 【模板】卢卡斯定理:https://www.luogu.com.cn/problem/P3807 #include<bits/stdc++.h> #define INF 0x3f3f3f3f #define DOF 0x7f7f7f7f #define e ...
分类:其他好文   时间:2020-07-18 22:59:48    阅读次数:107
2020-7-13
948. 令牌放置 题解: 贪心算法:tokens从小到大排序, 如果现在手里面的能量还大于最小的token,我们就将其换成分数(这样做怎么都不会亏,因为我们可以用分数去换更大的);否则如果我们手里还有分数,我们就去换最大的token。 class Solution { public: bool v ...
分类:其他好文   时间:2020-07-18 22:16:51    阅读次数:78
agc041_d Problem Scores
agc041_d Problem Scores https://atcoder.jp/contests/agc041/tasks/agc041_d Tutorial https://img.atcoder.jp/agc041/editorial.pdf 由于$A_i \le A_{i+1}$,所以设 ...
分类:其他好文   时间:2020-07-18 22:13:51    阅读次数:61
680. 验证回文字符串 Ⅱ
给定一个非空字符串 s,最多删除一个字符。判断是否能成为回文字符串。 示例 1: 输入: "aba"输出: True示例 2: 输入: "abca"输出: True解释: 你可以删除c字符。注意: 字符串只包含从 a-z 的小写字母。字符串的最大长度是50000。 来源:力扣(LeetCode)链接 ...
分类:其他好文   时间:2020-07-18 15:29:26    阅读次数:52
hash-白兔的字符串
https://ac.nowcoder.com/acm/problem/15253太简单了,直接上代码吧! #include <iostream> #include <cstring> #include <cmath> #include <stdio.h> #include <cstdlib> #i ...
分类:其他好文   时间:2020-07-18 13:48:13    阅读次数:50
leetcode-----94. 二叉树的中序遍历
链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo ...
分类:其他好文   时间:2020-07-18 11:34:31    阅读次数:66
Codeforces Round #656 (Div. 3)
Three Pairwise Maximums #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+3; typedef long long ll; const ll inf=1e18; ...
分类:其他好文   时间:2020-07-18 11:29:01    阅读次数:89
leetcode-----96. 不同的二叉搜索树
链接:https://leetcode-cn.com/problems/unique-binary-search-trees/ 代码 class Solution { public: int numTrees(int n) { vector<int> f(n + 1); f[0] = 1; for ...
分类:其他好文   时间:2020-07-18 11:25:21    阅读次数:56
剑指 Offer 59II - 队列的最大值
力扣链接:https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/ 题目描述 请定义一个队列并实现函数 max_value 得到队列里的最大值,要求函数max_value、push_back 和 pop_front 的均摊时间复杂度都是 ...
分类:其他好文   时间:2020-07-18 00:40:15    阅读次数:67
37568条   上一页 1 ... 48 49 50 51 52 ... 3757 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!