SumSumSum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Problem Description
We call a positive number X P-number if there is not a positive number that i...
A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is ...
Sum
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述
Consider the natural numbers from 1 to N. By associating to each number a sign (+ or -) and calculating the value of this expression we...
Consider the natural numbers from 1 to N. By associating to each number a sign (+ or -) and calculating the value of this expression we obtain a sum S. The problem is to determine for a given sum S t...
Combination sum:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from ...
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited n...
看了一下数据结构中树的操作,A这题感觉好一点了。Symmetric Tree和这个很相似来着,可以借鉴一下这个思路。用递归处理
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that a...
Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ...
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited nu...