创建字典 arr = {'one':{'o':'123'},'two':{'t':'to'}} arr.setdefault('one',{'omg':'o my gud'}) #查看字段是否存在,不存在就创建字典 b = { 'two':{'t':'to'}, 'three' : {'h':'ee ...
分类:
编程语言 时间:
2019-04-19 00:44:49
阅读次数:
140
This time, you are supposed to find A+B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu ...
分类:
其他好文 时间:
2019-04-18 22:13:04
阅读次数:
161
题目分析 打算去cf写写大致题解: There might be another greedy algorithm using LIS/LDS which is more easier to make sense(it doesn't need swapping): To the first ele ...
分类:
其他好文 时间:
2019-04-18 22:07:38
阅读次数:
133
我不懂有没有收藏之类的功能,收藏别人的解法。 tql 有一些答案都用到了iterator迭代器 http://www.cplusplus.com/reference/iterator/ ...
分类:
其他好文 时间:
2019-04-18 20:23:11
阅读次数:
149
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Ex ...
分类:
其他好文 时间:
2019-04-18 12:17:45
阅读次数:
150
题意:给出一串n个数 为1-n的乱序 一共有两个教练 教练一的队伍是1队 二是二队 教练一选择 当前队列中剩余人数的最大序号 将其和左边k个人 和右边k个人 变为一队 如此反复直到所有人都分好队伍 这题思路很巧妙 一开始以为要搜索最大值 时间效率肯定很低 但是可以对位置进行映射 避免了寻找最大值(1 ...
分类:
其他好文 时间:
2019-04-18 01:02:46
阅读次数:
159
Problem Statement AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Ao ...
分类:
其他好文 时间:
2019-04-16 01:01:48
阅读次数:
121
"167. Two Sum II Input array is sorted" 分析:简单题,双指针,如果比target大,则说明j要变小,如果比target小,说明i要变大 "215. Kth Largest Element in an Array" 分析:快排思想,不过递归的时候根据当前位置和k ...
分类:
其他好文 时间:
2019-04-15 21:38:56
阅读次数:
176
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a... ...
分类:
其他好文 时间:
2019-04-15 19:54:40
阅读次数:
131
题目: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, ca ...
分类:
编程语言 时间:
2019-04-14 16:06:22
阅读次数:
161