摘要: 1、vector的基本用法#include<vector>(1)定义:vector<int>S;定义一个空的vector对象,存储的是int类型的元素。vector<int>S(n);定义一个含有n个int元素的vector对象。(2)基本操作:S[i];直接以下标方式访问容器中的元素。S.front();返回首元素。S.back();返回尾元素。S.size();返回表长。S.empty();当表为空时返回true,否则返回false。S.pop_back();删除表尾元素。S.begin();返回指向首元素的迭代器。S.end();返回指向尾元素的迭代器 阅读全文
posted @ 2012-08-06 21:18 mtry 阅读(984) 评论(0) 推荐(1)
摘要: InformationTime Limit:2 Seconds Memory Limit:32768 KBIt is a war between Country Alpha and Country Beta. Country Alpha gets following information about Country Beta:Country Beta has n (2 <= n <= 100) cities numbered from 0 to n-1. Each city has a transmitter and a receiver. One city is able to 阅读全文
posted @ 2012-08-06 10:43 mtry 阅读(423) 评论(0) 推荐(0)