
PAT甲级
donCoder
这个作者很懒,什么都没留下…
展开
-
PAT甲级 1003 Emergency (Dj最短路)
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the l...原创 2018-08-16 15:51:35 · 285 阅读 · 2 评论 -
1155 Heap Paths (30 分)( BST+栈 )
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-01-19 18:02:58 · 206 阅读 · 0 评论 -
PAT甲级1010 Radix
最开始想直接暴力,后来看网上题解说可以二分。二分思路就是先将n1转化为10进制,二分搜索枚举n2的进制(low为n2的进制,hi为n1的10进制加1),将n2按照枚举的进制转换为10进制然后与n1的十进制进行比较。注意这里的二分是搜索最小的结果,因此第一次相等后仍然要向前面区间搜索看是否有更小的解。坑点:1、long long也可能会溢出,需要判断溢出2、每一步二分的结果需要判断是...原创 2019-04-24 14:50:41 · 149 阅读 · 0 评论