题目链接:http://codeforces.com/problemset/problem/1033/A Problem Description Alice and Bob are playing chess on a huge chessboard with dimensions n×nn×n. ...
分类:
其他好文 时间:
2019-01-22 22:58:00
阅读次数:
273
//返回一个单值 (1)size //返回列表中元素的个数 return size(["Alice","Bob"])as col 2 //返回模式表达式子图的个数 match(a)where a.name="Alice" return size((a)-->()-->()) as fof 3(2)l ...
分类:
其他好文 时间:
2019-01-20 22:05:01
阅读次数:
170
每封电子邮件都由一个本地名称和一个域名组成,以 @ 符号分隔。 例如,在 alice@leetcode.com中, alice 是本地名称,而 leetcode.com 是域名。 除了小写字母,这些电子邮件还可能包含 ',' 或 '+'。 如果在电子邮件地址的本地名称部分中的某些字符之间添加句点(' ...
分类:
其他好文 时间:
2019-01-15 21:07:54
阅读次数:
221
生成器 首先我们来看看什么是个生成器,生成器本质就是迭代器 在python中有三种方式来获取生成器 1.通过生成器函数 2.通过各种推到式来实现生成器 3.通过数据的转换也可以获取生成器 首先,我们先看一个很简单的函数: 将函数中的return换成yield就是生成器 # 函数 def func() ...
分类:
其他好文 时间:
2019-01-13 22:17:55
阅读次数:
412
列表推导式与生成器表达式 列表推导式的补充:加上条件 多重嵌套 >>> names = [['Tom', 'Billy', 'Jefferson', 'Andrew', 'Wesley', 'Steven', 'Joe'], ['Alice', 'Jill', 'Ana', 'Wendy', 'Je ...
分类:
编程语言 时间:
2019-01-08 19:21:47
阅读次数:
234
"传送门" 完了我连sg函数是个啥都快忘了 设$sg[u]$为以$u$为根节点的子树的$sg$函数值,$rem[u]$表示$u$到根节点的路径删掉之后剩下的游戏的异或值 根节点$u$的$rem$就是它所有子树的异或值,然后对它的每个儿子$v$来说,它们的$rem$需要异或上$rem[u]\bigop ...
分类:
其他好文 时间:
2019-01-07 21:13:38
阅读次数:
255
一、索引 序列中的元素都是有编号的——从0开始递增 字符串就是一个由字符组成的序列,索引0指向第一个元素。 举例:greeting = ‘Hello’ greeting[0] 索引是0,指向的是第一个元素,取出的是'H' 二、列表(可变的——可以改变列表的内容) 从列表中删除元素:使用del语句实现 ...
分类:
其他好文 时间:
2019-01-06 18:26:00
阅读次数:
163
4.1 遍历整个列表 magicians = ['alice','david','carolina'] # 定义了一个列表 for magician in magicians: # 定义了一个for循环 '''这行代码让python从列表migicians中取出一个值,并将这个值存储在了变量magi ...
分类:
编程语言 时间:
2019-01-05 00:18:19
阅读次数:
204
One cold winter evening Alice and her older brother Bob was sitting at home near the fireplace and giving each other interesting problems to solve. Wh ...
分类:
其他好文 时间:
2018-12-30 17:25:18
阅读次数:
193
题目要求 Every email consists of a local name and a domain name, separated by the @ sign. For example, in alice@leetcode.com, alice is the local name, and ...
分类:
其他好文 时间:
2018-12-30 10:38:38
阅读次数:
221