摘要: warning:statement has no effect [-Wunused-value]|未能赋值,常见错误:m==1/for(i=0;i++;i<m)/ 阅读全文
posted @ 2014-04-10 21:25 money_lady 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 排序在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];. 阅读全文
posted @ 2014-04-10 16:05 money_lady 阅读(772) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2014-04-10 14:44 money_lady 阅读(276) 评论(0) 推荐(0) 编辑