随笔分类 -  数学

摘要:题目:There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle eve... 阅读全文
posted @ 2016-01-23 21:35 lasclocker 阅读(213) 评论(0) 推荐(0)
摘要:题目:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like... 阅读全文
posted @ 2015-12-13 18:33 lasclocker 阅读(118) 评论(0) 推荐(0)
摘要:题目:Watson给了Sherlock两个整数A和_B_,现在Watson问Sherlock他是否可以计算A和_B_之间(包含A和 B)的完全平方数的个数。完全平方数指的是任何整数的平方。例如,1, 4, 9, 16是完全平方数,因为它们分别是1, 2, 3,4的平方。输入格式 第一行包含一个整数T... 阅读全文
posted @ 2015-12-05 12:00 lasclocker 阅读(210) 评论(0) 推荐(0)
摘要:题目:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For e... 阅读全文
posted @ 2015-12-04 20:12 lasclocker 阅读(235) 评论(0) 推荐(0)
摘要:题目:Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 2^31 - 1.For example,123 -> "One Hund... 阅读全文
posted @ 2015-11-27 13:39 lasclocker 阅读(198) 评论(0) 推荐(0)
摘要:题目:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1... 阅读全文
posted @ 2015-11-22 20:58 lasclocker 阅读(127) 评论(0) 推荐(0)
摘要:题目:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 s... 阅读全文
posted @ 2015-11-01 09:43 lasclocker 阅读(275) 评论(0) 推荐(0)
摘要:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2015-09-13 11:39 lasclocker 阅读(207) 评论(0) 推荐(0)