#include#include#include#include#includeusing namespace std;string pa[22];string des;int main(){ int n; while(cin >> n && n != 0){ cin.ig...
分类:
其他好文 时间:
2015-07-16 22:04:42
阅读次数:
229
/*莫队算法是离线算法,用来解决已知l,r问你l,r里面值的问题对块进行排序,后面的块通过前面的块左移右移得到,所以可能有的情况能得到O(1)或者较低的复杂度排序的时候除以跟好n(?)本题题意:从l到r区间内问有多少个不同的数,询问很多*/#include#include#include#inclu...
分类:
编程语言 时间:
2015-07-16 21:58:16
阅读次数:
209
#include using namespace std;class SmallInt{public: /** * implicit constructor * 实现int类型转换为SamllInt类型 */ SmallInt(const int val): value(val) { cout <<...
分类:
编程语言 时间:
2015-07-16 21:58:16
阅读次数:
173
题目传送门 1 /* 2 题意:bob按照指定顺序行走,他的狗可以在他到达下一个点之前到一个景点并及时返回,问狗最多能走多少个景点 3 匈牙利算法:按照狗能否顺利到一个景点分为两个集合,套个模板 4 */ 5 #include 6 #include 7 #inclu...
分类:
编程语言 时间:
2015-07-16 21:58:05
阅读次数:
148
#include using namespace std;class Base1{public: Base1() = default; Base1(const string & str) { strValue = str; } string strValue;};class Base2{public...
分类:
编程语言 时间:
2015-07-16 21:56:37
阅读次数:
124
签到题。思想类似线段树懒操作。#include#includeconst int maxlen = 1000000+10;char str[maxlen];char to[256];int main(){ //freopen("in.txt","r",stdin); //freopen(...
分类:
其他好文 时间:
2015-07-16 21:55:22
阅读次数:
268
题目传送门 1 /* 2 匈牙利算法:这题比UVA_670简单,注意是要被吃的鼠的最少个数,套模板 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 con...
分类:
编程语言 时间:
2015-07-16 21:53:08
阅读次数:
150
#include #include using namespace std;/**::iterator uniqueElements(vector::iterator begPos,vector::iterator endPos){ auto currPos = begPos + 1; while(...
分类:
其他好文 时间:
2015-07-16 21:51:43
阅读次数:
120
#include #include #include #include using namespace std;templatevoid PrintElements(T c){ typename T::const_iterator itr = c.begin();//在GCC下typename不能省...
分类:
编程语言 时间:
2015-07-16 21:47:20
阅读次数:
166
示例代码:#include #include #include #include int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QSqlDatabase db = QSqlDatabase::addDatabase...
分类:
数据库 时间:
2015-07-16 21:46:14
阅读次数:
177