矩形嵌套
时间限制:3000 ms | 内存限制:65535 KB
难度:4
描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于旋转X90度)。例如(1,5)可以嵌套在(6,2)内,但不能嵌套在(3,4)中。你的任务是选出尽可能多的矩形排成一行,使得除最后一个外,每一个矩...
分类:
其他好文 时间:
2014-05-18 18:42:14
阅读次数:
246
接着上一遍文章>,继续学习如何自己设计并使用断言,来更加容易,更加不费力
地自动寻找出程序中的错误。
首先看一个简单的压缩还原程序...
分类:
编程语言 时间:
2014-05-18 18:39:51
阅读次数:
321
#include
using namespace std;
//定义一个函数,用于交换两个变量的值
void swap(int &a, int &b);
void main()
{
int i = 3, j = 5;
cout<<"交换前:i="<<i<<" j="<<j<<endl;
swap(i,j);
cout<<"交换后:i="<<i<<" j="<<j<<endl;...
分类:
其他好文 时间:
2014-05-18 16:05:54
阅读次数:
209
A、Choosing Teams
水题
#include
#include
using namespace std;
int main()
{
int n, k, ans, i, x;
scanf("%d%d",&n,&k);
ans = 0;
for(i=0; i<n; ++i)
{
scanf("%d",&x);...
分类:
其他好文 时间:
2014-05-18 10:53:23
阅读次数:
262
字符串
基本字符串操作
字符串也是序列,因此序列的基本操作(索引、分片、连接、乘法、长度、求最大值和最小值、成员资格)对字符串同样适用:
索引
>>> 'a_string'[0]
'a'
长度
>>> len('a_string')
8
求最大值
>>> max('a_string')
't'
求最小值
>>> min('a_string')
'_'
乘法
>>> ...
分类:
编程语言 时间:
2014-05-18 10:50:15
阅读次数:
325
用jquery实现的一个超级简单的下拉菜单。
效果图
初始效果
鼠标悬浮效果
代码
nav a {
text-decoration: none;
}
nav > ul > li {
float: left;
text-align: center;
padding: 0 0.5em;
}
nav li ul.sub-menu {
...
分类:
Web程序 时间:
2014-05-18 10:48:11
阅读次数:
522
javascript html相互读取
javascript-->html:
举个例子:
网页陶吧
同一页面内的引用方法:
1、使用id:
link1.href,返回值为http://homepage.yesky.com
2、使用name:
document.all.linkname1.href,返回值为http://homepage.yesky.com
3、...
分类:
编程语言 时间:
2014-05-18 10:02:09
阅读次数:
361
【题目】
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. You may not modify the values in the list, only nodes it...
分类:
其他好文 时间:
2014-05-18 08:37:57
阅读次数:
370
Point pos(100, 100); //start point
m_animSprite->setPosition(pos);
int count = 8; float radius = 50.f; float angle = 360.f/count; auto array = PointArray::create(count + 1); Point pt0(r...
分类:
其他好文 时间:
2014-05-18 07:02:31
阅读次数:
250
本文出自:http://blog.csdn.net/svitter
简单应用于登陆界面。jsp:forward的作用是,把当前的JSP页引导到另一个页面上,浏览器地址本显示的是当前网页的地址,内容则是另一个界面的。
1.User.html
登陆信息
-->
用户名:
密码:
<inp...
分类:
Web程序 时间:
2014-05-18 07:01:27
阅读次数:
294