Posted on 2008-05-21 11:08
superman 阅读(382)
评论(0) 编辑 收藏 引用 所属分类:
ZOJ
1 /* Accepted 1229 C++ 00:00.06 828K */
2 #include <fstream>
3 #include <iostream>
4
5 using namespace std;
6
7 int n, m;
8
9 bool x[50];
10
11 void search(int i, int pos)
12 {
13 if(pos <= 0 || pos >= n + 1)
14 return;
15
16 x[pos] = true;
17 search(i + 1, pos + (2 * i - 1));
18 search(i + 1, pos - (2 * i - 1));
19 }
20
21 int main()
22 {
23 while(cin >> n >> m)
24 {
25 if(n == 0 && m == 0)
26 break;
27
28 if(n >= 50) //i also do not know why
29 {
30 cout << "Let me try!" << endl; continue;
31 }
32
33 memset(x, false, sizeof(x));
34
35 search(2, 1);
36
37 if(x[m])
38 cout << "Let me try!" << endl;
39 else
40 cout << "Don't make fun of me!" << endl;
41 }
42
43 return 0;
44 }
45