锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久AV无码精品人妻糸列,九九99精品久久久久久,久久青青草视频http://www.shnenglu.com/superman/category/7098.html鑱氱簿浼?xì)绁炴悶寰忚?涓蹇冧竴鎰忚皨鍙戝睍zh-cnWed, 28 May 2008 13:19:25 GMTWed, 28 May 2008 13:19:25 GMT60POJ 3259 - Wormholeshttp://www.shnenglu.com/superman/archive/2008/05/28/51420.htmlsupermansupermanWed, 28 May 2008 10:00:00 GMThttp://www.shnenglu.com/superman/archive/2008/05/28/51420.htmlhttp://www.shnenglu.com/superman/comments/51420.htmlhttp://www.shnenglu.com/superman/archive/2008/05/28/51420.html#Feedback0http://www.shnenglu.com/superman/comments/commentRss/51420.htmlhttp://www.shnenglu.com/superman/services/trackbacks/51420.html 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 

superman 2008-05-28 18:00 鍙戣〃璇勮
]]>
POJ 3264 - Balanced Lineuphttp://www.shnenglu.com/superman/archive/2008/05/25/51057.htmlsupermansupermanSun, 25 May 2008 08:07:00 GMThttp://www.shnenglu.com/superman/archive/2008/05/25/51057.htmlhttp://www.shnenglu.com/superman/comments/51057.htmlhttp://www.shnenglu.com/superman/archive/2008/05/25/51057.html#Feedback0http://www.shnenglu.com/superman/comments/commentRss/51057.htmlhttp://www.shnenglu.com/superman/services/trackbacks/51057.html 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 

superman 2008-05-25 16:07 鍙戣〃璇勮
]]>
POJ 2965 - The Pilots Brothers' refrigeratorhttp://www.shnenglu.com/superman/archive/2008/05/25/51014.htmlsupermansupermanSun, 25 May 2008 03:05:00 GMThttp://www.shnenglu.com/superman/archive/2008/05/25/51014.htmlhttp://www.shnenglu.com/superman/comments/51014.htmlhttp://www.shnenglu.com/superman/archive/2008/05/25/51014.html#Feedback0http://www.shnenglu.com/superman/comments/commentRss/51014.htmlhttp://www.shnenglu.com/superman/services/trackbacks/51014.html 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 

superman 2008-05-25 11:05 鍙戣〃璇勮
]]>
POJ 3273 - Monthly Expensehttp://www.shnenglu.com/superman/archive/2008/05/20/50497.htmlsupermansupermanTue, 20 May 2008 01:58:00 GMThttp://www.shnenglu.com/superman/archive/2008/05/20/50497.htmlhttp://www.shnenglu.com/superman/comments/50497.htmlhttp://www.shnenglu.com/superman/archive/2008/05/20/50497.html#Feedback0http://www.shnenglu.com/superman/comments/commentRss/50497.htmlhttp://www.shnenglu.com/superman/services/trackbacks/50497.html 1 /* Accepted 816K 829MS G++ 899B */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n, m, x[100000];
 9     
10     cin >> n >> m;
11     for(int i = 0; i < n; i++)
12         cin >> x[i];
13     
14     int sum = 0;
15     for(int i = 0; i < n; i++)
16         sum += x[i];
17     
18     int l = 0, r = sum;
19     while(l + 1 < r)
20     {
21         int mid = (l + r) / 2;
22         
23         int i, cnt = 0, left = mid;
24         
25         for(i = 0; i < n && cnt < m; i++)
26         {
27             if(x[i] > mid)
28                 break;
29             if(left - x[i] >= 0)
30                 left -= x[i];
31             else
32             {
33                 cnt++;
34                 left = mid - x[i];
35             }
36         }
37         
38         if(i == n)
39             r = mid;
40         else
41             l = mid;
42     }
43     
44     cout << r << endl;
45     
46     return 0;
47 }
48 

superman 2008-05-20 09:58 鍙戣〃璇勮
]]>
91精品国产91热久久久久福利 | 亚洲熟妇无码另类久久久| 一本一道久久a久久精品综合 | 欧洲性大片xxxxx久久久| 国产精品99久久久精品无码| 午夜天堂av天堂久久久| 久久久久国产精品| 久久久无码精品亚洲日韩京东传媒| 久久青青草原亚洲av无码app | 久久国产精品无码一区二区三区| 亚洲一区二区三区日本久久九| 亚洲中文字幕伊人久久无码 | 国产精品99久久久精品无码 | 精品国产乱码久久久久久浪潮| 久久频这里精品99香蕉久| 国产欧美久久一区二区| 久久无码AV一区二区三区| 久久国产乱子伦精品免费强| 热99RE久久精品这里都是精品免费| 97久久超碰国产精品旧版| 久久99久久99精品免视看动漫| 品成人欧美大片久久国产欧美...| 成人久久免费网站| 久久久99精品一区二区| 狠狠色丁香婷婷久久综合不卡| 伊人久久无码中文字幕| 麻豆久久久9性大片| 久久一区二区免费播放| 国产精品VIDEOSSEX久久发布| 亚洲国产精品无码久久| 久久久久高潮综合影院| 一极黄色视频久久网站| 久久五月精品中文字幕| 久久久亚洲精品蜜桃臀| 欧美精品丝袜久久久中文字幕 | 久久婷婷国产麻豆91天堂| 婷婷五月深深久久精品| 久久亚洲精品成人无码网站| 亚洲国产成人久久综合一区77| 久久99精品久久久久久噜噜| 99久久精品国产毛片|