【STL&&IO】
chm517
这个作者很懒,什么都没留下…
展开
-
【转】STL-set用法
转自 http://www.cnblogs.com/agpro/archive/2010/06/23/1763536.html// 1.set::begin/end#include #include using namespace std;int main (){ int myints[] = {75,23,65,42,13,13}; setint> myset (转载 2013-08-21 20:01:17 · 509 阅读 · 0 评论 -
【转】c_str()用法
转自http://zhidao.baidu.com/question/104592558.htmlconst char *c_str();c_str()函数返回一个指向正规C字符串的指针, 内容与本string串相同. 这是为了与c语言兼容,在c语言中没有string类型,故必须通过string类对象的成员函数c_str()把string 对象转换成c中的字符串样式。注意:一转载 2013-10-05 20:16:08 · 626 阅读 · 0 评论 -
扩栈语句
G++:int size = 128 << 20; // 128MB char *p = (char*)malloc(size) + size; __asm__("movl %0, %%esp\n" :: "r"(p));C++:#pragma comment(linker, "/STACK:102400000,102400000")原创 2014-08-22 16:41:51 · 486 阅读 · 0 评论 -
my 头文件
#include #include #include #include #include #include #include #include #include #define pb push_back#define mp make_pair#define eps 1e-9#define zero(x) (fabs(x)#define pi ac原创 2014-02-02 14:48:00 · 643 阅读 · 0 评论 -
Printf 里%f,%g的若干使用
引用一个很有用的网址:http://www.cplusplus.com/reference/cstdio/printf/%[flags][width][.precision][length]specifier 先从几个test入手/************test 1**********/#includeint main(){ printf("%10f\n",2.0);原创 2013-07-14 14:33:23 · 2255 阅读 · 0 评论 -
恶意卡TLE && 测评时判断OJ是否将TLE判成RE或WA
大部分oj能识别恶意卡tle的代码,但实在要卡还是可以做到的。//能识别的for(int i=1;i<=1000000000;i++)for(int j=1;j<=1000000000;j++)tt=i+j;//不能识别的scanf("%d",&n);//某个输入for(int i=1;i<=1000000000;i++){ n+=i; n-=i;}原创 2015-03-24 21:54:25 · 1403 阅读 · 0 评论 -
【转】hash_map 与 hash_set 详解
转自:http://blog.csdn.net/kuailekemi/article/details/79699261 数据结构:hash_map原理这是一节让你深入理解hash_map的介绍,如果你只是想囫囵吞枣,不想理解其原理,你倒是可以略过这一节,但我还是建议你看看,多了解一些没有坏处。hash_map基于hash table(哈希表)。 哈希表最大的优点,就是把数据的存转载 2015-06-04 23:35:46 · 440 阅读 · 0 评论