题目:Beautiful Subarrays 链接:Here 题意:给一个数组,给一个 '完美区间' 的定义:l 到r 区间内的所有数异或和大于等于k,问给定数组有多少完美区间。 思路: 异或运算可以前缀和处理,用w[i]表示i 前面的数异或和,那么w[5]^w[3]就是4、5两数异或的值。 现在我 ...
分类:
其他好文 时间:
2016-10-10 01:26:14
阅读次数:
210
BeautifulSoup支持大部分的CSS选择器 ,在Tag或BeautifulSoup对象的.select() 方法中传入字符串参数,即可使用CSS选择器的语法找到tag: soup.select("title") soup.select("p nth-of-type(3)") soup.sel ...
分类:
Web程序 时间:
2016-10-07 01:08:53
阅读次数:
215
用BeautifulSoup查找指定标签(元素)的时候,有几种方法: soup=BeautifulSoup(html) 1.soup.find_all(tagName),返回一个指定Tag元素的列表 2.soup.select(selector),返回一个指定Tag元素的列表,是非常好用的方法,它支 ...
分类:
其他好文 时间:
2016-09-28 22:29:40
阅读次数:
198
The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better tha ...
分类:
编程语言 时间:
2016-09-26 17:58:11
阅读次数:
146
The Best Path Problem Description Alice is planning her travel route in a beautiful valley. In this valley, there are N lakes, and M rivers linking th ...
分类:
其他好文 时间:
2016-09-23 21:26:52
阅读次数:
203
I stared because their faces, so different, so similar, were all devastatingly, inhumanly beautiful. 因为他们的脸我看着他们,如此的不同,又如此的相同,都是很有讽刺性的,超越人类的漂亮。 They w ...
分类:
其他好文 时间:
2016-09-23 01:25:57
阅读次数:
156
Description Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is d ...
分类:
其他好文 时间:
2016-09-23 01:22:29
阅读次数:
201
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4782 题意:给html代码美化一下。 细节很重要,有一个坑点就是,文本换行的时候有坑,就是会向上缩并且加空格。 ...
分类:
其他好文 时间:
2016-09-21 21:29:58
阅读次数:
125
题目链接:http://codeforces.com/problemset/problem/55/D 题意:给定区间,求区间内某数的所有数位能整除这个数本身的数的个数。 起初思路:dp(l,s,sum)表示这个数到l位,并且0~9出现的状态s,和为sum的时候的数字个数。发现这个sum不好处理,因为 ...
分类:
其他好文 时间:
2016-09-21 12:55:57
阅读次数:
159