2012年3月13日
摘要: 题目大意: 给定两个长度为N的01字符串,每一次选取其中的一个依次从左往右读,需要保证已经读过的0和1的个数差小于等于k,试问:这样的读字符串方案是否存在?如果存在,第一个字符串从左往右读一位输出1,第二个字符串从左往右读一位输出2,输出字典序最小的输出方案。 方法1:DFS 这个想法比较自然。首先构造出搜索图map[maxn][maxn]。定义扫描状态(i,j)表示当前第一个字符串扫描到了第i... 阅读全文
posted @ 2012-03-13 09:11 bovine 阅读(272) 评论(0) 推荐(0) 编辑
  2012年3月1日
摘要: 菜B也有这一天。被一个素不相识的人叫上准备组队参加比赛。叫上D。也算是有个一个队伍,一个组织。 一直以来,自己总是逃避些什么,猥琐在自己的comfort zone,耗费着光阴。没有历练的青春难免黯淡。 参加比赛,不为什么,为的是给自己一个奋斗的鞭策,让蹂躏来得更猛烈些吧!!已经这把年纪,着实不早了,但如果若干年后我回顾的时候更够自豪地说:“其实也不算太晚!”那么,mission accompl... 阅读全文
posted @ 2012-03-01 11:12 bovine 阅读(150) 评论(0) 推荐(0) 编辑
  2012年2月28日
摘要: Sticks Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 93302Accepted: 20906 Description George took sticks of the same length and cut them randomly until all parts became at most 50 units lo... 阅读全文
posted @ 2012-02-28 22:11 bovine 阅读(355) 评论(0) 推荐(0) 编辑
  2012年2月13日
摘要: Prime PathTime Limit: 1000MSMemory Limit:65536KTotal Submissions: 6713Accepted:3808DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of security 阅读全文
posted @ 2012-02-13 09:05 bovine 阅读(163) 评论(0) 推荐(0) 编辑
摘要: PotsTime Limit: 1000MSMemory Limit:65536KTotal Submissions: 6087Accepted: 2563Special JudgeDescriptionYou are given two pots, having the volume of A and Bliters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the pot ito the drain 阅读全文
posted @ 2012-02-13 09:03 bovine 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Find The MultipleTime Limit: 1000MSMemory Limit:10000KTotal Submissions: 10604Accepted: 4373Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater th 阅读全文
posted @ 2012-02-13 09:01 bovine 阅读(152) 评论(0) 推荐(0) 编辑
  2012年2月9日
摘要: Knight Moves Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 7775Accepted: 4531 Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the ... 阅读全文
posted @ 2012-02-09 17:23 bovine 阅读(251) 评论(0) 推荐(0) 编辑
  2012年1月16日
摘要: 上午刚刚到家,帮母亲处理EXCEL表格,上网学到了一些东西。简单记录一下吧。1. VLOOKUP VLOOKUP函数可以用来进行匹配值的查找。具体的功能是返回该列某一元素所在行的任意属性元素的值。说得我自己都觉得有些生涩...o(╯□╰)o 具体语法是:VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]),其中:lookup_value 必需。要在表格或区域的第一列中搜索的值。lookup_value 参数可以是值或引用。如果为 lookup_value 参数提供的值小于 table_array 参数第一列中... 阅读全文
posted @ 2012-01-16 22:25 bovine 阅读(236) 评论(0) 推荐(0) 编辑
  2011年12月14日
摘要: declaration and definitionAny variable can be defined for only once. On the contrary, declaration is different. Extern declaration is not definition and does not allocate memory for the variable. 2. cin and getlinegetline ignore space, so in case I wanna input something like space inside my string, 阅读全文
posted @ 2011-12-14 14:04 bovine 阅读(288) 评论(0) 推荐(0) 编辑
  2011年12月10日
摘要: 虚函数使得在基类声明的函数能够在各个派生类里面重新定义。比如下面这个例子 1: #include <iostream> 2: #include <string> 3: using namespace std; 4: class Employee{ 5: string first_name, family_name; 6: short department; 7: public: 8: Employee(const string &n, int d); 9: virtual void print() const; 10: };... 阅读全文
posted @ 2011-12-10 22:29 bovine 阅读(176) 评论(0) 推荐(0) 编辑