本题也是使用暴力法了。
最难的就是读懂题目了。原来这个家伙这么赖,一次只洗一个碗,从不肯多洗。
有两个思路:
1 计算多少碟菜,多少个碗和碟,然后进行加减处理
2 模拟他洗碗的过程
两种方法都需要O(n)时间效率。
方法1:...
分类:
其他好文 时间:
2014-07-22 23:05:16
阅读次数:
296
The circle line of the Berland subway has n stations. We know the distances between all pairs of neighboring stations:
d1 is
the distance between the 1-st and the 2-nd
station;
d2 is
the d...
分类:
其他好文 时间:
2014-07-22 23:05:14
阅读次数:
302
Number Sequence
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 33215
Accepted: 9490
Description
A single positive integer i is given. Write a program to f...
分类:
其他好文 时间:
2014-05-01 22:06:17
阅读次数:
437
按照之前转载的文章,自己先实现了下,表示还是很多坑:
#include "stdio.h"
#include
#include
#include
#include
using namespace std;
int neigor[][2] ={
{-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}
}...
分类:
其他好文 时间:
2014-05-01 18:03:27
阅读次数:
320
表单里面重要的是method,表单的提交方法。...
分类:
Web程序 时间:
2014-05-01 17:54:50
阅读次数:
280
一、 简介
我们知道,针对InnoDB存储引擎,MySQL本身没有提供合适的热备工具,ibbackup虽是一款高效的首选热备方式,但它是是收费的。好在Percona公司给大家提供了一个开源、免费的Xtrabackup热备工具,它可实现ibbackup的所有功能,并且还扩展支持真正的增量备份功能,是商业备份工具InnoDB Hotbackup的一个很好的替代品。
Xtraback...
分类:
数据库 时间:
2014-05-01 17:51:26
阅读次数:
571
.h中添加
int _count;
Layout* layout;
void update(float delta);
layout = Layout::create();
layout->setSize(Size(widgetSize.width, widgetSize.height));...
分类:
其他好文 时间:
2014-04-30 22:28:39
阅读次数:
401
android:scaleType可控制图片的缩放方式,示例代码如下:
1
ImageView android:id="@+id/img"
2
android:src="@drawable/logo"
3
android:scaleType="center...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
376
IT之家(www.ithome.com):腾讯好莱坞合作:网络看最新院线大片
好莱坞主流制片公司正与腾讯(Tencent)展开合作,将开发一种类似Netflix的流媒体服务——在电影于美国影院上映两周后,以流媒体的形式将影片资源传输至中国各地的用户家庭,以此来打击盗版。
华纳兄弟(Warner Brothers)持有腾讯“好莱坞影院”(Hollywood VIP)服务的少数股权...
分类:
其他好文 时间:
2014-04-29 13:11:21
阅读次数:
309