Angus' MineCraft


  • Home

  • Archives

TopCoder-Power Up C++ with the standard Template Library

Posted on 2017-10-20
Top coder/ Power up C++ with the standard Template Libraryvector 基本操作 对于STL中的容器,判断是否为空的时候,最好使用empty函数,而不是通过size来进行,这是因为size操作并不总是O(1)的操作 Vector resiz ...
Read more »

BFS-DFS概要总结

Posted on 2017-10-20
BFS, DFS最概要的总结转自stackoverflow DFS: 123456list nodes_to_visit = {root};while( nodes_to_visit isn't empty ) { currentnode = nodes_to_vis ...
Read more »

TopCoder-Mathematics

Posted on 2017-10-15 | In Job Hunting
Mathematics for TopcodersPrimes优化1:比较范围只需要限制在sqrt(n) 优化2:偶数不存在质数(除了2),所以对从3开始check的时候,可以一次加2,而不是加1,也就是说只check奇数的因子。 如果只是这样的话,生成一个比较大范围的质数还是比较慢的,因为很多数计 ...
Read more »

TopCoder-How to find a solution

Posted on 2017-10-04 | In Job Hunting
Top Coder: How to find a solutionBFSQuestion Features: ask to find the fewest number of steps(or the shortest path) needed to reach a certain end poi ...
Read more »

刷题中的一些经验总结

Posted on 2017-09-25
编程中的一些经验总结 !是整体取反,~是按位取反。 !的运算优先级大于%,因此有%操作的时候,最好直接上括号 set 内部是无序的,因此distance操作对set来说没有意义。其内部是根据插入元素的大小进行排序的。 lower_bound是返回第一个>= val的iterator, u ...
Read more »
1…345

Angus

只要思想不滑坡,办法总比困难多

21 posts
2 categories
24 tags
© 2019 Angus
Powered by Hexo
|
Theme — NexT.Pisces v5.1.4