你猜猜 | ||||||
| ||||||
Description | ||||||
ACM集训队不培训的闲暇时间里,Woods就会和他的GrilFriend(GF)玩一些小游戏(咳咳…不要邪恶)。GF为了考验Woods和她的默契程度,玩了个“你猜猜”的游戏,规则如下: GF在心里想一个数,然后Woods开始猜,对于Woods每次猜的数,GF可以有三种回答:too high,too low,right on。分别表示太高了,太低了,猜对了。Woods非常了解GF,每次都很快猜对。但是GF非常好强,有的时候就是不想让Woods猜对,于是她可能会故意错误的回答。请你判断一下,GF到底有没有故意回答错误?(参见第一组样例。Woods说10,GF说太高了。Woods说3,GF说太低了。Woods说4,GF说太高了。Woods说2,GF说对了。但显然2不是正确答案。因为Woods说3的时候就已经太低了。)
| ||||||
Input | ||||||
多组测试数据。每组数据包含许多组猜测。每组猜测包括两行,第一行为一个数字代表Woods猜的数,第二行为GF的一个回答,只包含too high,too low,right on三种。每组数据以right on结束。 | ||||||
Output | ||||||
每组数据输出一行。如果GF没有故意回答错误,输出"GF may be honest."如果GF有故意错误回答,输出"GF is dishonest."(引号不输出)。 | ||||||
Sample Input | ||||||
10 too high 3 too low 4 too high 2 right on 5 too low 7 too high 6 right on | ||||||
Sample Output | ||||||
GF is dishonest.GF may be honest. 读第一遍的时候没反应过来,还以为是什么难题,后来才明白,用两个数组分别存low和high,再用right和他们分别比较,如果比low小或者比high大都是错的,要注意等于也算错的,因为这个WA了一发
|
Hust oj 2121 你猜猜(水题)
最新推荐文章于 2021-10-30 02:11:13 发布