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

隨筆 - 87  文章 - 279  trackbacks - 0
<2025年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

潛心看書研究!

常用鏈接

留言簿(19)

隨筆分類(81)

文章分類(89)

相冊

ACM OJ

My friends

搜索

  •  

積分與排名

  • 積分 - 219404
  • 排名 - 118

最新評論

閱讀排行榜

評論排行榜

Giftbox
Time Limit:4000MS? Memory Limit:131072K
Total Submit:1210 Accepted:218

Description

Bobobo and Bottle are good friends, and the birthday of Bottle is coming. So Bobobo is considering preparing Bottle an unexpected gift for his birthday. As a common sense that when a person at his or her birthday party, he or she will open the gift with the presence of the person who gives the gift and then expresses the appreciation. Bobobo knows that the characteristic of Bottle is rush when he receives something important, so he wants to play a joke on him in this way…

Bobobo comes into a gift shop, and there are a lot of different kinds of gift boxes. Bobobo intends to choose various boxes with different size and choose one of the gift boxes to contain the precious gift and place this box into another bigger box and place this bigger box into another bigger one… So Bottle will not see the gift until he opens the innermost box. Imagine the process of his opening the boxes, how rush Bottle will be ^_^ !

The gift boxes are n-dimensional. An n-dimensional box with dimensions ( X1, X2, …, Xn ) can be put into another box with dimensions ( Y1, Y2, …, Yn ) if there exists a permutation π on { 1, 2, …, n } such that Xπ1 < Y1, Xπ2 < Y2, …, Xπn < Yn. The gift is also n-dimensional and it can be put into a box if it satisfies the criterion above. And Bobobo must try his best to choose as many as boxes to contain the gift.

Input

The input file contains multiple test cases. The first line of each test case contains two numbers. The first one is a positive integer number N (1 ≤ N ≤ 500), the number of boxes in the gift shop, and the second one is a positive number d (3 ≤ d ≤ 1 000), the dimension of all the boxes. The next one line contains d positive integers ( G1, G2, …, Gd ) representing the dimensions of the gift. And the subsequent N lines each contain d positive integers ( X1, X2, …, Xd ) representing the dimensions of each box. You may assume that all the numbers you encounter are positive integers and less than 231. The input data is terminated by EOF.

Output

The output of each test case will contain only one line. Output the maximum number of the boxes that Bobobo can choose. If Bobobo can not find any box which can contain the gift, output “Please look for another gift shop!”

Sample Input

5 7
4 6 8 2 7 5 3
2 8 13 6 10 9 4
80 70 12 3 6 8 2
8 7 4 6 9 10 12
100 200 300 400 500 600 700
800 800 800 800 800 800 800

Sample Output

3

Source
POJ Monthly--2006.09.29, sza

?

#include? < iostream >
#include?
< algorithm >
using ? namespace ?std;

const ? int ?MAXN? = ? 510 ;
const ? int ?MAXM? = ? 1010 ;

int ?n,?m;
int ?data[MAXN][MAXM];
int ?map[MAXN][MAXN];
int ?i,?j,?k;
int ?f[MAXN];
int ?d[MAXN];
int ?ans;

int ?DP( int ?b)
{
????
if ?(d[b]? > ? 0 )? return ?d[b];
????
int ?i;
????
int ?t? = ? 0 ;
????
for ?(i = 1 ;?i <= n;?i ++ )
????
{
????????
if ?(f[i]? && ?b? != ?i? && ?map[b][i]? && ?t? < ?DP(i)? + ? 1 )?t? = ?DP(i)? + ? 1 ;
????}

????d[b]?
= ?t;
????
return ?d[b];
}


int ?main()
{???
????
while ?(scanf( " %d%d " ,? & n,? & m)? != ?EOF)
????
{
????????
for ?(i = 0 ;?i <= n;?i ++ )
????????
{
????????????
for ?(j = 0 ;?j < m;?j ++ )
????????????????scanf(
" %d " ,? & data[i][j]);
????????????sort(data[i],?data[i]
+ m);
????????}

????????
????????memset(f,?
1 ,? sizeof (f));
????????
????????
for ?(i = 1 ;?i <= n;?i ++ )
????????????
for ?(j = 0 ;?j < m;?j ++ )
????????????????
if ?(data[i][j]? <= ?data[ 0 ][j])
????????????????
{
????????????????????f[i]?
= ? 0 ;
????????????????????
break ;
????????????????}

????????????????
????????
for ?(i = 0 ;?i <= n;?i ++ )
????????????
for ?(j = 1 ;?j <= n;?j ++ )
????????????
{
????????????????map[i][j]?
= ? 1 ;
????????????????
for ?(k = 0 ;?k < m;?k ++ )
????????????????
{
????????????????????
if ?(data[i][k]? >= ?data[j][k])
????????????????????
{
????????????????????????map[i][j]?
= ? 0 ;
????????????????????????
break ;
????????????????????}

????????????????}

????????????}

????????????
????????memset(d,?
0 ,? sizeof (d));

????????ans?
= ?DP( 0 );

????????
if ?(ans? == ? 0 )
????????????printf(
" Please?look?for?another?gift?shop!\n " );
????????
else
????????????printf(
" %d\n " ,?ans);
???????????????????????
????}

????system(
" pause " );
????
return ? 0 ;
}

posted on 2006-09-30 01:46 閱讀(529) 評論(0)  編輯 收藏 引用 所屬分類: ACM題目
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            狂野欧美性猛交xxxx巴西| 久久国产精品久久国产精品| 亚洲精品影院| 久久精品夜夜夜夜久久| 欧美网站在线观看| 亚洲精品四区| 欧美黄色一区二区| 久久久国产精品一区二区三区| 欧美日韩国产成人在线免费 | 美女网站久久| 国外成人在线视频网站| 午夜精品久久| 一区二区三区欧美在线| 欧美日韩不卡在线| 一区二区不卡在线视频 午夜欧美不卡'| 久久亚洲欧美国产精品乐播| 欧美在线亚洲综合一区| 国产乱子伦一区二区三区国色天香| 亚洲在线播放| 亚洲一区二区精品在线观看| 国产精品h在线观看| 亚洲一区二区三区激情| 一本色道久久综合亚洲91| 欧美手机在线| 亚洲无线视频| 亚洲免费人成在线视频观看| 国产精品女同互慰在线看| 欧美一区二区三区电影在线观看| 午夜欧美电影在线观看| 国产在线精品一区二区夜色| 麻豆国产va免费精品高清在线| 久久久久99精品国产片| 亚洲激情另类| 亚洲国产高清高潮精品美女| 欧美成人性网| 亚洲淫片在线视频| 久久免费视频在线| 宅男精品视频| 欧美亚洲免费电影| 亚洲国产导航| 中文无字幕一区二区三区| 国产欧美日韩亚洲精品| 久久综合国产精品| 欧美日韩性生活视频| 久久精品国产一区二区三| 久久免费视频这里只有精品| 一本色道久久综合亚洲精品小说| 亚洲色图在线视频| 在线看片一区| 在线视频免费在线观看一区二区| 亚洲影视在线播放| 久久精品日韩一区二区三区| 在线观看一区| 亚洲欧洲日韩综合二区| 欧美午夜美女看片| 久久嫩草精品久久久精品| 欧美日韩三区| 久久久九九九九| 六月婷婷一区| 久久99在线观看| 欧美日韩国产999| 久久影院午夜论| 欧美午夜精品理论片a级大开眼界| 久久精品人人做人人爽电影蜜月| 欧美黄在线观看| 久久字幕精品一区| 国产精品国产三级国产专区53 | 欧美精品电影| 久久精品国产v日韩v亚洲| 欧美激情亚洲| 久久中文在线| 国产精品影音先锋| 99视频热这里只有精品免费| 亚洲电影激情视频网站| 亚洲尤物在线| 亚洲视频一区二区在线观看| 欧美成人亚洲| 亚洲成色777777在线观看影院| 国产欧美一区视频| 亚洲午夜影视影院在线观看| 99国产精品视频免费观看一公开| 久久精品首页| 久久伊人免费视频| 国产亚洲午夜| 欧美亚洲三区| 久久精品二区| 国产一区二区三区四区在线观看 | 亚洲精品麻豆| 久久婷婷av| 蜜桃久久精品乱码一区二区| 国产亚洲人成网站在线观看| 中文国产一区| 亚洲欧美成人| 国产精品国产三级国产aⅴ9色| 欧美激情久久久久久| 今天的高清视频免费播放成人| 亚洲一区在线免费| 久久国产精品久久w女人spa| 国产欧美日韩精品专区| 亚洲自拍高清| 欧美影院精品一区| 国产欧美日韩一区| 欧美专区一区二区三区| 久久午夜精品| 亚洲欧洲综合另类| 欧美男人的天堂| 一本大道久久a久久综合婷婷| 一区二区三区久久久| 亚洲另类在线一区| 亚洲一区成人| 国产午夜一区二区三区| 欧美在线观看你懂的| 久久精品72免费观看| 极品日韩av| 欧美日韩精品一本二本三本| 这里只有精品视频| 欧美一区二区三区免费观看视频| 国产女人aaa级久久久级| 久久精品免费| 91久久国产综合久久| 亚洲欧美在线播放| 亚洲观看高清完整版在线观看| 欧美成人网在线| 亚洲视频免费| 久久中文字幕导航| 亚洲桃色在线一区| 在线欧美电影| 国产精品大全| 久久人人爽爽爽人久久久| 亚洲美女色禁图| 久久久.com| 日韩视频免费观看| 国产最新精品精品你懂的| 欧美电影在线播放| 亚洲欧美成人在线| 91久久精品一区二区三区| 国产精品99久久不卡二区| 黄色成人av| 欧美日韩精品三区| 久久综合色播五月| 亚洲免费视频网站| 亚洲欧洲在线视频| 欧美一区二区三区在线看| 亚洲精品三级| 国产亚洲精品久久久久婷婷瑜伽| 欧美激情综合色| 久久精品欧美日韩| 亚洲一区二区四区| 日韩视频亚洲视频| 欧美福利视频在线| 久久久久久9999| 午夜精品国产更新| 一区二区三区精品视频| 韩国美女久久| 国产精品影音先锋| 欧美日韩在线免费视频| 欧美成人免费一级人片100| 午夜精品一区二区三区在线| 亚洲精品日韩在线观看| 蜜臀久久99精品久久久久久9| 亚洲欧美视频一区二区三区| 一区二区电影免费观看| 亚洲狠狠婷婷| 一色屋精品视频在线看| 黑丝一区二区| 国产欧美一级| 国产精品视频不卡| 欧美视频免费看| 欧美日韩免费高清| 欧美精品在线免费| 欧美风情在线| 欧美精品v日韩精品v国产精品| 免费在线日韩av| 美女国产精品| 久久伊人免费视频| 欧美高清视频免费观看| 欧美波霸影院| 欧美粗暴jizz性欧美20| 免费国产一区二区| 免费视频亚洲| 欧美精品在线观看一区二区| 欧美精品在线观看播放| 欧美日韩中国免费专区在线看| 欧美调教vk| 国产日韩专区| 在线观看日韩www视频免费| 欧美成人官网二区| 欧美精品在线视频观看| 欧美成人第一页| 欧美欧美天天天天操| 欧美日韩一区二区国产| 欧美色图首页| 国产精品国产三级国产aⅴ入口 | 免费观看日韩| 欧美电影美腿模特1979在线看| 欧美电影打屁股sp| 亚洲精品五月天| 亚洲视频在线观看视频| 午夜精品久久久久久久久| 久久一二三国产|