单调队列优化dp; 对于每个点开个单调队列,按转移到它的点到它的距离从大到小,得分也从大到小排列。 每次枚举当前点前面的所有点,对于每个点的队列中二分一个距离小于等于它到当前点的答案值,放到当前点的队列中。 ...
分类:
其他好文 时间:
2017-10-27 21:32:25
阅读次数:
130
n<=250个大写字母和m<=250个小写字母,给p<=200个合法相邻字母,求用这些合法相邻字母的规则和n+m个字母能合成多少合法串,答案mod 97654321. 什么鬼膜数。。 f(i,j,k)--i个大写字母,j个小写字母,最后一个字母是k,,其中k是小写字母,p是能接在k前面的任意字母,k ...
分类:
其他好文 时间:
2017-10-26 20:03:25
阅读次数:
145
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which the ...
分类:
其他好文 时间:
2017-10-26 19:03:09
阅读次数:
200
ng the other ends of her ropes (if she has any), along with the cows holding the other ends of any ropes they hold, etc. When Bessie dances clockwise ...
分类:
其他好文 时间:
2017-10-24 14:52:42
阅读次数:
207
http://www.lydsy.com/JudgeOnline/problem.php?id=1649 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 743 Solved: 370[Submit][Status][Discuss] Description ...
分类:
其他好文 时间:
2017-10-22 10:59:04
阅读次数:
213
题目描述 FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secret). ...
分类:
其他好文 时间:
2017-10-20 10:06:36
阅读次数:
119
奶牛编号 cowids ##【题目描述】: 作为一个神秘的电脑高手,Farmer John 用二进制数字标识他的奶牛。 然而,他有点迷信,标识奶牛用的二进制数字,必须只含有K位“1”。当然,每个标识数字的首位必须为“1”。 FJ按递增的顺序,安排标识数字,开始是最小可行的标识数字(由“1”组成的一个 ...
分类:
其他好文 时间:
2017-10-18 23:08:32
阅读次数:
309
P2690 接苹果f[i][j][k]表示i=1或2,表示j时刻cow在哪棵树下j表示时刻k表示转移了k次如果当前第1棵树落苹果f[1][t][left]=max(f[1][t-1][left],f[2][t-1][left-1])+1;如果当前第2棵树落苹果f[2][t][left]=max(f[ ...
分类:
移动开发 时间:
2017-10-18 21:40:10
阅读次数:
120
P2870 [USACO07DEC]最佳牛线,黄金Best Cow Line, Gold我比赛的时候A了,luogu上25分,QAQ,又憨又傻的200+代码,我为什么要干电脑干的事情,无语了。如果左边<右边,取左如果右边<左边,取右如果相等,就向中间找,直到找到第一个不同的,然后给电脑指明下一步是取 ...
分类:
其他好文 时间:
2017-10-18 18:25:50
阅读次数:
137
爆炸场,A被hack两次,a,c都看错题意。。。还是太菜了 A水题,ifelse写的太搓了被hack。。 #include<bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_b ...
分类:
其他好文 时间:
2017-10-17 22:56:42
阅读次数:
120