码迷,mamicode.com
首页 >  
搜索关键字:josephs problem    ( 37568个结果
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
P3335-[ZJOI2013]蚂蚁寻路【dp】
正题 题目链接:https://www.luogu.com.cn/problem/P3335 题目大意 给出$n\times m$的网格,每个格子有权值。一个回路在格子的边上,要求有$2\times k$次左转,其他都是右转,且最后$2$次一定得是右转。 求包含的格子权值和最大。 \(1\leq n ...
分类:其他好文   时间:2021-04-01 13:40:21    阅读次数:0
【CF566E】Restoring Map(构造)
有一棵$n$个点的树,乱序给出与每个点距离小于等于$2$的点集。求构造一棵合法的树。 ...
分类:其他好文   时间:2021-04-01 13:20:09    阅读次数:0
37568条   上一页 1 ... 9 10 11 12 13 ... 3757 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!