题目描述:从1~n中,随便的拿出一个数字,你来猜测。提示提供一个guess(int num)的api,针对猜测的数字,返回三个数值。0,-1,1
0;猜中返回num
-1:比猜测的数值小
1:比猜测的数值大
例如:n = 10, I pick 6.Return 6.原文描述:We are playing the Guess Game. The game is as follows:I pick a...
分类:
编程语言 时间:
2016-07-30 16:50:32
阅读次数:
255
题目链接:题目:
We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number I picke...
分类:
其他好文 时间:
2016-07-24 00:35:19
阅读次数:
425
原理minMax,最小化最大损失 从第i天到j天中,如果猜x的损失为x + Math.max(DP[i][x-1], DP[x+1][j]) 那么i~j天中最小的最大损失是Math.min(猜x的损失) ...
分类:
其他好文 时间:
2016-07-21 06:24:50
阅读次数:
163
传送门 375. Guess Number Higher or Lower II QuestionEditorial Solution My Submissions 375. Guess Number Higher or Lower II QuestionEditorial Solution My ...
分类:
其他好文 时间:
2016-07-20 13:09:11
阅读次数:
190
binary search. 开始偷懒了一下mid没有写成这样:mid = l + (r - l) / 2,于是卡了很久,简直报应= = ...
分类:
其他好文 时间:
2016-07-20 07:58:23
阅读次数:
181
学习资料:www.fishc.com
我的第一个程序:
print('-------MissZhou的第一个游戏-------------')
temp=input('猜猜她心里想的是那个数字')
guess=int(temp)
if guess==8:
print("你怎么猜到了")
print("猜到了也没用")
else:
print("猜错啦 想的是8")
pr...
分类:
编程语言 时间:
2016-07-19 10:26:47
阅读次数:
216
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron ...
分类:
其他好文 时间:
2016-07-17 11:30:40
阅读次数:
327
We are playing the Guess Game. The game is as follows:
I pick a number from 1 to n. You have to guess which number I picked.
Every time you guess wrong, I'll tell you whether the number is higher ...
分类:
其他好文 时间:
2016-07-15 11:11:50
阅读次数:
141