码迷,mamicode.com
首页 >  
搜索关键字:problem 2171 防守阵地 ii    ( 43577个结果
打家劫舍2
此博客链接: 打家劫舍2 题目链接:https://leetcode-cn.com/problems/house-robber-ii/ 题目 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金。这个地方所有的房屋都 围成一圈 ,这意味着第一个房屋和最后一个房屋是紧挨着的。同时,相邻的房 ...
分类:其他好文   时间:2021-04-06 14:59:12    阅读次数:0
Leetcode 59. 螺旋矩阵 II
地址 https://leetcode-cn.com/problems/spiral-matrix-ii/ 给你一个正整数 n ,生成一个包含 1 到 n2 所有元素,且元素按顺时针顺序螺旋排列的 n x n 正方形矩阵 matrix 。 示例 1: 输入:n = 3 输出:[[1,2,3],[8, ...
分类:其他好文   时间:2021-04-06 14:49:59    阅读次数:0
Codeforces Round #712 (Div. 2) C
题目链接 https://codeforces.ml/contest/1504/problem/C 题目截图 题目大致描述 给定一个01串,判断是否能构造出两个平衡的括号序列ans1和ans2,若能给定其中一种解,构造需满足以下规则: 对于01串中元素为0的位置i,ans1[i] != ans2[i ...
分类:其他好文   时间:2021-04-06 14:45:19    阅读次数:0
AtCoder Beginner Contest 049 B - Thin
Problem Statement There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The charact ...
分类:其他好文   时间:2021-04-05 12:52:04    阅读次数:0
4D - Mysterious Present 二维最长上升子序列
原题链接https://codeforces.com/problemset/problem/4/D 题意:给你n个二元组和起始条件,求其最大二维上升子序列,并输出选择编号。 思路:按照一个维度排序,然后DP即可,注意细节。 代码如下 int n, w, h; struct node{ int w, ...
分类:其他好文   时间:2021-04-05 12:33:56    阅读次数:0
hdu3639Hawk-and-Chicken(无向图缩点+dfs)
题目描述: Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play th ...
分类:其他好文   时间:2021-04-05 12:24:28    阅读次数:0
Leetcode 524. Longest Word in Dictionary through Deleting
Description: Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the gi ...
分类:其他好文   时间:2021-04-05 12:21:20    阅读次数:0
B. The least round way
原题链接https://codeforces.com/problemset/problem/2/B 这题要特判矩阵里有0的情况,我就没特判,一直TLE(自己傻逼) 题意:给你一个矩阵,里面都是非负数,现在让你从$(1, 1)\(走到\)(n, n)$, 并且把路径上的所有数乘起来,问你能得到的数末尾 ...
分类:其他好文   时间:2021-04-05 12:16:09    阅读次数:0
[日常摸鱼]一些博弈题
博弈 继上一篇https://www.cnblogs.com/yoshinow2001/p/14608742.html http://poj.org/problem?id=1067威佐夫博弈,注意poj不能用万能头… 实现的时候直接用$k=a/\varphi$来求,同时如果原本的$a$已经是一个出现 ...
分类:其他好文   时间:2021-04-02 13:28:22    阅读次数:0
HDU - 2196 Computer(二次扫描+换根法树形dp)
题目链接 #题目大意 求树上每个点到其他点的最大距离。 #解题思路 首先随便选择一个顶点作为根然后跑一遍dfs,记录每个顶点以其为根能到达的最大深度和次大深度,然后再跑一遍dfs,对于每个顶点,如果要到达一个距离最大的点,要么就是原来中的子树中的距离最大的点,要么就是经过父节点的某个点。 #代码 c ...
分类:其他好文   时间:2021-04-02 13:22:41    阅读次数:0
43577条   上一页 1 ... 13 14 15 16 17 ... 4358 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!