非常卡时间,不能用set
而却糖果是不会重的,之前认为会重也一直超时
别忘了清空,不清空也会超时
#include
using namespace std;
typedef pair candy;
list s;
int main()
{
int n;
while( scanf("%d",&n) && n ){
s.clear();
wh...
分类:
其他好文 时间:
2015-08-03 10:11:54
阅读次数:
255
List接口:一:ArrayList private static final int DEFAULT_CAPACITY = 10; private static final Object[] EMPTY_ELEMENTDATA = {}; private transient Object[]...
分类:
编程语言 时间:
2015-08-03 10:03:00
阅读次数:
140
集合类型
Set集合:集合元素是不能重复的。元素是没有顺序的。所以它不能基于位置访问元素。TreeSet和HashSet是它的实现类。
List集合: 集合元素是可以重复的。元素是有顺序的。所以它可以基于位置访问元素。ArrayList和LinkedList是它的实现类。
Map:它包含键值对。Map的键是不能重复的。Map不能保证存储的顺序。HashMap和TreeMap是它的实现类。...
分类:
编程语言 时间:
2015-08-03 07:51:16
阅读次数:
183
Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num...
分类:
其他好文 时间:
2015-08-03 00:55:11
阅读次数:
133
下面参考下网友的总结:查看brew的帮助brew –help安装软件brew install git卸载软件brew uninstall git搜索软件brew search git显示已经安装软件列表brew list更新软件,把所有的Formula目录更新,并且会对本机已经安装并有更新的软件用*...
分类:
其他好文 时间:
2015-08-03 00:49:07
阅读次数:
313
有时候我们用Myeclipse开发时会出现一些莫名其妙的错误,明明我们没有写错,可是工具却提示错误,显现出个红×,比如我们在写struts.xml时有时候Myeclipse会给你报个错误,例如下:Multipleannotationsfoundatthisline:
-<resultname="success"type="redirect">/emp_list..
分类:
编程语言 时间:
2015-08-02 23:36:49
阅读次数:
160
在看阻塞睡眠实现机制前,我们来看一下内核中广泛用到的等待队列。
Linux内核的等待队列为双循环链表结构,与进程调度机制紧密结合,能够用于实现核心的异步事件通知机制。它有两种数据结构:等待队列头(wait_queue_head_t)和等待队列项(wait_queue_t)。等待队列头和等待队列项中都包含一个list_head(双链表)。通过这样一个双链表把等待进程链接起来。
下面来看两者数据结构...
分类:
其他好文 时间:
2015-08-02 23:28:01
阅读次数:
196
// 先创建窗体,后拉入Button控件两个,一个预览功能,一个打印功能,再拉入控件PrintDocument控件、PrintPreviewDilogs控件、pageSetupDilogs控件// 后台代码 1 List students = new List() {"张三","李四","王五" }...
分类:
其他好文 时间:
2015-08-02 23:18:03
阅读次数:
154
Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --...
分类:
其他好文 时间:
2015-08-02 23:00:31
阅读次数:
103
checkboxval = "" + layers_name_list[i] + ""items = document.getElementsByName("layers");判断是否选中:items[0].checked;设置选中:items[0].checked = true;整形变字符串:St...
分类:
Web程序 时间:
2015-08-02 23:00:07
阅读次数:
143