
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
Given two positive integers
x
andy
, an integer is powerful if it is equal tox^i + y^j
for some integersi >= 0
andj >= 0
.Return a list of all powerful integers that have value less than or equal to
bound
.You may return the answer in any order. In your answer, each value should occur at most once.
Example 1:
Example 2:
Note:
1 <= x <= 100
1 <= y <= 100
0 <= bound <= 10^6
这道题定义了一种强力整数,说是给定的整数x和y分别的i次幂和j次幂之和,现在又给了一个整数 bound,让返回不超过这个范围的所有的强力整数。既然是一道 Easy 的题目,就不要考虑太多的技巧了,直接上无脑破解了吧。博主最开始的解法是在 bound 范围内先分别生成x和y的指数数组,即
x^0, x^1, x^2....
和y^0, y^1, y^2....
,然后从两个数组中各自任意取出一个数字来相加,只要不超过 bound,就可以放入结果 res 中了,需要注意的是,若x和y等于1的话,那么会陷入死循环,因为乘以1永远等于其本身,所以要加另外的判断。博主的方法其实可以优化一下,没有必要用额外的数组去保存,而是可以直接在 for 循环中处理就可以了。还有,为了防止重复数字,先是把结果都存入一个 TreeSet 中,利用其可以去除重复项的特点,最后再转回数组就行了,参见代码如下:Github 同步地址:
#970
参考资料:
https://leetcode.com/problems/powerful-integers/
https://leetcode.com/problems/powerful-integers/discuss/214212/JavaC%2B%2BPython-Easy-Brute-Force
https://leetcode.com/problems/powerful-integers/discuss/214197/Java-straightforward-try-all-combinations
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: