Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11...
分类:
其他好文 时间:
2014-11-24 11:28:33
阅读次数:
218
Let'sbegin witha naive method.We first need to sort the array A[n]. And we want to solve the problem by iterating through A from beginning and ending....
分类:
其他好文 时间:
2014-11-21 20:28:55
阅读次数:
159
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw...
分类:
其他好文 时间:
2014-11-20 01:20:45
阅读次数:
185
Socket
小型服务器:
#!/usr/bin/env python
import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.bind((host,port))
s.listen(5)
while True:
c,addr = s.accept()
print 'Got connection ...
分类:
编程语言 时间:
2014-11-15 18:56:56
阅读次数:
174
VF时间限制:1000ms | 内存限制:65535KB难度:2描述Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famo...
分类:
其他好文 时间:
2014-11-15 18:50:01
阅读次数:
163
文件方法
读写:
#!/usr/bin/env python
f = open('somefile.txt','w')
f.write('Hello,')
f.write('World!')
f.close()
f = open('somefile.txt','r')
print f.read(5)Hello使用基本文件方法:
#!/usr/bin/env python
f = open(r...
分类:
编程语言 时间:
2014-11-15 15:32:37
阅读次数:
218
Problem Description
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just em...
分类:
其他好文 时间:
2014-11-14 01:39:15
阅读次数:
218
类
创建简单类:
#!/usr/bin/env python
__metaclass__ = type
class Person:
def setName(self,name):
self.name = name
def getName(self):
return self.name
def greet(self):
print "Hello,world! I'm %s."...
分类:
编程语言 时间:
2014-11-13 18:57:27
阅读次数:
295
UITableView控件使用使用UITableView,在控件库中,拖拽一个Table View到ViewController中,在Controller的后台代码中需要继承UITableViewDelegate和UITableViewDataSource的协议。重写方法tableView(_:nu...
分类:
移动开发 时间:
2014-11-13 18:32:26
阅读次数:
354