第十四天92 1. 正则表达式(理解)92 (1)定义:92 (2)常见规则92 A:字符92 B:字符类93 C:预定义字符类93 D:边界匹配器93 E:Greedy 数量词93 (3)常见功能:(分别用的是谁呢?)93 (4)案例94 A:判断电话号码和邮箱... ...
分类:
编程语言 时间:
2016-09-15 12:28:20
阅读次数:
223
题目描述 对于一群(NP个)要互送礼物的朋友,GY要确定每个人送出的钱比收到的多多少。在这一个问题中,每个人都准备了一些钱来送礼物,而这些钱将会被平均分给那些将收到他的礼物的人。然而,在任何一群朋友中,有些人将送出较多的礼物(可能是因为有较多的朋友),有些人有准备了较多的钱。给出一群朋友,没有人的名 ...
分类:
其他好文 时间:
2016-09-14 00:21:44
阅读次数:
178
A bit Greedy can achieve O(m) - the mid station between 2 adjacent cities has the longest distance within that range. ...
分类:
其他好文 时间:
2016-08-07 15:14:47
阅读次数:
208
Greedy - though simple, but fun! ...
分类:
其他好文 时间:
2016-07-13 08:02:28
阅读次数:
167
Another fun Greedy problem to work on: we simply go from first to second last person, as long someone is odd, we distribute bread to her and her next. ...
分类:
其他好文 时间:
2016-07-13 08:01:36
阅读次数:
175
Greedy using priority_queue and hashmap. The basic idea is to have k buckets - and we fill it greedily. And I agree that the code below can be cleaner ...
分类:
其他好文 时间:
2016-06-15 08:01:01
阅读次数:
249
weight=[20,10,26,15]_list = zip(weight, range(0, len(weight)))capacity =70 _list.sort(key=lambda item:item[0])print _list_list_load = []def load(item) ...
分类:
其他好文 时间:
2016-06-07 08:54:52
阅读次数:
189
n=5s = [1,3,0,5,3,5,6,8,8,2,12]f = [4,5,6,7,8,9,10,11,12,13,14]a =[False, False, False, False, False, False, False, False, False, False, False ]_list ...
分类:
其他好文 时间:
2016-06-07 08:52:42
阅读次数:
211
from __future__ import division weight = [10,20,30]volume =[60,100,120]kept = [0,0,0]M = 50def knapback(M, weight, volume, kept): for i in range(0,3): ...
分类:
其他好文 时间:
2016-06-07 08:50:13
阅读次数:
149
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 33888 Accepted: 11544 Description Once upon a time there was a greedy King who ordered ...
分类:
其他好文 时间:
2016-05-19 23:28:31
阅读次数:
531