给你一个n*m的字符矩阵,将横向(或纵向)全部裂开,然后以任意顺序首尾相接,然后再从中间任意位置切开,问你能构成的字典序最大的字符串。 以横向切开为例,纵向类似。 将所有横排从大到小排序,枚举最后切开的位置在哪一横排,将这一排提到排序后的字符串数组最前面,求个“最大表示法”,如果最大表示法的位置恰好 ...
分类:
其他好文 时间:
2017-08-04 21:38:02
阅读次数:
181
给你n个字符串,问你最小的长度的前缀,使得每个字符串任意循环滑动之后,这些前缀都两两不同。 二分答案mid之后,将每个字符串长度为mid的循环子串都哈希出来,相当于对每个字符串,找一个与其他字符串所选定的子串不同的子串,是个二分图最大匹配的模型,可以匈牙利或者Dinic跑最大流看是否满流。 一个小优 ...
分类:
其他好文 时间:
2017-08-04 21:27:08
阅读次数:
162
题目: Problem D. Great AgainInput file: standard inputOutput file: standard outputTime limit: 2 secondsMemory limit: 512 megabytesThe election in Berlan ...
分类:
其他好文 时间:
2017-08-04 12:49:56
阅读次数:
251
题目:Problem K. PiecemakingInput file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 512 mebibytesThe civil war in Berland ...
分类:
其他好文 时间:
2017-08-04 12:46:07
阅读次数:
259
解决方法:①<script type="text/javascript" src="xx.js" charset="UTF-8"> </script> charset这个属性设置和你页面一个编码;②将js中的汉字换成uncode码(推荐使用这种方式) ③http://hi.baidu.com/zha ...
分类:
其他好文 时间:
2017-07-31 13:29:51
阅读次数:
144
2205 据说题目很水 Accept: 199 Submit: 458Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 199 Submit: 458Time Limit: 1000 mSec Memory Limit : 32768 KB ...
分类:
其他好文 时间:
2017-07-30 11:36:50
阅读次数:
109
A smooth sea never made a skillful mariner. 平静的海洋练不出熟练的水手。 A smooth sea never made a skillful mariner, but a violent sea may kill a greenhand. When we ...
分类:
其他好文 时间:
2017-07-23 15:26:51
阅读次数:
199
使用php的strtotime实例:比如现在时间是“2017-07-06”,加一个月。 ...
分类:
Web程序 时间:
2017-07-20 13:39:30
阅读次数:
274
A chain is no stronger than its weakest link. 链条的坚固程度取决于它最薄弱的环节。 The same as the well-known buckets effects, that is, the capacity of a bucket depends ...
分类:
其他好文 时间:
2017-07-16 18:30:50
阅读次数:
165
#define ret_ok 0 #define ret_err 1 char week_day[8] = {"Monday","Tuesday","Wedsday","Thursday","Friday","Saturday","Sunday"}; int Judge_day_of_the_wee ...
分类:
其他好文 时间:
2017-07-16 13:36:35
阅读次数:
136