#!/usr/bin/env python #-*- coding:utf-8 -*- ''' 给一个MAC地址加1 ''' mac = '52:54:00:e6:b2:0a' prefix_mac = mac[:-2] last_two = mac.split(':')[-1].lower() n... ...
分类:
编程语言 时间:
2019-01-11 17:11:04
阅读次数:
227
You are given an integer sequence 1,2,…,n1,2,…,n. You have to divide it into two sets AAand BB in such a way that each element belongs to exactly one ...
分类:
其他好文 时间:
2019-01-11 13:15:14
阅读次数:
780
执行结果如下: {1: ('one', 'two', 'three'), 2: ('one', 'two', 'three'), 3: ('one', 'two', 'three')}{1: ('one', 'two', 'three'), 2: ('one', 'two', 'three'), 3 ...
分类:
其他好文 时间:
2019-01-11 13:09:10
阅读次数:
221
You are policeman and you are playing a game with Slavik. The game is turn-based and each turn consists of two phases. During the first phase you make ...
分类:
其他好文 时间:
2019-01-11 00:47:53
阅读次数:
163
/ Definition for singly linked list. public class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } / class Solution { public ListNode ...
分类:
其他好文 时间:
2019-01-10 18:23:27
阅读次数:
97
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa ...
分类:
其他好文 时间:
2019-01-10 17:45:12
阅读次数:
115
常量是任何一门语言中都会使用的一种变量类型 如 要表示星期常量,我们可能会直接定义一组变量 JAN = 1 TWO = 2 ... 然后在返回给前端的时候,我们返回的就会是1,2,...这种魔法数字,导致后来的人阅读起来很麻烦。 在python中,为了代码的可读性和简洁性,更建议使用枚举类型 1、枚 ...
分类:
编程语言 时间:
2019-01-10 15:41:04
阅读次数:
187
Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam ...
分类:
其他好文 时间:
2019-01-10 10:50:58
阅读次数:
114
题面 "luogu" "Codeforces" 题目大意: 给一个长度为$n$的序列,求两个不相交的子集长度之和最大是多少,能放入同一子集的条件是首先顺序不能变,然后每一个相邻的要么相差$1$或者相差$7$的倍数。 $n define LL long long define RG register ...
分类:
其他好文 时间:
2019-01-10 10:49:20
阅读次数:
314
An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, including a and b. Find the minimum size of a set S ...
分类:
其他好文 时间:
2019-01-09 23:36:44
阅读次数:
333