06 2017 档案
摘要:stl中的vector是竞赛中常用的容器,原因在于省内存,$O(1)$ 在后端插入和删除、随机下标访问,今天就来谈谈它的实现。 最简单的一个动态数组 动态数组并不是真正意义上的动态的内存,而是一块连续的内存,当添加新的元素时,容量已经等于当前的大小的时候(存不下了),执行下面3步 重新开辟一块大小为
阅读全文
摘要:Digital collectible card games have become very popular recently. So Vova decided to try one of these. Vova has n cards in his collection. Each of the
阅读全文
摘要:After several latest reforms many tourists are planning to visit Berland, and Berland people understood that it's an opportunity to earn money and cha
阅读全文
摘要:Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the
阅读全文
摘要:Problem A Lucky Year 题目传送门[here] 题目大意是说,只有一个数字非零的数是幸运的,给出一个数,求下一个幸运的数是多少。 这个幸运的数不是最高位的数字都是零,于是只跟最高位有关,只保留最高位,然后加一求差就是答案。 Code 1 /** 2 * Codeforces 3 *
阅读全文