我提交了好多次,错误莫名其妙的,到后来才明白过来,原来我把题目给理解错了。
这个题的意思不是说让你把最后的那k个位置的元素移到前面来,这种问题的做法就是用两个指针,先让一个走,走到一定的长度之后两个一起走,很简单。它实际的意思是整个链表循环右移,假设一个链表长度是N,那么循环右移N次之后,链表又变回了原来的样子。k的取值范围只说了是非负的,也就是它可以是大于N的,因此实际的移位次数只是(k%N)...
分类:
其他好文 时间:
2014-05-13 23:37:23
阅读次数:
299
一、list_for_each
1.list_for_each原型
#define list_for_each(pos, head) for (pos = (head)->next, prefetch(pos->next); pos != (head); pos = pos->next, prefetch(pos->next))
它实际上是一个 for 循环,利用...
分类:
其他好文 时间:
2014-05-13 08:50:12
阅读次数:
506
手动模拟。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define N 10100
#define inf 1000000010
mapx,y;
struct X{
int x,y;
bool operator<(const X&a)const{...
分类:
其他好文 时间:
2014-05-13 07:29:10
阅读次数:
294
集合基础知识数组:长度固定,可存基本数据和对象。集合:只能放对象,不固定。容器也有共性,不断抽取成一个体系,集合框架。参阅顶层创建底层。顶层是collection。collection里有两个常见的接口,List和Set。常见集合有Arraylist,linkedlist,vector,hashSetTreeSet.为什么..
分类:
其他好文 时间:
2014-05-13 03:35:07
阅读次数:
371
#!/usr/bin/envpythonimportthreadingimporttimeimportparamikoimportos,sysfromipimportip_list,web_server,ip_msgfromoptparseimportOptionParserfromssh_co.cfg.configimporthost_msgdefopts():parser=OptionParser(usage="usage%progoptions")parser.add_option("-i","--it..
分类:
编程语言 时间:
2014-05-13 03:32:03
阅读次数:
537
#!/usr/bin/envpythonimporttime,MySQLdbfromsubprocessimportPopenfromsubprocessimportPIPEimportdns.queryimportdns.messageimportdns.tsigimportdns.tsigkeyringimportdns.updatedefset_dns(ip_list):key=dns.tsigkeyring.from_text({"cui.com":"SIvcwHj3goqYl0vKS6yOtdugx..
分类:
数据库 时间:
2014-05-13 02:04:53
阅读次数:
377
环境:centos5.932位1.使用yum命令直接安装:yum-yinstallvsftpd然后为它创建日志文件:touch/var/log/vsftpd.log2.启动与配置自启动使用chkconfig--list来查看vsftpd服务启动项情况;如果看到的是如下显示的结果:vsftpd0:off1:off2:off3:off4:off5:off6:off服务全部都是off的..
分类:
其他好文 时间:
2014-05-13 01:45:24
阅读次数:
433
atitit js 开发工具 ide的代码结构显示(func list) outline总结
eclips环境::4.3.1
#-------需要一个js开发工具,可以显示outline或者代码结构显示(func list)的功能的
aptana,webstorm好十好,走十太大的,pass...子能dw,eclps,npp黑头挑选..
VJET是一个 Eclipse ...
分类:
Web程序 时间:
2014-05-13 00:27:13
阅读次数:
390
楼主让这个问题郁闷了一晚上。。。。。在logcat里明明显示adapter的getview方法里的list大于一条数据 ,但posotion却一直是0.。。。。运行后也只显示list[0]里面的数据。。。。最后的最后原来错误出在布局文件上
我以前的是这样的;
<ScrollView
android:layout_width="fill_parent"
...
分类:
移动开发 时间:
2014-05-12 23:36:45
阅读次数:
386
暴力出奇迹。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll __int64
#define N 42
ll n,m,ans;
ll Gcd(ll x,ll y){
if(x>y)swap(x,y);
while(x){
y%=...
分类:
其他好文 时间:
2014-05-12 23:11:06
阅读次数:
445