def HW(x): print "Hello World!"s=raw_input("我的在博客园的首篇博客:");HW(s)
分类:
其他好文 时间:
2014-12-06 21:30:34
阅读次数:
170
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font ...
分类:
其他好文 时间:
2014-12-06 21:31:41
阅读次数:
168
4SumGiven an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum...
分类:
其他好文 时间:
2014-12-06 21:30:05
阅读次数:
460
Word AmalgamationIn millions of newspapers across the United States there is a word game calledJumble. The object of this game is to solve a riddle, b...
分类:
其他好文 时间:
2014-12-06 21:29:26
阅读次数:
351
负载均衡杂谈 最近春节临近,又到了一年一度春运时节,而春运又免不了各种抢票,由此抢票软件也就应运而生,此时,我们发出的大量请求会给网站带来负载。这当然很正常,但是当我们给这些服务器增加负载时,会发生什么呢?这时,事情可能变得很糟糕,如果负载过高(抢票的人太多),网站就可能出现性能损失。它会逐渐变慢....
分类:
其他好文 时间:
2014-12-06 21:28:37
阅读次数:
255
1 void getPoint(QwtPlot *plot)2 {3 QPoint point = plot->canvas()->mapFromGlobal(QCursor::pos()); 4 QString info.sprintf("x = %g, y = %g"...
分类:
其他好文 时间:
2014-12-06 21:29:51
阅读次数:
1173
在这一节中,我们将由浅入深,学习如何编写视图及处理页面链接。
分类:
其他好文 时间:
2014-12-06 21:27:12
阅读次数:
354
生日那天,收到礼物数份,影集、日记本、胸花、头饰等等,精致、有趣。 一份礼物,一片爱心。我特别“钟情”于其中一张小小的卡片——清逸的构图并没什么非凡之处,但那道小诗,意味无穷: 有一天您将发现 什么爱啊、泪水、歌儿 都不再重要 您会发现宁静的力量 将有多么的丰沛…… 小小卡片,道出心声...
分类:
其他好文 时间:
2014-12-06 21:27:40
阅读次数:
359
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a...
分类:
其他好文 时间:
2014-12-06 21:27:13
阅读次数:
320
给定一个数,从根节点到叶节点是一个值,返回所有的值的和。例如:For example, 1 / \ 2 3The root-to-leaf path1->2represents the number12.The root-to-leaf path1->3represents the ...
分类:
其他好文 时间:
2014-12-06 21:27:26
阅读次数:
222
注意:有时加边不一定要加反向弧。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define INF 2147483647 7 #define MAXN 20011 8 #define MAXM 60030...
分类:
其他好文 时间:
2014-12-06 21:24:43
阅读次数:
217
分组背包而已。注意的是,每个时间T,要把一组的全加进去比较一次。#include #include #include #include #include #define N 205#define T 41000using namespace std;int dp[T];struct node{ in...
分类:
其他好文 时间:
2014-12-06 21:26:29
阅读次数:
212
一个简单的KVO例子。 两个界面,第一个界面显示名字和配偶(spouse)名字,第二个界面显示修改名字和配偶名字,返回时,将看到第一个界面的名字显示发生改变。 首先定义一个person类作为model。 #import?<Founda...
分类:
其他好文 时间:
2014-12-06 20:24:28
阅读次数:
308
高效STL—关联容器
标准关联容器中最重要的就是基于等价而不是相等。比如对于基本的函数库有find函数,但是对于set关联容器也是有find成员函数的。因为标准关联容器保持有序,所以每一个容器必须有一个定义了怎么保持东西有序的比较函数(默认是less)。等价是根据这个比较函数定义的,所以标准关联容器的用户只需要为他们要使用的任意容器指定一个比较函数
...
分类:
其他好文 时间:
2014-12-06 20:22:45
阅读次数:
206
通过“交换技巧”来修正过剩容量
假设一个向量在使用的过程中被扩大了容量,但是在以后的过程中向量中的元素又被删除,虽说向量中的元素被删除但是向量的容量没有变小,也就是说原来申请的内存空间没有得到释放,加入在某一个时刻向量的容量为10000,最后向量中的元素个数可能是10,那么过剩的空间就是浪费,这个时候可以通过交换算法来修改向量的大小。
#include
#include ...
分类:
其他好文 时间:
2014-12-06 20:22:14
阅读次数:
157
题目网址:https://oj.leetcode.com/problems/add-two-numbers/题目描述:You are given two linked lists representing two non-negative numbers. The digits are stored...
分类:
其他好文 时间:
2014-12-06 20:19:23
阅读次数:
196