原题链接https://codeforces.com/problemset/problem/4/D 题意:给你n个二元组和起始条件,求其最大二维上升子序列,并输出选择编号。 思路:按照一个维度排序,然后DP即可,注意细节。 代码如下 int n, w, h; struct node{ int w, ...
分类:
其他好文 时间:
2021-04-05 12:33:56
阅读次数:
0
题目描述: 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
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
原题链接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
题目链接 #题目大意 求树上每个点到其他点的最大距离。 #解题思路 首先随便选择一个顶点作为根然后跑一遍dfs,记录每个顶点以其为根能到达的最大深度和次大深度,然后再跑一遍dfs,对于每个顶点,如果要到达一个距离最大的点,要么就是原来中的子树中的距离最大的点,要么就是经过父节点的某个点。 #代码 c ...
分类:
其他好文 时间:
2021-04-02 13:22:41
阅读次数:
0
一、文本与Base64 1、文本转Base64字符串 private static string StrToBase64(string str) { byte[] b = Encoding.Default.GetBytes(str); //转成 Base64 形式的 System.String st ...
正题 题目链接:https://www.luogu.com.cn/problem/P3335 题目大意 给出$n\times m$的网格,每个格子有权值。一个回路在格子的边上,要求有$2\times k$次左转,其他都是右转,且最后$2$次一定得是右转。 求包含的格子权值和最大。 \(1\leq n ...
分类:
其他好文 时间:
2021-04-01 13:40:21
阅读次数:
0
有一棵$n$个点的树,乱序给出与每个点距离小于等于$2$的点集。求构造一棵合法的树。 ...
分类:
其他好文 时间:
2021-04-01 13:20:09
阅读次数:
0
首先先定义一个list,将其转存为csv文件,看将会报什么错误:list=[[1,2,3],[4,5,6],[7,9,9]]list.to_csv('e:/testcsv.csv',encoding='utf-8')运行后出现:Traceback (most recent call last): F ...
分类:
编程语言 时间:
2021-04-01 13:12:24
阅读次数:
0