题目链接:http://poj.org/problem?id=1011
这道题用到了深搜+剪枝。
#include
#include
#include
using namespace std;
int a[65];
int vis[65];
int n;
int cmp(int x,int y)
{
return x>y;
}
int dfs(int len,int need,int ...
分类:
其他好文 时间:
2014-05-05 13:28:57
阅读次数:
290
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:
其他好文 时间:
2014-05-05 12:58:57
阅读次数:
294
这篇对应的是习题16,读写文件
# -*- coding: utf-8 -*-
#对文件更多操作复制A文件的内容到B文件
#from sys import argv
from os.path import exists
prompt = "> "
from_file = raw_input("please input the filename where you want to copy...
分类:
编程语言 时间:
2014-05-05 12:54:02
阅读次数:
402
在内的内部定义并使用,外部无法访问,以双下划线作为前作,定义后被python转为
_classname__变量名了
--------------------------------------------------------------------------------------
In [1]: class aa:
...: __x = 12 #私有变量_ _x...
分类:
编程语言 时间:
2014-05-03 17:37:55
阅读次数:
333
python中流程控制与函数编写
Last Eidt 2014/5/2...
分类:
编程语言 时间:
2014-05-03 17:17:00
阅读次数:
442
今天我们要学习的内容是如何利用Python生成一个随机的中文验证码,并将图片保存为.jpeg格式。
在这之前,你首先得了解Python中的PIL库。PIL是Python Imaging Library的简称,PIL是一个Python处理
图片的库,提供了一系列模块和方法,比如:裁切,平移,旋转,改变尺寸等等。在PIL库中,任何一个图像都是用
Image对象来表示的,所以要加载一张图片,...
分类:
其他好文 时间:
2014-05-03 17:07:06
阅读次数:
364
近日浏览csdn博客,发先一本自编的分享自编《Python基础教程》无水印文字版,推荐读之,内容朴实无华无拖泥带水,板式清晰,是python入门和初学者必藏教程。
下载地址
http://download.csdn.net/detail/u014036026/7188403...
分类:
编程语言 时间:
2014-05-03 17:06:16
阅读次数:
407
原理:利用python的win32模块,注册服务,让代码在后台运行,检测光盘并拷贝文件
启动的方法就是直接在cmd下,main.py install ,然后去windows 的服务下就可以看到The smallestpossible Python Service 这个服务,你可以启动,停止,还可以设置成开机自动启动。启动服务后,会自动检测光盘并在后台拷贝文件
main.py
import...
分类:
其他好文 时间:
2014-05-03 15:58:45
阅读次数:
235
BeautifulSoup 善于网页数据分析
请参考: http://www.crummy.com/software/BeautifulSoup
例如: 抓取CSDN首页极客头条内容 soup.py
import urllib2, re
from BeautifulSoup import BeautifulSoup
page = urllib2.urlopen("http://gee...
分类:
编程语言 时间:
2014-05-03 15:31:42
阅读次数:
401