随笔分类 -  动态规划DP

摘要:链接:https://ac.nowcoder.com/acm/contest/897/L 来源:牛客网 XOR 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 Exclusive or is a 阅读全文
posted @ 2019-07-22 22:07 茄子Min 阅读(589) 评论(0) 推荐(0)
摘要:Jim has a balance and N weights. (1≤N≤20) The balance can only tell whether things on different side are the same weight. Weights can be put on left s 阅读全文
posted @ 2019-07-19 22:16 茄子Min 阅读(213) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/881/E 来源:牛客网 ABBA 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 Bobo has a st 阅读全文
posted @ 2019-07-18 22:18 茄子Min 阅读(728) 评论(0) 推荐(1)
摘要:链接:https://ac.nowcoder.com/acm/contest/984/F 来源:牛客网 随机数 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 正如你所知,奶牛们没有手指以至于不 阅读全文
posted @ 2019-07-12 17:48 茄子Min 阅读(183) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/984/D 来源:牛客网 饥饿的牛 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 Farmer John养了N(1 阅读全文
posted @ 2019-07-11 00:33 茄子Min 阅读(231) 评论(0) 推荐(0)
摘要:C. Python Indentation time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output In Python, code blocks 阅读全文
posted @ 2019-07-10 15:11 茄子Min 阅读(303) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/946/B 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262875K,其他语言525750K 64bit IO Format: %lld 题目描述 筱玛是一个热爱阅读的好筱玛,他最喜欢的 阅读全文
posted @ 2019-07-08 19:24 茄子Min 阅读(196) 评论(0) 推荐(0)
摘要:(Noip提高组及以下),有意者请联系Lydsy2012@163.com,仅限教师及家长用户。 2560: 串珠子 Time Limit: 10 Sec Memory Limit: 128 MB Submit: 915 Solved: 603 [Submit][Status][Discuss] De 阅读全文
posted @ 2019-07-08 18:11 茄子Min 阅读(287) 评论(0) 推荐(0)
摘要:题目描述 司令部的将军们打算在N M的网格地图上部署他们的炮兵部队。一个N M的地图由N行M列组成,地图的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示 阅读全文
posted @ 2019-07-08 00:52 茄子Min 阅读(193) 评论(0) 推荐(0)
摘要:题目描述 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子。 注:数据有加强(2018/4/25) 输入输出格式 输入格式: 只有一行,包含两个数N,K ( 1 题意: 思路: 动态规划, 定义状态d 阅读全文
posted @ 2019-07-07 22:02 茄子Min 阅读(205) 评论(0) 推荐(0)
摘要:题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy 阅读全文
posted @ 2019-07-07 18:14 茄子Min 阅读(274) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/1/K 来源:牛客网 大家一起来数二叉树吧 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K,其他语言262144K 64bit IO Format: %lld 题目描述 某一天,Zzq正在上 阅读全文
posted @ 2019-06-10 20:15 茄子Min 阅读(289) 评论(0) 推荐(0)
摘要:北京市商汤科技开发有限公司建立了新的 AI 人工智能产业园,这个产业园区里有 nn 个路口,由 n - 1n−1 条道路连通。第 ii 条道路连接路口 u_iui​ 和 v_ivi​。 每个路口都布有一台信号发射器,信号频段是 11 到 mm 之间的一个整数。 道路所连接的两个路口的发射信号叠加可 阅读全文
posted @ 2019-05-30 20:27 茄子Min 阅读(429) 评论(0) 推荐(0)
摘要:Then n - 1n−1 lines follow. ii-th line contains two integers f_{a_i}(1 \le f_{a_i} < i)fai​​(1≤fai​​<i), w_i(0 \le w_i \le 10^{18})wi​(0≤wi​≤1018) —Th 阅读全文
posted @ 2019-05-29 18:56 茄子Min 阅读(703) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/897/C来源:牛客网 LaTale LaTale 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 Legend g 阅读全文
posted @ 2019-05-27 20:50 茄子Min 阅读(461) 评论(0) 推荐(0)
摘要:题目描述 无聊的wlswls正在观察某个商品的价格,wlswls一共观察了nn天,每天这个商品都会有一个价格p_ipi​。 定义一个长度为2m+1(3\leq2m+1\leq n)2m+1(3≤2m+1≤n)的子序列a_1...a_{2m+1}a1​...a2m+1​是持续下降的,当且仅当: 1 \ 阅读全文
posted @ 2019-05-22 19:24 茄子Min 阅读(347) 评论(0) 推荐(0)
摘要:题目描述 喜欢数学的wlswls最近被萎住了。 现在他一共有1...n1...n这么多数字,取数字ii会得到f[i]f[i]的收益。数字之间有些边,对于所有的i(i != 1)i(i!=1),若ii为奇数,则ii与3i+13i+1之间有边,否则ii与i/2i/2之间有边。如果一条边的两个顶点xyxy 阅读全文
posted @ 2019-05-22 17:06 茄子Min 阅读(388) 评论(0) 推荐(0)
摘要:题目描述 wlswls在玩一个游戏。 wlswls有一个nn行mm列的棋盘,对于第ii行第jj列的格子,每过T[i][j]T[i][j]秒会在上面出现一个糖果,第一次糖果出现在第T[i][j]T[i][j]秒,糖果仅会在出现的那一秒存在,下一秒就会消失。 假如wlswls第kk秒在第ii行第jj列的 阅读全文
posted @ 2019-05-21 21:17 茄子Min 阅读(219) 评论(0) 推荐(0)
摘要:Time limit : 2sec / Memory limit : 256MB Score : 900 points Problem Statement Joisino has a formula consisting of N terms: A1 op1 A2 … opN−1 AN. Here, 阅读全文
posted @ 2019-05-06 20:53 茄子Min 阅读(404) 评论(0) 推荐(0)
摘要:Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selecting one or more cards from these N cards, so that th 阅读全文
posted @ 2019-04-24 13:45 茄子Min 阅读(369) 评论(0) 推荐(0)