Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.分析:首先我们熟悉下Roman数字组成规则:罗马数字一共有7个符号,'I':1, 'V'...
分类:
其他好文 时间:
2014-12-02 22:13:38
阅读次数:
161
//点击键盘的回车键
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if ([string isEqualToString:@"\n"]) {
//在这里写你当你点击回...
分类:
移动开发 时间:
2014-12-02 19:18:39
阅读次数:
187
题目大意:给出平面中的一些点,询问平面中的一些矩形中有多少点。
思路:正常应该是二维树状数组,然后数据范围太大。所以就只能按照一个坐标排序,另一个坐标跑树状数组。注意离线操作,一个问题拆成4个。
CODE:
#include
#include
#include
#include
#define MAX 500010
#define RANGE 10000010
u...
分类:
编程语言 时间:
2014-12-02 16:41:44
阅读次数:
298
1. 特性验证。//[Required]//[StringLength(5,MinimumLength=2)]//[Range(typeof(string),"a","z")]//[StringLength(5, MinimumLength = 2)]//[Range(3, 20)]//Output...
分类:
Web程序 时间:
2014-12-02 13:30:06
阅读次数:
239
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Question:Given an integer, convert it to a r...
分类:
其他好文 时间:
2014-12-01 11:25:38
阅读次数:
191
#pragma mark UITextViewDelegate- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ if ...
分类:
移动开发 时间:
2014-11-30 14:05:47
阅读次数:
150
题意:n种物品,每种物品对不同的人都有不同的价值,有三个人选,第一个为普通学生,第二个是集,第三个是祈,集和祈可以选一样的,并且还会获得加分,集和祈选的普通学生都不能选,问三个人怎样选才能使总分最高。解法: 先把集和祈选一样的和存到一个数组sum,然后可以枚举普通学生选的是哪个,再在sum的左边和右...
分类:
其他好文 时间:
2014-11-30 06:15:03
阅读次数:
273
#1070 : RMQ问题再临Time Limit:10000msCase Time Limit:1000msMemory Limit:256MB描述终于,小Hi和小Ho踏上了回国的旅程。在飞机上,望着采购来的特产——小Hi陷入了沉思:还记得在上上周他们去超市的时候,前前后后挑了那么多的东西,都幸运...
分类:
其他好文 时间:
2014-11-29 23:03:41
阅读次数:
529
#!/usr/bin/env python
#Filename:readfile.py
codelist=[]
f=file('input.txt','r')
lines = f.readlines();
for i in range(len(lines)):
line=lines[i].strip('\n');
print line
codelist...
分类:
编程语言 时间:
2014-11-29 21:48:47
阅读次数:
279
#1068 : RMQ-ST算法Time Limit:10000msCase Time Limit:1000msMemory Limit:256MB描述小Hi和小Ho在美国旅行了相当长的一段时间之后,终于准备要回国啦!而在回国之前,他们准备去超市采购一些当地特产——比如汉堡(大雾)之类的回国。但等到...
分类:
编程语言 时间:
2014-11-29 21:34:55
阅读次数:
262