锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品美女久久久久aⅴ国产馆,欧美精品久久99,午夜精品国产精品大乳美女http://m.shnenglu.com/superman/category/6619.html鑱氱簿浼氱鎼炲緩璁?涓蹇冧竴鎰忚皨鍙戝睍zh-cnSun, 28 Sep 2008 23:16:19 GMTSun, 28 Sep 2008 23:16:19 GMT60URAL 1039 - Anniversary partyhttp://m.shnenglu.com/superman/archive/2008/09/28/62958.htmlsupermansupermanSun, 28 Sep 2008 02:05:00 GMThttp://m.shnenglu.com/superman/archive/2008/09/28/62958.htmlhttp://m.shnenglu.com/superman/comments/62958.htmlhttp://m.shnenglu.com/superman/archive/2008/09/28/62958.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/62958.htmlhttp://m.shnenglu.com/superman/services/trackbacks/62958.html 1 /* Accepted 0.109 457 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int n;
 7 int s[6000];
 8 int p[6000];
 9 
10 int f[6000][2];
11 
12 void search(int i)
13 {
14     int SonCnt = 0;
15     for(int k = 0; k < n; k++)
16         if(p[k] == i)
17         {
18             search(k);
19             SonCnt++;
20         }
21     
22     if(SonCnt == 0)
23     {
24         f[i][0= 0; f[i][1= s[i];
25         return;
26     }
27     
28     f[i][1= s[i];
29     for(int k = 0; k < n; k++)
30         if(p[k] == i)
31         {
32             f[i][0+= max(f[k][0], f[k][1]);
33             f[i][1+= f[k][0];
34         }
35 }
36 
37 int main()
38 {
39     memset(p, 255sizeof(p));
40     
41     scanf("%d"&n);
42     for(int i = 0; i < n; i++)
43         scanf("%d", s + i);
44     while(true)
45     {
46         int s, t;
47         scanf("%d %d"&s, &t);
48         if(s == 0 && t == 0)
49             break;
50         p[s - 1= t - 1;
51     }
52     
53     int root;
54     for(int i = 0; i < n; i++)
55         if(p[i] == -1)
56         {
57             root = i; break;
58         }
59     
60     search(root);
61     
62     cout << max(f[root][0], f[root][1]) << endl;
63     
64     return 0;
65 }
66 

superman 2008-09-28 10:05 鍙戣〃璇勮
]]>
URAL 1037 - Memory managementhttp://m.shnenglu.com/superman/archive/2008/09/22/62536.htmlsupermansupermanMon, 22 Sep 2008 15:19:00 GMThttp://m.shnenglu.com/superman/archive/2008/09/22/62536.htmlhttp://m.shnenglu.com/superman/comments/62536.htmlhttp://m.shnenglu.com/superman/archive/2008/09/22/62536.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/62536.htmlhttp://m.shnenglu.com/superman/services/trackbacks/62536.html  1 /* Accepted  0.312 557 KB */
  2 #include <iostream>
  3 
  4 using namespace std;
  5 
  6 const int maxn = 30000;
  7 
  8 template <class T>
  9 class Heap
 10 {
 11 private:
 12     T A[maxn + 1]; int len;
 13     inline int Parent(int i) { return i / 2; }
 14     inline int Lchild(int i) { return i * 2; }
 15     inline int Rchild(int i) { return i * 2 + 1; }
 16     
 17 public:
 18     Heap(const T * x, const int & n)
 19     {
 20         len = n;
 21         for(int i = 1; i <= n; i++)
 22             A[i] = x[i];
 23         for(int i = n / 2; i >= 1; i--)
 24             modify(i);
 25     }
 26     Heap(int s, int t)
 27     {
 28         len = t - s + 1;
 29         for(int i = 1; i <= len; i++)
 30             A[i] = s + i - 1;
 31     }
 32     Heap() { len = 0; }
 33     void modify(int i)
 34     {
 35         int min = i;
 36         int l = Lchild(i);
 37         int r = Rchild(i);
 38         if(l <= len && A[l] < A[min]) min = l;
 39         if(r <= len && A[r] < A[min]) min = r;
 40         if(i != min)
 41         {
 42             swap(A[i], A[min]);
 43             modify(min);
 44         }
 45     }
 46     bool empty() { return len == 0; }
 47     T & getmin() { return A[1]; }
 48     void push(const T & item)
 49     {
 50         A[len + 1= item;
 51         int i = len + 1;
 52         while(i > 1 && A[i] < A[Parent(i)])
 53         {
 54             swap(A[i], A[Parent(i)]);
 55             i = Parent(i);
 56         }
 57         len++;
 58     }
 59     void pop()
 60     {
 61         swap(A[1], A[len]);
 62         len--;
 63         modify(1);
 64     }
 65     bool update(intint);
 66 }   ;
 67 
 68 template <class T>
 69 bool Heap<T>::update(int num, int latest)
 70 {
 71     for(int i = 1; i <= len; i++)
 72         if(A[i].num == num)
 73         {
 74             A[i].latest = latest;
 75             modify(i);
 76             
 77             return true;
 78         }
 79     return false;
 80 }
 81 
 82 struct rec
 83 {
 84     int num, latest;
 85     
 86     bool operator < (const rec & x) const
 87     {
 88         return latest < x.latest;
 89     }
 90 }   ;
 91 
 92 //=============================================
 93 int currentTime, accessNum;
 94 Heap <int> X(130000);
 95 Heap <rec> Y;
 96 
 97 void allocate()
 98 {
 99     while(Y.empty() == false && currentTime - Y.getmin().latest >= 600)
100     {
101         X.push(Y.getmin().num);
102         Y.pop();
103     }
104     
105     cout << X.getmin() << endl;
106     rec r = { X.getmin(), currentTime };
107     Y.push(r);
108     X.pop();
109 }
110 
111 void access()
112 {
113     while(Y.empty() == false && currentTime - Y.getmin().latest >= 600)
114     {
115         X.push(Y.getmin().num);
116         Y.pop();
117     }
118     
119     cout << (Y.update(accessNum, currentTime) ? '+' : '-'<< endl;
120 }
121 
122 int main()
123 {
124     char c;
125     while(true)
126     {
127         if(scanf("%d %c"&currentTime, &c) == EOF)
128             break;
129         
130         if(c == '+')
131             allocate();
132         else
133         {
134             scanf("%d"&accessNum);
135             access();
136         }
137     }
138     
139     return 0;
140 }

superman 2008-09-22 23:19 鍙戣〃璇勮
]]>
URAL 1018 - A Binary Apple Treehttp://m.shnenglu.com/superman/archive/2008/04/24/47965.htmlsupermansupermanWed, 23 Apr 2008 16:22:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/24/47965.htmlhttp://m.shnenglu.com/superman/comments/47965.htmlhttp://m.shnenglu.com/superman/archive/2008/04/24/47965.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/47965.htmlhttp://m.shnenglu.com/superman/services/trackbacks/47965.html 1 /* Accepted 0.001 292 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int n, m, map[101][101], opt[101][101];
 7 
 8 struct BinaryTree
 9 {
10      int num, apple;
11      BinaryTree * left, * right;
12      
13      BinaryTree()
14      {
15           left = right = NULL;
16      }
17      void PostOrder()
18      {
19           if(left == NULL && right == NULL)
20           {
21                opt[num][1= apple;
22                return;
23           }
24           if(left)
25                left -> PostOrder();
26           if(right)
27                right -> PostOrder();
28           
29           for(int i = 1; i <= m; i++)
30           {
31                int max = 0;
32                for(int j = 0; j < i; j++)
33                     if(max < opt[left -> num][j] + opt[right -> num][i - j - 1])
34                          max = opt[left -> num][j] + opt[right -> num][i - j - 1];
35                opt[num][i] = max + apple;
36           }
37      }
38 }Tree[101];
39 
40 bool visited[101];
41 void dfs(int p)
42 {
43      visited[p] = true;
44      for(int i = 1; i <= n; i++)
45           if(map[p][i] && visited[i] == false)
46           {
47                Tree[i].num = i;
48                Tree[i].apple = map[p][i];
49
50                if(Tree[p].left == NULL)
51                     Tree[p].left = &Tree[i];
52                else
53                     Tree[p].right = &Tree[i];                
54                dfs(i);
55           }
56 }
57 
58 int main()
59 {
60      cin >> n >> m; m++;
61      
62      int s, t, l;
63      while(cin >> s >> t >> l)
64           map[s][t] = map[t][s] = l;
65      
66      dfs(1);
67      
68      Tree[1].num = 1;
69      Tree[1].apple = 0;
70      Tree[1].PostOrder();
71      
72      cout << opt[1][m] << endl;
73      
74      return 0;
75 }
76 

superman 2008-04-24 00:22 鍙戣〃璇勮
]]>
URAL 1060 - Flip Gamehttp://m.shnenglu.com/superman/archive/2008/04/16/47176.htmlsupermansupermanTue, 15 Apr 2008 18:34:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/16/47176.htmlhttp://m.shnenglu.com/superman/comments/47176.htmlhttp://m.shnenglu.com/superman/archive/2008/04/16/47176.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/47176.htmlhttp://m.shnenglu.com/superman/services/trackbacks/47176.html 1 /* C++ Accepted 0.015 380 KB */
 2 #include <queue>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 struct rec { int n, m; };
 8 
 9 int main()
10 {
11     int n = 0char c;
12     for(int i = 0; i < 16; i++)
13     {
14         cin.get(c);
15         if(c == '\n')
16         {
17             i--;
18             continue;
19         }
20         if(c == 'b')
21             n |= (1 << i);
22     }
23     
24     rec cur = {n, 0};
25     queue <rec> q;
26     q.push(cur);
27     
28     bool repeat[65536= {false}, find = false;
29     while(q.empty() == false)
30     {
31         cur = q.front(); q.pop();
32         
33         if(cur.n == 0 || cur.n == 65535)
34         {
35             cout << cur.m << endl;
36             find = true;
37             break;
38         }
39         
40         for(int i = 0; i < 16; i++)
41         {
42             int t = cur.n;
43             
44             t ^= (1 << i);
45             if(i - 4 >= 0)
46                 t ^= (1 << (i - 4));
47             if(i + 4 < 16)
48                 t ^= (1 << (i + 4));
49             if(i % 4 - 1 >= 0)
50                 t ^= (1 << (i - 1));
51             if(i % 4 + 1 < 4)
52                 t ^= (1 << (i + 1));
53             
54             if(repeat[t] == false)
55             {
56                 repeat[t] = true;
57                 rec tmp = {t, cur.m + 1};
58                 q.push(tmp);
59             }
60         }
61     }
62     
63     if(find == false)
64         cout << "Impossible" << endl;
65     
66     return 0;
67 }
68 

superman 2008-04-16 02:34 鍙戣〃璇勮
]]>
URAL 1052 - Rabbit hunthttp://m.shnenglu.com/superman/archive/2008/04/15/47126.htmlsupermansupermanTue, 15 Apr 2008 07:32:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/15/47126.htmlhttp://m.shnenglu.com/superman/comments/47126.htmlhttp://m.shnenglu.com/superman/archive/2008/04/15/47126.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/47126.htmlhttp://m.shnenglu.com/superman/services/trackbacks/47126.html 1 /* Accepted 0.046 200 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     struct { int x, y; } p[200];
 9     
10     int n;
11     cin >> n;
12     for(int i = 0; i < n; i++)
13         cin >> p[i].x >> p[i].y;
14     
15     int max = 0;
16     for(int i = 0; i < n; i++)
17     for(int j = 0; j < n; j++)
18         if(i != j)
19         {
20             int x = p[j].x - p[i].x;
21             int y = p[j].y - p[i].y;
22             
23             int cnt = 2;
24             for(int k = 0; k < n; k++)
25                 if(k != i && k != j)
26                     if(x * (p[k].y - p[i].y) == y * (p[k].x - p[i].x))
27                         cnt++;
28             if(max < cnt)
29                 max = cnt;
30         }
31     
32     cout << max << endl;
33     
34     return 0;
35 }
36 

superman 2008-04-15 15:32 鍙戣〃璇勮
]]>
URAL 1109 - Conferencehttp://m.shnenglu.com/superman/archive/2008/04/14/47084.htmlsupermansupermanMon, 14 Apr 2008 15:02:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/14/47084.htmlhttp://m.shnenglu.com/superman/comments/47084.htmlhttp://m.shnenglu.com/superman/archive/2008/04/14/47084.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/47084.htmlhttp://m.shnenglu.com/superman/services/trackbacks/47084.html 1 /* Accepted 0.39 1 200 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int n, m, match[1000];
 7 bool map[1000][1000], visited[1000];
 8 
 9 bool dfs(int p)
10 {
11     for(int i = 0; i < m; i++)
12         if(map[p][i] && visited[i] == false)
13         {
14             visited[i] = true;
15             if(match[i] == -1 || dfs(match[i]))
16             {
17                 match[i] = p;
18                 return true;
19             }
20         }
21     return false;
22 }
23 
24 int main()
25 {
26     int s, t;
27     cin >> n >> m >> s;
28     while(cin >> s >> t)
29     {
30         s--, t--;
31         map[s][t] = true;
32     }
33     
34     int cnt = 0;
35     memset(match, 0XFFsizeof(match));
36     for(int i = 0; i < n; i++)
37     {
38         memset(visited, falsesizeof(visited));
39         cnt += dfs(i);
40     }
41     
42     cout << n + m - 2 * cnt + cnt << endl;
43     
44     return 0;
45 }
46 

superman 2008-04-14 23:02 鍙戣〃璇勮
]]>
URAL 1009 - K-based numbershttp://m.shnenglu.com/superman/archive/2008/04/08/46514.htmlsupermansupermanTue, 08 Apr 2008 07:52:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/08/46514.htmlhttp://m.shnenglu.com/superman/comments/46514.htmlhttp://m.shnenglu.com/superman/archive/2008/04/08/46514.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46514.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46514.html 1 /* Accepted 0.001 196 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n, k;
 9     unsigned long long cnt[20][2= {0};
10     
11     cin >> n >> k;
12     cnt[1][1= k - 1;
13     for(int i = 2; i <= n; i++)
14     {
15         cnt[i][0= cnt[i - 1][1];
16         cnt[i][1= (cnt[i - 1][0+ cnt[i - 1][1]) * (k - 1);
17     }
18     cout << cnt[n][0+ cnt[n][1<< endl;
19     
20     return 0;
21 }
22 

superman 2008-04-08 15:52 鍙戣〃璇勮
]]>
URAL 1007 - Code wordshttp://m.shnenglu.com/superman/archive/2008/04/08/46507.htmlsupermansupermanTue, 08 Apr 2008 06:20:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/08/46507.htmlhttp://m.shnenglu.com/superman/comments/46507.htmlhttp://m.shnenglu.com/superman/archive/2008/04/08/46507.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46507.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46507.html 1 /* Accepted 1.968 204 KB */
 2 #include <string>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 int main()
 8 {
 9     int n;
10     cin >> n;
11     string word;
12     while(cin >> word)
13     {
14         if(word.size() == n - 1)
15             for(int i = 0; i < n; i++)
16             {
17                 int sum = 0;
18                 for(int j = 0;j < i; j++)
19                     sum += (word[j] == '1' ? j + 10);
20                 for(int j = i; j < n - 1; j++)
21                     sum += (word[j] == '1' ? j + 20);
22                 if(sum == 0 || sum % (n + 1== 0 || (sum + i + 1% (n + 1== 0)
23                 {
24                     for(int j = 0;j < i; j++)
25                         cout << word[j];
26                     cout << (sum % (n + 1== 0 ? '0' : '1');
27                     for(int j = i; j < n - 1; j++)
28                         cout << word[j];
29                     cout << endl;
30                     break;
31                 }
32             }
33         if(word.size() == n)
34         {
35             for(int i = 0; i < n; i++)
36                 if(word[i] == '1')
37                 {
38                     int sum = 0;
39                     word[i] = '0';
40                     for(int j = 0; j < n; j++)
41                         sum += (word[j] == '1' ? j + 1 : 0);
42                     if(sum == 0 || sum % (n + 1== 0)
43                         break;
44                     word[i] = '1';
45                 }
46             cout << word << endl;
47         }
48         if(word.size() == n + 1)
49             for(int i = 0; i < n + 1; i++)
50             {
51                 int sum = 0;
52                 for(int j = 0; j < i; j++)
53                     sum += (word[j] == '1' ? j + 1 : 0);
54                 for(int j = i + 1; j < n + 1; j++)
55                     sum += (word[j] == '1' ? j : 0);
56                 if(sum == 0 || sum % (n + 1== 0)
57                 {
58                     for(int j = 0; j < i; j++)
59                         cout << word[j];
60                     for(int j = i + 1; j < n + 1; j++)
61                         cout << word[j];
62                     cout << endl;
63                     break;
64                 }
65             }
66     }
67     
68     return 0;
69 }
70 

superman 2008-04-08 14:20 鍙戣〃璇勮
]]>
URAL 1008 - Image encodinghttp://m.shnenglu.com/superman/archive/2008/04/08/46499.htmlsupermansupermanTue, 08 Apr 2008 05:05:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/08/46499.htmlhttp://m.shnenglu.com/superman/comments/46499.htmlhttp://m.shnenglu.com/superman/archive/2008/04/08/46499.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46499.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46499.html  1 /* Accepted 0.015 212 KB */
  2 #include <queue>
  3 #include <cctype>
  4 #include <string>
  5 #include <iostream>
  6 
  7 using namespace std;
  8 
  9 struct pixel { int x, y; };
 10 
 11 int main()
 12 {
 13     int n, x, y;
 14     bool map[12][12= {false};
 15     
 16     cin >> n;
 17     if(cin.get() == '\n')
 18     {
 19         int sx, sy;
 20         cin >> sx >> sy;
 21         cout << sx << ' ' << sy << endl;
 22         
 23         map[sx][sy] = true;
 24         while(cin >> x >> y)
 25             map[x][y] = true;
 26         
 27         pixel cur = {sx, sy};
 28         queue <pixel> q;
 29         q.push(cur);
 30         
 31         while(q.empty() == false)
 32         {
 33             n--;
 34             cur = q.front(); q.pop();
 35             map[cur.x][cur.y] = false;
 36             if(map[cur.x + 1][cur.y])
 37             {
 38                 cout << 'R';
 39                 map[cur.x + 1][cur.y] = false;
 40                 pixel tmp = {cur.x + 1, cur.y};
 41                 q.push(tmp);
 42             }
 43             if(map[cur.x][cur.y + 1])
 44             {
 45                 cout << 'T';
 46                 map[cur.x][cur.y + 1= false;
 47                 pixel tmp = {cur.x, cur.y + 1};
 48                 q.push(tmp);
 49             }
 50             if(map[cur.x - 1][cur.y])
 51             {
 52                 cout << 'L';
 53                 map[cur.x - 1][cur.y] = false;
 54                 pixel tmp = {cur.x - 1, cur.y};
 55                 q.push(tmp);
 56             }
 57             if(map[cur.x][cur.y - 1])
 58             {
 59                 cout << 'B';
 60                 map[cur.x][cur.y - 1= false;
 61                 pixel tmp = {cur.x, cur.y - 1};
 62                 q.push(tmp);
 63             }
 64             cout << (n ? ',' : '.'<< endl;
 65         }
 66     }
 67     else
 68     {
 69         int x = n, y, cnt = 0; cin >> y;
 70         pixel cur = {x, y};
 71         
 72         queue <pixel> q;
 73         q.push(cur);
 74         
 75         string s;
 76         while(q.empty() == false)
 77         {
 78             cnt++;
 79             cin >> s;
 80             cur = q.front(); q.pop();
 81             map[cur.x][cur.y] = true;
 82             for(int i = 0; isalpha(s[i]); i++)
 83             {
 84                 if(s[i] == 'R')
 85                 {
 86                     pixel tmp = {cur.x + 1, cur.y};
 87                     q.push(tmp);
 88                 }
 89                 if(s[i] == 'T')
 90                 {
 91                     pixel tmp = {cur.x, cur.y + 1};
 92                     q.push(tmp);
 93                 }
 94                 if(s[i] == 'L')
 95                 {
 96                     pixel tmp = {cur.x - 1, cur.y};
 97                     q.push(tmp);
 98                 }
 99                 if(s[i] == 'B')
100                 {
101                     pixel tmp = {cur.x, cur.y - 1};
102                     q.push(tmp);
103                 }
104             }
105         }
106         cout << cnt << endl;
107         for(int i = 1; i <= 10; i++)
108         for(int j = 1; j <= 10; j++)
109             if(map[i][j])
110                 cout << i << ' ' << j << endl;
111     }
112     
113     return 0;
114 }
115 

superman 2008-04-08 13:05 鍙戣〃璇勮
]]>
URAL 1005 - Stone pilehttp://m.shnenglu.com/superman/archive/2008/04/08/46470.htmlsupermansupermanMon, 07 Apr 2008 16:18:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/08/46470.htmlhttp://m.shnenglu.com/superman/comments/46470.htmlhttp://m.shnenglu.com/superman/archive/2008/04/08/46470.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46470.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46470.htmlUral can not use <?= operator :(
 1 /* Accepted 0.031 200 KB */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int n, w[20], cnt, best = 0X7FFFFFFF;
 7 
 8 void search(int i, int sum)
 9 {
10     if(i == n)
11         return;
12     if(best > abs(cnt - 2 * sum))
13         best = abs(cnt - 2 * sum);
14     search(i + 1, sum);
15     search(i + 1, sum + w[i]);
16 }
17 
18 int main()
19 {
20     cin >> n;
21     for(int i = 0; i < n; i++)
22     {
23         cin >> w[i];
24         cnt += w[i];
25     }
26     search(00);
27     cout << best << endl;
28     
29     return 0;
30 }
31 


superman 2008-04-08 00:18 鍙戣〃璇勮
]]>
URAL 1002 - Phone numbershttp://m.shnenglu.com/superman/archive/2008/04/05/46296.htmlsupermansupermanSat, 05 Apr 2008 02:53:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/05/46296.htmlhttp://m.shnenglu.com/superman/comments/46296.htmlhttp://m.shnenglu.com/superman/archive/2008/04/05/46296.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46296.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46296.html 1 /* Accepted 0.125 1 576 KB */
 2 #include <string>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 void str2digit(string & s, string & digit)
 8 {
 9     for(int i = 0; i < s.size(); i++)
10     {
11         if(s[i] == 'i' || s[i] == 'j') {
12             digit += '1'continue;
13         }
14         if(s[i] == 'a' || s[i] == 'b' || s[i] == 'c') {
15             digit += '2'continue;
16         }
17         if(s[i] == 'd' || s[i] == 'e' || s[i] == 'f') {
18             digit += '3'continue;
19         }
20         if(s[i] == 'g' || s[i] == 'h') {
21             digit += '4'continue;
22         }
23         if(s[i] == 'k' || s[i] == 'l') {
24             digit += '5'continue;
25         }
26         if(s[i] == 'm' || s[i] == 'n') {
27             digit += '6'continue;
28         }
29         if(s[i] == 'p' || s[i] == 'r' || s[i] == 's') {
30             digit += '7'continue;
31         }
32         if(s[i] == 't' || s[i] == 'u' || s[i] == 'v') {
33             digit += '8'continue;
34         }
35         if(s[i] == 'w' || s[i] == 'x' || s[i] == 'y') {
36             digit += '9'continue;
37         }
38         if(s[i] == 'o' || s[i] == 'q' || s[i] == 'z') {
39             digit += '0'continue;
40         }
41     }
42 }
43 
44 int main()
45 {
46     string num;
47     while((cin >> num) && num != "-1")
48     {
49         int n;
50         cin >> n;
51         
52         string * dict = new string[n];
53         string * digit = new string[n];
54         
55         for(int i = 0; i < n; i++)
56         {
57             cin >> dict[i];
58             str2digit(dict[i], digit[i]);
59         }
60         
61         unsigned opt[101], path[101= {0}, choice[101= {0};
62         memset(opt, 0XFFsizeof(opt));
63         
64         opt[0= 0;
65         for(int i = 0; i < num.size(); i++)
66         {
67             if(opt[i] == 0XFFFFFFFF)
68                 continue;
69             for(int j = 0; j < n; j++)
70                 if(num.find(digit[j], i) == i)
71                     if(opt[i] + 1 < opt[i + digit[j].size()])
72                     {
73                         opt[i + digit[j].size()] = opt[i] + 1;
74                         path[i + digit[j].size()] = i;
75                         choice[i + digit[j].size()] = j;
76                     }
77         }
78         
79         if(opt[num.size()] == 0XFFFFFFFF)
80             cout << "No solution." << endl;
81         else
82         {
83             int x[101], m = 0, pos = num.size();
84             while(pos)
85             {
86                 x[m++= choice[pos];
87                 pos = path[pos];
88             }
89             for(int i = m - 1; i >= 0; i--)
90                 cout << dict[x[i]] << (i == 0 ? '\n' : ' ');
91         }
92         
93         delete []dict;
94         delete []digit;
95     }
96     
97     return 0;
98 }
99 

superman 2008-04-05 10:53 鍙戣〃璇勮
]]>
URAL 1001 - Reverse roothttp://m.shnenglu.com/superman/archive/2008/04/04/46280.htmlsupermansupermanFri, 04 Apr 2008 14:43:00 GMThttp://m.shnenglu.com/superman/archive/2008/04/04/46280.htmlhttp://m.shnenglu.com/superman/comments/46280.htmlhttp://m.shnenglu.com/superman/archive/2008/04/04/46280.html#Feedback0http://m.shnenglu.com/superman/comments/commentRss/46280.htmlhttp://m.shnenglu.com/superman/services/trackbacks/46280.html 1 /* Accepted 1.062 3 060 KB */
 2 #include <stack>
 3 #include <math.h>
 4 #include <iostream>
 5 
 6 using namespace std;
 7 
 8 int main()
 9 {
10     double n;
11     stack <double> set;
12     while(cin >> n)
13         set.push(n);
14     
15     cout.setf(ios_base::showpoint);
16     cout.setf(ios_base::fixed);
17     cout.precision(4);
18     
19     while(set.empty() == false)
20     {
21         cout << sqrt(set.top()) << endl;
22         set.pop();
23     }
24     
25     return 0;
26 }
27 

superman 2008-04-04 22:43 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久激情视频| 国产欧美日韩视频一区二区| 91久久综合亚洲鲁鲁五月天| 久久激情五月婷婷| 久久九九热免费视频| 久久久精品性| 免费在线亚洲| 91久久国产自产拍夜夜嗨| aⅴ色国产欧美| 亚洲伊人网站| 久久一区中文字幕| 欧美成人精品一区| 国产精品久久久久久久久免费| 国产精品丝袜91| 黑人中文字幕一区二区三区| 最新中文字幕一区二区三区| 日韩视频一区| 久久国产精品久久精品国产| 欧美国产在线观看| 亚洲专区欧美专区| 久久香蕉国产线看观看网| 欧美日韩国产综合新一区| 国产精品一区二区在线观看| 亚洲国产精品第一区二区三区| 亚洲视频免费| 另类春色校园亚洲| 亚洲视频一区在线| 欧美国内亚洲| 黄色成人精品网站| 亚洲私人影吧| 欧美成人一区二区| 香蕉乱码成人久久天堂爱免费| 欧美电影在线播放| 国产曰批免费观看久久久| 99精品欧美| 蜜桃伊人久久| 亚洲欧美清纯在线制服| 欧美精品123区| 国产一区二区三区直播精品电影| av成人国产| 欧美成人福利视频| 久久成人免费电影| 国产精品欧美精品| 亚洲午夜久久久久久久久电影网| 麻豆av一区二区三区久久| 亚洲无人区一区| 欧美精品少妇一区二区三区| 国产综合久久久久影院| 羞羞漫画18久久大片| 99视频日韩| 欧美激情久久久久久| 国产伦精品一区二区三区免费迷 | 国产精品户外野外| 亚洲精品国产品国语在线app| 欧美中在线观看| 亚洲视频精品| 欧美视频一区二区| 99国产精品视频免费观看| 欧美大胆人体视频| 免费高清在线视频一区·| 在线成人h网| 蜜桃伊人久久| 免费欧美日韩| 亚洲精品国产系列| 亚洲黄页视频免费观看| 欧美理论在线| 亚洲午夜精品久久久久久浪潮| 亚洲精品极品| 欧美亚洲成人精品| 欧美一区二区三区在线观看视频| 亚洲男女自偷自拍| 激情久久久久久久久久久久久久久久| 久久久久国产免费免费| 久久人人爽人人| 亚洲精品视频免费在线观看| 亚洲精品视频啊美女在线直播| 欧美激情1区2区3区| 一区二区三区精品久久久| 中文av字幕一区| 国产午夜精品久久久| 另类欧美日韩国产在线| 欧美激情综合| 欧美中文字幕不卡| 久久综合一区二区| 亚洲视频一区在线观看| 亚洲欧美在线播放| 亚洲大片一区二区三区| 亚洲黄色精品| 国产精品中文字幕欧美| 美女黄色成人网| 欧美日韩另类视频| 久久人人超碰| 欧美午夜精品久久久| 老司机一区二区| 欧美系列亚洲系列| 毛片基地黄久久久久久天堂| 欧美国产亚洲精品久久久8v| 亚洲在线观看视频网站| 久久人人97超碰精品888| 亚洲天堂av在线免费观看| 久久精品99久久香蕉国产色戒| 亚洲精品一二| 欧美专区在线观看| 亚洲一区二区三区四区在线观看| 欧美在线3区| 亚洲视频网在线直播| 老司机精品视频一区二区三区| 亚洲男女毛片无遮挡| 欧美成人一区二区在线| 久久精品亚洲乱码伦伦中文 | 亚洲欧美综合v| 毛片av中文字幕一区二区| 亚洲免费中文字幕| 欧美日本网站| 亚洲国产成人高清精品| 狠狠色伊人亚洲综合网站色| 亚洲视频图片小说| 中文无字幕一区二区三区| 久热re这里精品视频在线6| 欧美一区亚洲| 欧美日韩亚洲一区二区三区| 欧美成人自拍视频| 激情欧美日韩一区| 亚洲自拍偷拍一区| 亚洲一二三区精品| 欧美日韩不卡| 亚洲毛片av在线| 亚洲日韩第九十九页| 久久一综合视频| 久久综合五月天婷婷伊人| 国产精品综合视频| 亚洲一级片在线观看| 亚洲一区二区三| 欧美日韩在线不卡| 亚洲精品久久久久久一区二区| 影音先锋日韩有码| 久久尤物视频| 欧美国产成人在线| 亚洲国产欧美在线人成| 久久永久免费| 亚洲国产精品成人va在线观看| 亚洲欧洲精品一区二区三区不卡 | 久久琪琪电影院| 激情欧美丁香| 开元免费观看欧美电视剧网站| 久热这里只精品99re8久| 国产亚洲欧美一区二区| 久久精品72免费观看| 欧美刺激性大交免费视频| 亚洲免费播放| 国产精品久久久久久亚洲毛片| 亚洲一区二区三区在线观看视频| 午夜宅男欧美| 狠狠色狠色综合曰曰| 免费观看一级特黄欧美大片| 91久久国产综合久久91精品网站 | 卡一卡二国产精品| 亚洲二区免费| 欧美日韩国产色视频| 一区二区三区欧美激情| 久久激情视频免费观看| 亚洲国产精品一区| 欧美三级视频在线播放| 欧美一区国产二区| 亚洲国产影院| 久久不射电影网| 亚洲欧美精品一区| 这里只有精品视频| 国产麻豆精品久久一二三| 久久久久久久久久久一区| 亚洲区一区二区三区| 午夜精品福利一区二区三区av | 亚洲第一精品夜夜躁人人爽| 欧美黑人国产人伦爽爽爽| 亚洲男女毛片无遮挡| 亚洲国产91| 久久精品一本| 亚洲天堂网站在线观看视频| 国语自产精品视频在线看抢先版结局 | 精品二区视频| 欧美体内she精视频| 久久激情一区| 夜久久久久久| 欧美顶级艳妇交换群宴| 性色av一区二区三区在线观看| 91久久精品美女| 国产一区二区三区直播精品电影| 免费观看成人网| 欧美一区二区| 中文亚洲免费| 亚洲精品中文字幕女同| 欧美成人a视频| 久久―日本道色综合久久| 亚洲男女自偷自拍| 一级日韩一区在线观看| 最新日韩在线| 亚洲国产一区二区精品专区| 国产亚洲亚洲| 国产日产欧产精品推荐色| 国产精品扒开腿做爽爽爽软件|