青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

superman

聚精會神搞建設 一心一意謀發展
posts - 190, comments - 17, trackbacks - 0, articles - 0
   :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

 1 /* Accepted 1250 C++ 00:00.02 904K */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 struct { int cnt, cost[32]; } map[12][12];
 7 
 8 int main()
 9 {
10     int n, m, c = 1;
11     while(cin >> n >> m && n && m)
12     {
13         for(int i = 1; i <= n; i++)
14             for(int j = 1; j <= n; j++)
15                 if(i != j)
16                 {
17                     cin >> map[i][j].cnt;
18                     for(int k = 1; k <= map[i][j].cnt; k++)
19                         cin >> map[i][j].cost[k];
20                 }
21         
22         int opt[1001][12];
23         for(int i = 0; i <= m; i++)
24             for(int j = 0; j <= n; j++)
25                 opt[i][j] = INT_MAX;
26         opt[0][0= opt[0][1= 0;
27         
28         for(int i = 1; i <= m; i++)
29         for(int j = 1; j <= n; j++)
30         for(int k = 1; k <= n; k++)
31             if(j != k)
32             if(opt[i - 1][k] != INT_MAX)
33             {
34                 int p;
35                 if(i % map[k][j].cnt == 0)
36                     p = map[k][j].cnt;
37                 else
38                     p = i % map[k][j].cnt;
39                 if(map[k][j].cost[p] == 0)
40                     continue;
41                 opt[i][j] <?= opt[i - 1][k] + map[k][j].cost[p];
42             }
43             
44         cout << "Scenario #" << c++ << endl;
45         if(opt[m][n] != INT_MAX)
46             cout << "The best flight costs " << opt[m][n] << '.' << endl;
47         else
48             cout << "No flight possible." << endl;
49         cout << endl;
50     }
51     
52     return 0;
53 }
54 

posted @ 2008-06-01 10:24 superman 閱讀(239) | 評論 (0)編輯 收藏

Clod Sandbank With Lonely [Steve Chou]

After you've left me, my heart begins to rot.
The white tung tree is flying in the wind.
The fallen flowers follow the people to express their exquisite fellings in this season.
The wind around the river bank is blowing extremely wildly.
It continues to fiddle with women's tears.
That kind of strong love I can never give out again.
Sadness night after night.

When the lines of memory circling throught the fragmented past.
It's the dusk that occupies the heart.
There're flowers accompany the butterflies.
The lonely swallow can fly together.
In the still of the night I wander alone.
When the happy lovers send their redness to share their joy.
Closing eyes with sadness and not willing to back.
I still hate her gradually.
I'm not willing to rest even thought I fell a bit of regret.
Lonely sandbank, who should I think of?

posted @ 2008-05-31 11:04 superman 閱讀(273) | 評論 (0)編輯 收藏

 1 /* Accepted 476K 657MS G++ 1154B */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int farm; cin >> farm;
 9     
10     while(farm--)
11     {
12         int n, m, w;
13         cin >> n >> m >> w;
14         
15         int cnt = 0;
16         struct { int s, t, l; } e[5200];
17         
18         int s, t, l;
19         for(int i = 0; i < m; i++)
20         {
21             cin >> s >> t >> l; s--, t--;
22             e[cnt].s = s, e[cnt].t = t, e[cnt].l = l, cnt++;
23             e[cnt].s = t, e[cnt].t = s, e[cnt].l = l, cnt++;
24         }
25         for(int i = 0; i < w; i++)
26         {
27             cin >> s >> t >> l; s--, t--, l = -l;
28             e[cnt].s = s, e[cnt].t = t, e[cnt].l = l, cnt++;
29         }
30         
31         int d[500= { 0 };
32         
33         for(int k = 0; k < n - 1; k++)
34             for(int i = 0; i < cnt; i++)
35                 d[e[i].t] <?= d[e[i].s] + e[i].l;
36         
37         for(int i = 0; i < cnt; i++)
38             if(d[e[i].s] + e[i].l < d[e[i].t])
39             {
40                 cout << "YES"goto over;
41             }
42             
43         cout << "NO";
44         over:
45             cout << endl;
46     }
47     
48     return 0;
49 }
50 

posted @ 2008-05-28 18:00 superman 閱讀(782) | 評論 (0)編輯 收藏

 1 /* Accepted 1942 C++ 00:00.22 1160K */
 2 #include <math.h>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 int main()
 8 {
 9     cout.setf(ios_base::showpoint);
10     cout.setf(ios_base::fixed);
11     cout.precision(3);
12     
13     int n, cnt = 1;
14     while(cin >> n && n)
15     {
16         struct { int x, y; } p[200];
17         for(int i = 0; i < n; i++)
18             cin >> p[i].x >> p[i].y;
19         
20         double dist[200][200= { 0.0 };
21         
22         for(int i = 0; i < n; i++)
23         for(int j = 0; j < n; j++)
24             dist[i][j] = pow(p[i].x - p[j].x, 2.0+ pow(p[i].y - p[j].y, 2.0);
25         for(int k = 0; k < n; k++)
26         for(int i = 0; i < n; i++)
27         for(int j = 0; j < n; j++)
28             dist[i][j] <?= max(dist[i][k], dist[k][j]);
29         cout << "Scenario #" << cnt++ << endl;
30         cout << "Frog Distance = " << sqrt(dist[0][1]) << endl << endl;
31     }
32     
33     return 0;
34 }
35 

posted @ 2008-05-28 10:17 superman 閱讀(571) | 評論 (1)編輯 收藏

 1 /* Accepted 1708 C++ 00:00.00 836K */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n, m, start;
 9     while(cin >> n >> m >> start)
10     {
11         if(n == 0 && m == 0 && start == 0)
12             break;
13         
14         char map[10][10];
15         for(int i = 0; i < n; i++)
16             for(int j = 0; j < m; j++)
17                 cin >> map[i][j];
18         
19         int sx, sy;
20         for(int i = 0; i < n; i++)
21             for(int j = 0; j < m; j++)
22             {
23                 start--;
24                 if(start == 0)
25                 {
26                     sx = i, sy = j; break;
27                 }
28             }
29         
30         int cnt[10][10= { 0 };
31         cnt[sx][sy] = 1;
32         
33         while(true)
34         {
35             int tx = sx;
36             int ty = sy;
37             
38             switch(map[sx][sy])
39             {
40                 case 'N' : tx--break;
41                 case 'S' : tx++break;
42                 case 'W' : ty--break;
43                 case 'E' : ty++break;
44             }
45             if(tx < 0 || tx == n || ty < 0 || ty == m)
46             {
47                 cout << cnt[sx][sy] << " step(s) to exit" << endl;
48                 break;
49             }
50             if(cnt[tx][ty])
51             {
52                 cout << cnt[tx][ty] - 1 << " step(s) before a loop of "
53                      << cnt[sx][sy] - cnt[tx][ty] + 1  << " step(s)" << endl;
54                 break;
55             }
56             cnt[tx][ty] = cnt[sx][sy] + 1;
57             sx = tx, sy = ty;
58         }
59     }
60     
61     return 0;
62 }
63 

posted @ 2008-05-26 15:08 superman 閱讀(179) | 評論 (0)編輯 收藏

 1 /* Accepted 2803 C++ 00:00.02 880K */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int N;
 9     cin >> N;
10     while(N--)
11     {
12         int a, b, n, m;
13         
14         int px[101];
15         int py[101];
16         int dir[101];
17         
18         int map[101][101= { 0 };
19         
20         cin >> a >> b >> n >> m;
21         for(int i = 1; i <= n; i++)
22         {
23             char c;
24             cin >> px[i] >> py[i] >> c;
25             map[px[i]][py[i]] = i;
26             switch(c)
27             {
28                 case 'N' : dir[i] = 0break;
29                 case 'E' : dir[i] = 1break;
30                 case 'S' : dir[i] = 2break;
31                 case 'W' : dir[i] = 3break;
32             }
33         }
34         
35         bool ok = true;
36         for(int i = 0; i < m; i++)
37         {
38             int robot; char action; int repeat;
39             
40             cin >> robot >> action >> repeat;
41          
42             if(ok == false)
43                 continue;
44             
45             if(action == 'L' || action == 'R')
46             {
47                 repeat %= 4;
48                 if(action == 'L')
49                     dir[robot] = (dir[robot] - repeat + 4% 4;
50                 if(action == 'R')
51                     dir[robot] = (dir[robot] + repeat) % 4;
52                 continue;
53             }
54             //action == 'F'
55             while(repeat--)
56             {
57                 int x = px[robot];
58                 int y = py[robot];
59                 
60                 map[x][y] = 0;
61                 switch(dir[robot])
62                 {
63                     case 0 : y++break;
64                     case 1 : x++break;
65                     case 2 : y--break;
66                     case 3 : x--break;
67                 }
68                 if(map[x][y])
69                 {
70                     cout << "Robot " << robot
71                          << " crashes into robot " << map[x][y] << endl;
72                     break;
73                 }
74                 if(x == 0 || x == a + 1 || y == 0 || y == b + 1)
75                 {
76                     cout << "Robot " << robot << " crashes into the wall" << endl;
77                     break;
78                 }
79                 px[robot] = x;
80                 py[robot] = y;
81                 map[x][y] = robot;
82             }
83             if(repeat != -1)
84                 ok = false;
85         }
86         if(ok)
87             cout << "OK" << endl;
88     }
89     
90     return 0;
91 }
92 

posted @ 2008-05-26 10:41 superman 閱讀(269) | 評論 (0)編輯 收藏

 1 /* Accepted 1016 C++ 00:00.00 832K */
 2 #include <cstdio>
 3 #include <string>
 4 #include <iostream>
 5 
 6 using namespace std;
 7 
 8 int main()
 9 {
10     int n;
11     cin >> n;
12     while(cin >> n)
13     {
14         string seq;
15         
16         int p[100= {0};
17         for(int i = 1; i <= n; i++)
18         {
19             cin >> p[i];
20             for(int j = 1; j <= p[i] - p[i - 1]; j++)
21                 seq += '(';
22             seq += ')';
23         }
24         bool x[100= {0};
25         for(int i = 0; i < seq.size(); i++)
26             if(seq[i] == ')')
27             {
28                 int count = 0;
29                 for(int j = i - 1; j >= 0 ; j--)
30                     if(seq[j] == '(')
31                     {
32                         count++;
33                         if(x[j] == 0)
34                         {
35                             cout << count << (i == seq.size()- 1 ? '\n' : ' ');
36                             x[j] = 1;
37                             break;
38                         }
39                     }
40             }
41     }
42     
43     return 0;
44 }
45 

posted @ 2008-05-25 17:41 superman 閱讀(507) | 評論 (0)編輯 收藏

 1 /* Accepted 6888K 3141MS G++ 1416B */
 2 #include <math.h>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 int n, m;
 8 int A[50000];
 9 int MIN[50000][16];
10 int MAX[50000][16];
11 
12 void init()
13 {
14     for(int i = 0; i < n; i++)
15         MIN[i][0= MAX[i][0= A[i];
16     for(int j = 11 << j <= n; j++)
17         for(int i = 0; i + (1 << j) - 1 < n; i++)
18         {
19             if(MIN[i][j - 1< MIN[i + (1 << (j - 1))][j - 1])
20                 MIN[i][j] = MIN[i][j - 1];
21             else
22                 MIN[i][j] = MIN[i + (1 << (j - 1))][j - 1];
23             
24             if(MAX[i][j - 1> MAX[i + (1 << (j - 1))][j - 1])
25                 MAX[i][j] = MAX[i][j - 1];
26             else
27                 MAX[i][j] = MAX[i + (1 << (j - 1))][j - 1];
28         }
29 }
30 
31 int main()
32 {
33     scanf("%d %d"&n, &m);
34     for(int i = 0; i < n; i++)
35         scanf("%d"&A[i]);
36     
37     //ST algorithm
38     init();
39     
40     //deal with query
41     int s, t;
42     while(m--)
43     {
44         scanf("%d %d"&s, &t);
45         s--, t--;
46         
47         int a, b, k = int(log(t - s + 1/ log(2));
48         
49         if(MIN[s][k] < MIN[t - (1 << k) + 1][k])
50             a = MIN[s][k];
51         else
52             a = MIN[t - (1 << k) + 1][k];
53         
54         if(MAX[s][k] > MAX[t - (1 << k) + 1][k])
55             b = MAX[s][k];
56         else
57             b = MAX[t - (1 << k) + 1][k];
58         
59         cout << b - a << endl;
60     }
61     
62     return 0;
63 }
64 

posted @ 2008-05-25 16:07 superman 閱讀(352) | 評論 (0)編輯 收藏

 1 /* Accepted 708K 907MS G++ 1904B */
 2 #include <stack>
 3 #include <queue>
 4 #include <iostream>
 5 
 6 using namespace std;
 7 
 8 struct
 9 {
10     unsigned short LastState;
11     char op;
12 }state[65536];
13 
14 int main()
15 {
16     unsigned short InitState = 0;
17     for(int i = 0; i < 16; )
18         switch(getchar())
19         {
20             case '+' : InitState |= (1 << i); i++continue
21             case '-' : i++continue
22         }
23     
24     for(int i = 0; i < 65536; i++)
25         state[i].op = -1;
26     state[InitState].op = -2;
27     
28     queue <unsigned short> q;
29     q.push(InitState);
30     
31     while(q.empty() == false)
32     {
33         unsigned short CurState = q.front(); q.pop();
34         
35         if(state[0].op != -1)
36             break;
37         
38         for(int i = 0; i < 16; i++)
39         {
40             unsigned short tmp = CurState;
41             tmp = tmp ^ (1 << i);
42             
43             int p;
44             
45             p = i - 4;
46             while(p >= 0) { tmp = tmp ^ (1 << p); p -= 4; }
47             
48             p = i + 4;
49             while(p < 16) { tmp = tmp ^ (1 << p); p += 4; }
50             
51             p = i / 4 * 4;
52             while(p < i) { tmp = tmp ^ (1 << p); p++; }
53             
54             p = (i / 4 + 1* 4 - 1;
55             while(p > i) { tmp = tmp ^ (1 << p); p--; }
56             
57             if(state[tmp].op == -1)
58             {
59                 state[tmp].LastState = CurState;
60                 state[tmp].op = i;
61                 q.push(tmp);
62             }
63         }
64     }
65     
66     int p = 0;
67     stack <int> path;
68     while(state[p].op != -2)
69     {
70         path.push(state[p].op);
71         p = state[p].LastState;
72     }
73     
74     cout << path.size() << endl;
75     while(path.empty() == false)
76     {
77         int x = path.top() / 4 + 1;
78         int y = path.top() % 4 + 1;
79         cout << x << ' ' << y << endl;
80         path.pop();
81     }
82     
83     return 0;
84 }
85 

posted @ 2008-05-25 11:05 superman 閱讀(458) | 評論 (0)編輯 收藏

 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, falsesizeof(x));
34         
35         search(21);
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 

posted @ 2008-05-21 11:08 superman 閱讀(406) | 評論 (0)編輯 收藏

僅列出標題
共19頁: First 5 6 7 8 9 10 11 12 13 Last 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            免费不卡视频| 国产综合精品一区| 欧美日韩一区二区在线| 国产九色精品成人porny| 伊人激情综合| 亚洲欧美偷拍卡通变态| 亚洲国产精品久久久久秋霞蜜臀| 亚洲黄色在线| 欧美专区日韩专区| 99精品视频免费全部在线| 久久人人97超碰国产公开结果| 国产精品成人v| 亚洲精品一二区| 免费看亚洲片| 欧美另类视频| 亚洲免费高清| 亚洲第一黄网| 久久精品国产亚洲精品| 欧美日本韩国| 翔田千里一区二区| 亚洲视频在线视频| 欧美日韩国产区一| 亚洲精品小视频| 亚洲女人天堂av| 国产模特精品视频久久久久| 久久亚洲精品欧美| 久久精品视频免费| 野花国产精品入口| 亚洲精品色婷婷福利天堂| 美女诱惑一区| 亚洲激情成人在线| 在线视频你懂得一区二区三区| 欧美女激情福利| 先锋影音久久久| 欧美a一区二区| 一本久道久久久| 久久精品国产99国产精品澳门| 日韩一区二区精品视频| 亚洲精品久久久久久下一站| 欧美福利影院| 中国日韩欧美久久久久久久久| 亚洲精品国偷自产在线99热| 国产精品综合av一区二区国产馆| 亚洲国产精品一区二区www在线| 国产精品嫩草久久久久| 久久九九精品99国产精品| 久久精品久久99精品久久| 亚洲视频一区二区| 欧美/亚洲一区| 久久伊人一区二区| 国产婷婷97碰碰久久人人蜜臀| 久久精品国产免费看久久精品| 久久久亚洲一区| 亚洲日本在线视频观看| 久久国产精品久久精品国产 | 久热精品在线视频| 91久久久一线二线三线品牌| 亚洲日本欧美日韩高观看| 一区二区自拍| 一区二区三区产品免费精品久久75| 国产伦精品一区二区| 夜夜嗨av色综合久久久综合网 | 欧美日韩hd| 亚洲人成7777| 亚洲精品欧美在线| 欧美jizzhd精品欧美喷水| 欧美阿v一级看视频| 欧美三级乱码| 欧美jjzz| 亚洲级视频在线观看免费1级| 麻豆成人在线观看| 亚洲春色另类小说| 国产欧美精品在线| 亚洲国产精品美女| 日韩一本二本av| 欧美人成免费网站| 亚洲小说区图片区| 久久精品99国产精品酒店日本| 国产亚洲精品福利| 夜夜嗨av一区二区三区网页| 亚洲视频 欧洲视频| 国产精品日韩欧美大师| 亚洲黄色尤物视频| 在线观看成人av电影| 久久综合色一综合色88| 欧美激情亚洲另类| 在线播放国产一区中文字幕剧情欧美| 欧美在线在线| 欧美一区影院| 欧美四级伦理在线| 香蕉成人伊视频在线观看| 亚洲一区二区三区精品在线| 农村妇女精品| 99香蕉国产精品偷在线观看| 欧美一级成年大片在线观看| 在线播放国产一区中文字幕剧情欧美 | 欧美成人一二三| 国产偷国产偷精品高清尤物| 久久精品亚洲| 日韩视频一区二区三区在线播放免费观看 | 一区二区三区日韩精品| 免费av成人在线| 一区二区三区|亚洲午夜| 久久久噜噜噜久久人人看| 国产热re99久久6国产精品| 久久久夜精品| 亚洲一区二区三区乱码aⅴ蜜桃女 亚洲一区二区三区乱码aⅴ | 欧美一区二区三区男人的天堂| 亚洲欧美日韩综合| 欧美日韩亚洲激情| 久久成人人人人精品欧| 亚洲精美视频| 久久久久国产一区二区三区四区| 亚洲毛片网站| 狠狠狠色丁香婷婷综合久久五月 | 欧美一级理论性理论a| 亚洲国产精品女人久久久| 久久国产精品99精品国产| 这里只有视频精品| 亚洲国产精品va在线观看黑人 | 亚洲免费视频成人| 亚洲国产精品久久91精品| 久久久国产精彩视频美女艺术照福利| 日韩天堂av| 亚洲人成人99网站| 黄色精品免费| 国产综合自拍| 国产欧美一区二区三区久久| 欧美日韩国产一级片| 欧美福利电影网| 久久久在线视频| 久久久精品免费视频| 欧美亚洲日本国产| 亚洲欧美一区二区三区久久| 久久这里有精品视频| 久久黄色网页| 久久国产88| 欧美在线观看视频| 香蕉国产精品偷在线观看不卡| 国产精品99久久99久久久二8| 亚洲精品一区在线观看| 亚洲国产精品一区二区第一页| 在线免费日韩片| 欧美午夜三级| 免费日韩精品中文字幕视频在线| 久久激情综合网| 性欧美video另类hd性玩具| 亚洲制服av| 久久精品亚洲一区| 久久久久一区二区三区| 久色成人在线| 欧美日韩国产一级片| 国产精品久久久久7777婷婷| 国产伦精品免费视频| 黄色一区二区三区| 亚洲高清在线| 亚洲视频在线视频| 欧美资源在线观看| 久久综合九色99| 亚洲高清精品中出| 99re66热这里只有精品4| 一区二区三区久久精品| 亚洲欧美日韩精品| 久久色在线播放| 欧美精品首页| 欧美精品啪啪| 国产乱码精品一区二区三区av| 国产一区二区三区在线观看免费| 一区二区三区在线高清| 亚洲精品久久| 香蕉尹人综合在线观看| 欧美成人国产| 一本色道久久综合亚洲精品小说| 午夜精品视频在线观看| 久久综合九色综合网站| 欧美系列一区| 亚洲欧洲综合另类| 亚洲欧美影院| 亚洲福利在线看| 欧美亚洲日本国产| 欧美精品日韩三级| 一区在线视频| 亚洲欧美日韩一区在线观看| 免费试看一区| 亚洲中午字幕| 欧美日韩精品综合| 亚洲大黄网站| 欧美在线一级视频| 日韩视频不卡中文| 久久尤物视频| 国产日韩一区二区三区在线播放 | 国产日本欧美一区二区三区在线 | 999在线观看精品免费不卡网站| 欧美一级日韩一级| 亚洲美女啪啪| 欧美mv日韩mv国产网站app| 国产一区二区三区久久久| 亚洲性感激情| 日韩视频在线一区二区| 免费看成人av|