码迷,mamicode.com
首页 >  
搜索关键字:ab problem    ( 41504个结果
9D - How many trees?
原题链接https://codeforces.com/problemset/problem/8/C 这题自己sb,后面s数组没有加够,出现了空值,调了老半天,我是sb。 题意: 给你n个结点,权值1~n,问你最多能组成多少棵深度不小于 k 的二叉搜索树。 思路:大的树是由小的树构成的,因此可以递推( ...
分类:其他好文   时间:2021-04-07 11:25:35    阅读次数:0
[USACO17DEC]Push a Box P
V.[USACO17DEC]Push a Box P 思想很简单,发现任意推动箱子的时刻牛总在箱子旁,而这总共是 \(4nm\) 种状态,可以建图储存,然后在上面搜索,搜出所有从起始状态可以到达的状态即可。我们需要连的边只有牛推了一格箱子的边(这个非常简单)以及牛不推箱子,从箱子的一方走到另一方的边 ...
分类:其他好文   时间:2021-04-07 11:24:06    阅读次数: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
41504条   上一页 1 ... 11 12 13 14 15 ... 4151 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!