题意:
给n个不同的整数(3
输出方案数,以及按字典序输出每种方案。
思路:
一个很水的dfs全排列,加上特判就好了。
特判就是1->9的话就必定经过5等。
这里要注意的是。
中间所经过的数字是必须存在的。
比如要想1->9就必须有5.
5要么被用过,要么就经过5
例子就是 1 3 5 9这四个数。
实际的方案是只有2种
3 5 1 9 和 3 5 9 1
然后就是输入完...
分类:
其他好文 时间:
2015-04-13 12:56:19
阅读次数:
135
1、ifeq”语法是ifeq (;, ;),功能是比较参数“arg1”和“arg2”的值是否相同。ifneq刚好相反,比较两者的值是否不同其中有一些是我们常见或是见过的,第一个ifneq ($(KERNELRELEASE),)目前,有用处,它的由来是指在Linux源码根目录下的Makefile编译内核时,KERNELRELEASE宏会被定义,那么如果是从源码根目录开始的make则会将hello.o模块编译进内核。
KERNELDIR :=/home/ZP1015/Desktop/li...
分类:
系统相关 时间:
2015-04-13 11:07:00
阅读次数:
177
13. TLW_TWO_LOCK_WAIT ? TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT) Waiting on a monitor while two locks are held may cause deadlock. ? Performing a wait only releases the lock on the obje...
分类:
数据库 时间:
2015-04-13 00:31:48
阅读次数:
269
场景:一个商品有库存,下单时先检查库存,如果>0,把库存-1然后下单,如果0,然后都会执行update),所以需要加锁,InnoDB支持通过特定的语句进行显示加锁:select...lock in share modeselect...for udpateselect quantity from p...
分类:
其他好文 时间:
2015-04-13 00:06:04
阅读次数:
726
Pattern lock security is generally used in Android handsets instead of a password. The pattern lock can be set by joining points on a 3 × 3 matrix in a chosen order. The points of the
matrix are reg...
分类:
其他好文 时间:
2015-04-12 22:44:13
阅读次数:
204
每个点有16种方向,向某个方向走一步或者两步,dfs把找到的数都存下来就可以了.....
Valid Pattern Lock
Time Limit: 2 Seconds Memory Limit: 65536 KB
Pattern lock security is generally used in Android handsets instead of ...
分类:
其他好文 时间:
2015-04-12 21:10:48
阅读次数:
162
Valid Pattern LockTime Limit:2 Seconds Memory Limit:65536 KBPattern lock security is generally used in Android handsets instead of a password. The pat...
分类:
其他好文 时间:
2015-04-12 19:16:14
阅读次数:
305
Ubuntu现在官方主推的系统是14.04的64-bit,这东西在虚拟机划出1G内存给它也很卡,因此还是选择经典版本Ubuntu12.04。直接打开Ubuntu选择性下载页http://www.ubuntu.com/download/alternative-downloads(点击打开链接)翻到BT下载的部分,找到Ubuntu 12.04.5
Desktop (32-bit),这东西就是不错的...
分类:
系统相关 时间:
2015-04-12 09:18:21
阅读次数:
173
Centos6.3安装GNOME:1.vi/etc/inittab:id:3:initdefault改为id:5:initdefault2.yumupdate3.yumgroupinstall“Desktop”4.yumgroupinstall“XWindowSystem”5.yumgroupinstall“ChineseSupport”6.vi/etc/sysconfig/i18n:LANG=”zh_CN.UTF-8”7.startx启动gnome.
分类:
其他好文 时间:
2015-04-11 20:56:28
阅读次数:
121