- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 Python爬画途旅发现相册
利用python3提供的urllib.request很方便爬网页上的东西。 1、urllib.request.urlopen(url)打开网页,并读取read() 2、python正则分析图片链接,如 3、urllib.request.urlretrieve(url, filename)下载相应的url图片,保存到filename 详细看代码: # coding = utf-8 #
2015-03-01 23:57:40 795
原创 使用Python进行socket编程
使用Python3.2.5进行scoket编程,socket提供网络API,很方便做网络链接 TCP网络编程 服务端: 1)blind() 绑定地址,端口 2)listen() 监听客户端 3)accept() 获取socket对象,地址 信息交流: recv()接受bytes sen
2015-02-20 23:38:13 503
原创 Python入门
python基础 =========================python碎片========================= python 31关键字: and del from not while as elif global or with assert else if pass yield break except import print class exec in
2015-02-17 15:39:48 588
原创 Python 正则表达式
正则表达式是一个特殊的字符序列,它能帮助你方便的检查一个字符串是否与某种模式匹配。Python 自1.5版本起增加了re 模块,它提供 Perl 风格的正则表达式模式。 re 模块使 Python 语言拥有全部的正则表达式功能。 compile 函数根据一个模式字符串和可选的标志参数生成一个正则表达式对象。该对象拥有一系列方法用于正则表达式匹配和替换。 re 模块也提供了与这些方
2015-02-16 18:31:34 485
原创 是男人就坚持20秒—python版本
记得玩这个游戏的时候是初中三年级,那时候在qq空间,网页版的,是男人就坚持20秒!很好奇!玩得忘了吃饭,还是坚持不到20秒,现在给大家机会! # coding = utf-8 # time 2015-02-13-20:15 # by qiu import pygame, sys, time, os, random from pygame.locals import * # set
2015-02-14 00:17:00 994
原创 声形并茂的小游戏——采草莓的小姑娘
接触python和pygame一段时间,一直想做做小游戏的,但是都没有时间。终于今天有空闲时间,看网上免费的资源《invent with python》和《making game with pyhton and pygame》。 # coding = utf-8 # data: 2015-02-12 # by qiu import pygame, sys, time, random fr
2015-02-13 16:19:24 1121
原创 Hello! Pygame
Pygame: pygame是一个设计用来开发游戏的python模块,在SDL库的基础上提供了各种接口,从而使用用户能够使用python语言创建各种各样的游戏或多媒体程序。 我的理解:能够使用python开发出2D游戏的工具!Pygame,fly me to the moon! 资源:http://eyehere.net/ http://pyg
2015-01-30 18:35:57 661
原创 Problem - 501B - Codeforces(string+map)
B. Misha and Changing Handles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Misha hacked the Codeforces si
2015-01-12 21:14:34 944
原创 Problem - 409C - Codeforces(brute force + math)
C. Hacking Cypher time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus participates in a competition f
2015-01-09 10:55:40 468
原创 Problem - 499B - Codeforces(string+map)
B. Lecture time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a new professor of graph theory and he s
2015-01-08 12:38:18 628
原创 递归按层遍历二叉树算法
递归模拟队列按层遍历二叉树,简单,易懂,先序创建二叉树Create_tree(),递归求树深度depth,一层层递归打印节点! /* * author : qiu * coding : utf-8 * time : 2014-12-- * fun:递归按层遍历二叉树 * */ #include #include #include #include #include
2014-12-22 20:01:01 617
原创 树状数组BIT 模板
/* * author : qiu * coding : utf-8 * time : 2014-12-- * //fun: BIT_tree * */ #include #include #include #include #include #include #include #include #define debug puts("-----") #defi
2014-12-22 18:01:12 600
原创 字典树Trie 模板
/* * author : qiu * coding : utf-8 * time : 2014-12-- * fun : Trie 树 * */ #include #include #include #include #include #include #include #include #include #include #include #inclu
2014-12-22 17:59:12 422
原创 ACM中Java BigNumber、BigDecimal类的应用
一、运用Java BigNumber、BigDecimal类做大数运算,就是爽!下面总结一些java BigNumber、BigDecimal类的知识点。 1. java.math.BigInteger 类提供操作类似所有Java的基本整数运算符和java.lang.Math中的所有相关的方法。 它还提供了模运算,GCD计算,素性测试,素数生成,位操作,和一些其
2014-12-08 20:58:43 1575
原创 Phone List题解(字典树)
Phone List 字典树题解 【科普】什么是BestCoder?如何参加? Phone List Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11266 Accepted
2014-12-08 15:22:42 718
原创 HDU1251 统计难题题解(字典树入门)
HDU1251 统计难题题解 Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统
2014-12-07 17:56:10 571
原创 BestCoder Round #21 02 Formula题解(规律+离散化)
BestCoder Round #21 02 Formula 官方题解: 找规律 f(1)=1 f(2)=1*1*2=(1)*(1*2)=1!*2! f(3)=1*1*1*2*2*3=(1)*(1*2)*(1*2*3)=1!*2!*3! 式子可以简化为 f(n)=∏i=1n(n!)%MOD,直接打表不行,会超内存,可以对数据进行离线处理。排好序之后从小到大暴力。#
2014-12-07 14:39:37 470
原创 关于.h与h的区别
简单来说: .h的是标准C的头文件,没有.h的是标准C++的头文件,两种都是头文件。 造成这两种形式不同的原因,是C++的发展历史决定的,刚才正好有别的人也问这个问题,这里我再回答一下(注意vs2008和vs2005对标准C++的支持是一样的): 以iostream和stdio.h为例,iostream是C++的库,stdio.h是标准C的库。 2、新的C++标准摒弃了.h形式的头文件,所以在vs
2014-06-01 16:27:52 2021
原创 0/1背包问题
下面是思路的基本过程 问题的特点是:每种物品一件,可以选择放1或不放0。 用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程便是: f[i][v]=max{f[i-1][v],f[i-1][v-c[i]]+w[i]} 这个方程非常重要,据说基本上所有跟背包相关的问题的方程都是由它衍生出来的。所以详细的查了一下
2014-06-01 15:38:09 567
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人