思路:
1.若前n-1位涂的颜色是符合条件的,则由于首尾不同,再添加一位时,只有1种方法;即s[n] = s[n-1]
2.若前n-1位组成的串不符合,再添加一位后合法,即因为首尾相同而引起的不合法,那么前n-2位组成的串必定合法。此时第n位有2种添加方法。即s[n] = 2*s[n-2]
所以AC代码:
#include
int main()
{
int n,i;
_...
分类:
其他好文 时间:
2014-07-24 23:14:44
阅读次数:
153
最长上升子序列+最长递减子序列-重复的方法不严谨,貌似有人已经找到反例了,至于为什么那种方法能ac应该是测试数据弱吧
以下才是最标准的做法
//#pragma comment(linker, "/STACK:102400000,102400000")
#include
#include
#include
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-07-24 23:11:53
阅读次数:
262
To import the library to Android Studio, there is two methods that can (or cannot) work. The first one worked for me, but when I tried the second, it ...
分类:
移动开发 时间:
2014-07-24 22:42:13
阅读次数:
284
http://www.intsci.ac.cn/users/luojw/P2P/index.html——————————————————————————————————————————————————献给对P2P网络感兴趣的朋友们:Peer-to-Peer 综述罗杰文中科院计算技术研究所目录1. P...
分类:
其他好文 时间:
2014-07-24 21:40:42
阅读次数:
250
原文地址:http://mobile.51cto.com/abased-374715.htm一、知识回顾 一个最简单的屏幕触摸动作触发了一系列Touch事件:ACTION_DOWN->ACTION_MOVE->ACTION_MOVE->ACTION_MOVE...->ACTION_MOVE->AC....
分类:
移动开发 时间:
2014-07-24 21:40:22
阅读次数:
305
解决IE apk变成zip:Android 手机应用程序文件下载服务器 配置解决方法 APK文件其实是zip格式,但后缀名被修改为apk,通过UnZip解压后,可以看到Dex文件,Dex是Dalvik VM executes的全称,即Android Dalvik执行程序,并非Java ME的字节码而...
分类:
移动开发 时间:
2014-07-24 21:25:10
阅读次数:
296
开启或关闭长链接支持,参考:http://leeon.me/a/php-memcached短链实验场景测试代码:1.phpsetOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);$mc->addServers(array( array(...
分类:
Web程序 时间:
2014-07-24 17:02:45
阅读次数:
224
Imports SystemImports System.Runtime.InteropServicesPublic Class DllInvoke Public Sub New(ByVal DLLPath As String) Me.hLib = DllInvoke.LoadL...
转自:http://www.bawo.me/point-of-view/jzydppbswebys-375.html导语:这里,说App必死,Web永生,是指目前这种需要下载和安装的移动互联网应用模式,必然衰落(但不会衰亡),而代之崛起的是基于html和浏览器的应用,必会卷土重来,重新占据移动和整个...
分类:
Web程序 时间:
2014-07-24 14:44:05
阅读次数:
286
效果如下:html代码: click on me! CSS代码:#contentPopup { position: absolute; display: none; ...
分类:
其他好文 时间:
2014-07-24 14:42:15
阅读次数:
303