题目描述 有三个好朋友喜欢在一起玩游戏,A君写下一个字符串S,B君将其复制一遍得到T,C君在T的任意位置(包括首尾)插入一个字符得到U.现在你得到了U,请你找出S. 输入 第一行一个数N,表示U的长度. 第二行一个字符串U,保证U由大写字母组成 第一行一个数N,表示U的长度. 第二行一个字符串U,保 ...
分类:
其他好文 时间:
2017-05-18 09:52:55
阅读次数:
190
Roy's friends has been spying on his text messages, so Roy thought of an algorithm to encrypt text messages. Encryption Algorithm is as follows:We say ...
分类:
编程语言 时间:
2017-05-15 14:21:44
阅读次数:
212
依据题意的话最多32条边,直接暴力的话 2 ^ 32肯定超时了。我们能够分两次搜索时间复杂度降低为 2 * 2 ^ 16 唯一须要注意的就是对眼下状态的哈希处理。 我採用的是 十进制表示法 跑的还是比較快的,可能是用STL函数的原因添加了一些常数复杂度。 #include<map> #include ...
分类:
其他好文 时间:
2017-05-09 15:49:21
阅读次数:
204
知乎上看到一个问题,如果一个女人说自己集齐了12个星座的男朋友,那么她已经搞过多少男人了。 先考虑这个问题的最简单版本,如果说该女人每一次和12个星座的男人交往的概率相同。 考虑$dp$ 注意到这个问题正向十分不好推(因为如果用f表示从开始到当前的状态的话,只能由当前f推到 对应拓扑图上后面的f)。 ...
分类:
其他好文 时间:
2017-05-07 16:11:25
阅读次数:
179
A. Kefa and First Steps(最长不下降子串) Kefa decided to make some money doing business on the Internet for exactly n days. He knows that on the i-th day (1?≤ ...
分类:
其他好文 时间:
2017-05-06 14:23:38
阅读次数:
299
Here With You - Asher Book To all my friends对我所有好友来讲The night is young夜未央The music's loud乐未殇They playing our song他们在我们喜爱的歌声里欢畅Nowhere else that I belo ...
分类:
其他好文 时间:
2017-05-05 20:57:43
阅读次数:
140
Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are nplayers (including Limak himself) and right ...
分类:
其他好文 时间:
2017-05-05 20:54:59
阅读次数:
109
A. Fake NP(数论水题) Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path. You ...
分类:
其他好文 时间:
2017-05-05 14:13:11
阅读次数:
180
可以用如下方法:1.初级:Friends (老友记)Friends是经典中的经典,对于英语初级水平的朋友来说,是突破发音和对话交流最好的美剧。整个剧都是人物间谈话,而且都很简短,没有长句,词汇非常简单,基本是plain English的典范。自己的英文有明显的提升,就是在看这部剧多达十遍后。 2.中 ...
分类:
其他好文 时间:
2017-05-04 14:45:27
阅读次数:
178
#!/usr/bin/envpython#-*-coding:utf-8-*-#author:ChanghuaGongclassperson(object):def__init__(self,name):self.name=name#静态属性defsay(self):#方法,动态属性print("say...")defspeak(self):print("speak...")classrelationship:defmk_friends(self,somebody):print("%si..
分类:
编程语言 时间:
2017-05-04 00:11:26
阅读次数:
180