摘要: class Solution { Map<Integer, Integer> map = new HashMap(); public int minDays(int n) { if(n == 0) return 0; if(!map.containsKey(n)){ int ans = n; // 阅读全文
posted @ 2020-08-16 15:49 Sexyomaru 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 分析:在整个数域范围上二分查找最小磁力的大小 然后记录这个最小磁力可以在position上放置几个球,根据球的数量与m的大小来决定二分范围 class Solution { public int maxDistance(int[] position, int m) { int n = positio 阅读全文
posted @ 2020-08-16 14:46 Sexyomaru 阅读(251) 评论(0) 推荐(0) 编辑