摘要:
Standard Template Library,(标准模板库)《来自百度百科的整理》————可复用性(reusability)STL是基于模板,内联函数的使用使得生成的代码短小高效。在C++标准中,STL被组织为下面的13个头文件:、、、、、、、、、、、、、、、和。STL可分为容器(contai... 阅读全文
摘要:
Fire NetTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 10Accepted Submission(s) : 3Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board 阅读全文
摘要:
排序在ACM题中经常使用到。排序有很多种算法,例如:冒泡:O(n^2)排序,不但程序容易超时,而且浪费宝贵的比赛时间,还很有可能写错. 这里说到的是排序函数,即可以直接调用的函数。sort的用法:sort----复杂度为n*log2(n)第一个参数是要排序的区间首地址,第二个参数是区间尾地址的下一地址。也就是说,排序的区间是[a,b)#include的情况下使用时得注明: using namespace std;或直接打std::sort()还得加上#include例: #include #include using namespace std; int main(){ int a[20];. 阅读全文
摘要:
Wooden SticksTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 35Accepted Submission(s) : 11Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description There is a pile of n wooden sticks. The length and weight of each stick are known in 阅读全文
摘要:
Tian Ji -- The Horse RacingTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 19Accepted Submission(s) : 5Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description Here is a famous story in Chinese history."That was about 2300 yea 阅读全文