2012年7月31日

一些排序方法的总结

摘要: 1.sort头文件:algorithm(1)有数组a[n],通过sort(a,a+n),可以将数列从a[0]到a[n-1]排序;通过sort(a+1,a+n-1)可以将数列由a[1]到a[n-2]排序。默认是从小到大排序。(2)如果希望从大到小排序或者按照其他规则排序可以设置比较函数。排序对象:struct Group { int s,e,idx; }a[5001];比较函数:bool cmp(Group x, Group y) { if(x.e!=y.e) return x.e<y.e;//从小到大排序 else if(x.s!=y.s) return x.s<y.s... 阅读全文

posted @ 2012-07-31 21:24 铁树银花 阅读(373) 评论(0) 推荐(0) 编辑

<cf>Sysadmin Bob

摘要: B. Sysadmin Bobtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEmail address in Berland is a string of the formA@B, whereAandBare arbitrary strings consisting of small Latin letters.Bob is a system administrator in «Bersoft» company. He 阅读全文

posted @ 2012-07-31 20:41 铁树银花 阅读(257) 评论(0) 推荐(0) 编辑

<cf>Worms Evolution

摘要: Worms Evolutiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor Vasechkin is studying evolution of worms. Recently he put forward hypotheses that all worms evolve by division. There arenforms of worms. Worms of these forms have lengthsa1 阅读全文

posted @ 2012-07-31 10:50 铁树银花 阅读(321) 评论(0) 推荐(0) 编辑

导航