AT4266 [ABC113B] Palace 水题解*n translation 有 \(n\) 个地方,第 \(i\) 个地方的海拔为 \(H_i\),该地方的温度为 \(T-H_i \times 0.006\)。 求哪个地方的温度离 \(A\) 最近。 solution 我们可以每次输入 \( ...
分类:
其他好文 时间:
2020-11-04 18:23:24
阅读次数:
15
class Solution { public: int peakIndexInMountainArray(vector<int>& arr) { int n = arr.size(); if(n==0) { return -1; } int left = 0; int right = n-1; w ...
分类:
编程语言 时间:
2020-11-04 17:43:48
阅读次数:
26
5554. 能否连接形成数组 题目链接 题意 给定整数数组 arr ,其中每个整数互不相同 。另有一个由整数数组构成的数组 pieces,其中的整数也互不相同 。请以 任意顺序 连接 pieces 中的数组以形成 arr 。但是,不允许 对每个数组内部 pieces[i] 中的整数重新排序。若可连接 ...
分类:
其他好文 时间:
2020-11-02 10:51:17
阅读次数:
52
1. 题目描述 2. 代码 1 class Solution: 2 def removeDuplicates(self, nums: 'List[int]') -> int: 3 prevalue = 0 4 n = len(nums) 5 count = 0 6 i,j = 0,0 7 while ...
分类:
编程语言 时间:
2020-11-02 09:55:41
阅读次数:
32
5556. 可以到达的最远建筑 刚开始写得时候感觉像贪心,但没分析好不敢写,自己写了个记忆化搜索,后来看讲解把贪心法给补上 记忆化搜索 const int MAXN = 1e5+50; class Solution { public: int dp[MAXN]; int dfs(int now, v ...
分类:
其他好文 时间:
2020-11-01 22:29:28
阅读次数:
84
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annota ...
分类:
移动开发 时间:
2020-11-01 21:28:17
阅读次数:
28
class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { auto dummy = new ListNode(-1), cur = dummy; int t = 0; while(l1 || l2 | ...
分类:
其他好文 时间:
2020-11-01 20:59:38
阅读次数:
11
某些时候ConfigurationManagerClientUpgradePackage客户端升级包分发失败,由于88800004这个是隐藏在控制台当中,无法通过控制台来更新包。在管理中心站点或者主站点hman.box目录中,新建一个client.acu文件等待站点自动更新此升级包D:\ProgramFiles\MicrosoftConfigurationManager\inboxes\hman.
分类:
其他好文 时间:
2020-11-01 20:53:40
阅读次数:
27
class Solution { public boolean isPowerOfTwo(int n) { return n > 0 && (n & (n-1)) == 0; } } 这里引用评论区Kico大神的解释。 ...
分类:
其他好文 时间:
2020-11-01 10:15:58
阅读次数:
8
给定一个二叉树,返回它的 前序 遍历。 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,2,3] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? 递归: 思路: 1.先序遍历,采用的是先根,再左,再右的方式 2.而在访问左子树或者右子树的时候,我们按照同样的方式遍历, ...
分类:
其他好文 时间:
2020-10-31 01:34:45
阅读次数:
19