题意 "题目链接" 给出一个序列,求出有多少区间满足$A[l] \oplus A[l+1] \oplus \dots \oplus A[r] = A[l] + A[l + 1] +\dots+ A[r]$ Sol 一个区间能满足要求一定是所有bit上最多只有一个1 这玩意儿显然有单调性,two po ...
分类:
其他好文 时间:
2018-10-18 10:48:23
阅读次数:
162
Given a family tree for a few generations for the entire population and two people write a routine that will find out if they are blood related. Sibli ...
分类:
其他好文 时间:
2018-10-18 10:46:11
阅读次数:
126
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2018-10-17 20:05:34
阅读次数:
128
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating ...
分类:
其他好文 时间:
2018-10-17 16:57:23
阅读次数:
149
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 ...
分类:
其他好文 时间:
2018-10-17 14:30:32
阅读次数:
173
Little Ruins is playing a number game, first he chooses two positive integers yy and KK and calculates f(y,K)f(y,K), here f(y,K)=∑z in every digits of ...
分类:
其他好文 时间:
2018-10-17 00:21:39
阅读次数:
237
题意 给定一个包含$n$个数的序列$a$,在其中任选若干个数,使得他们的和对$m$取模后最大。($n\leq 35$) 题解 显然,$2^n$的暴枚是不现实的...,于是我们想到了折半枚举,分成两部分暴枚,然后考虑合并,合并的时候用two pointers思想扫一遍就行了。 其实这是一道折半枚举+T ...
分类:
其他好文 时间:
2018-10-16 21:59:40
阅读次数:
237
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 ...
分类:
其他好文 时间:
2018-10-16 20:21:31
阅读次数:
189
描述 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations perm ...
分类:
其他好文 时间:
2018-10-16 17:40:00
阅读次数:
143
本质就是对较短数组进行二分查找,找到一个下标 i ,使得 i 和其对应的较长数组中的 j 满足以下条件: 1、i + j = (m + n + 1 )/ 2 2、左侧最大元素小于右侧最小元素 此时,若全部元素数量为奇数,则左侧最大元素为中位数 若全部元素数量为偶数,则左侧最大和右侧最小的均值为中位数 ...
分类:
其他好文 时间:
2018-10-16 17:36:08
阅读次数:
176