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

隨筆 - 87  文章 - 279  trackbacks - 0
<2025年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

潛心看書研究!

常用鏈接

留言簿(19)

隨筆分類(81)

文章分類(89)

相冊

ACM OJ

My friends

搜索

  •  

積分與排名

  • 積分 - 220445
  • 排名 - 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 閱讀(534) 評論(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>
            欧美午夜视频网站| 国产精品区免费视频| 在线不卡欧美| 久久精品一区二区| 久久精品国产精品亚洲综合| 国产日韩欧美黄色| 噜噜噜在线观看免费视频日韩| 性做久久久久久久免费看| 国产精品日日摸夜夜摸av| 久久国内精品自在自线400部| 小辣椒精品导航| 在线观看精品一区| 亚洲激情综合| 欧美日韩精品一本二本三本| 亚洲一区二区三区高清不卡| 欧美一级淫片播放口| 在线观看欧美日韩国产| 亚洲国产精品小视频| 国产精品久久久999| 久久人人爽人人| 欧美黄免费看| 欧美一区二区三区在线视频| 久久国产精品99精品国产| 亚洲国产精品小视频| 日韩一区二区精品在线观看| 国产亚洲精品aa| 亚洲国产欧美一区| 国产女主播视频一区二区| 免费欧美在线| 国产精品极品美女粉嫩高清在线 | 国产精品白丝av嫩草影院| 欧美伊人久久| 欧美国产在线观看| 午夜精品999| 欧美va亚洲va日韩∨a综合色| 亚洲自拍偷拍视频| 久久亚洲不卡| 久久国产日韩欧美| 欧美日韩a区| 噜噜噜在线观看免费视频日韩| 欧美日韩亚洲综合| 欧美成人一区二区三区在线观看| 欧美日韩一区在线播放| 欧美v国产在线一区二区三区| 亚洲综合色视频| 欧美成人精品不卡视频在线观看| 久久国产精品久久久久久久久久| 欧美精品久久久久久久久老牛影院| 久久黄金**| 欧美日韩调教| 亚洲精品一区中文| 亚洲欧洲精品一区二区三区波多野1战4| 亚洲一区二区成人| 一区二区三区四区国产| 欧美高清在线| 亚洲国产免费| 亚洲国产综合在线看不卡| 欧美一区二区三区在线免费观看| 亚洲一二三区在线观看| 欧美激情精品| 91久久在线观看| 亚洲激情在线激情| 久久一区视频| 欧美大片免费看| 亚洲成人原创| 美女福利精品视频| 欧美二区在线| 91久久精品国产91久久| 免费观看欧美在线视频的网站| 久久嫩草精品久久久精品一| 久久精品天堂| 国产在线视频欧美| 久久精品主播| 亚洲国产高清在线观看视频| 亚洲国产免费| 欧美精品在线观看播放| 99热这里只有精品8| 在线一区视频| 国产精品免费看片| 欧美一区二区免费| 久久影院亚洲| 亚洲看片一区| 欧美午夜免费| 欧美亚洲一区二区在线| 你懂的国产精品永久在线| 亚洲精品国精品久久99热| 欧美大片专区| 亚洲午夜在线观看视频在线| 久久精品99国产精品酒店日本| 国内精品久久久| 免费亚洲电影在线| 一区二区国产精品| 久久夜色精品国产噜噜av| 亚洲国产综合91精品麻豆| 欧美日本韩国在线| 欧美一区二区三区啪啪| 亚洲第一网站| 西西人体一区二区| 亚洲高清在线播放| 国产精品久久久久久久久久久久久久| 亚洲综合大片69999| 欧美大片免费观看在线观看网站推荐| 日韩一级片网址| 国内精品福利| 久久综合给合| 9久草视频在线视频精品| 国产欧美精品一区| 嫩草成人www欧美| 亚洲一区尤物| 亚洲国产欧美在线| 久久久999| 亚洲夜晚福利在线观看| **网站欧美大片在线观看| 欧美吻胸吃奶大尺度电影| 久久成人国产精品| 一本久道久久综合婷婷鲸鱼| 久久欧美中文字幕| 亚洲性图久久| 亚洲日韩欧美视频一区| 国模吧视频一区| 国产精品成人一区二区网站软件 | 久久久99久久精品女同性| 亚洲国产欧美一区二区三区久久| 午夜视频一区二区| 在线亚洲一区观看| 午夜精品成人在线| 欧美激情91| 美女黄网久久| 久久aⅴ乱码一区二区三区| 亚洲天堂av在线免费| 亚洲狠狠丁香婷婷综合久久久| 国产精品老女人精品视频| 欧美精品www| 久久在线免费观看| 欧美专区在线| 欧美一区二区女人| 亚洲一二区在线| 日韩视频在线免费| 日韩午夜激情av| 洋洋av久久久久久久一区| 亚洲高清在线观看| 亚洲国产高清一区| 亚洲国产欧美一区二区三区同亚洲 | 国产伦精品一区二区三区视频黑人| 欧美激情成人在线| 欧美精品 日韩| 欧美岛国激情| 欧美日韩精品免费观看视一区二区| 欧美国内亚洲| 欧美日韩99| 国产精品videossex久久发布| 国产精品av久久久久久麻豆网| 欧美精品国产| 欧美午夜一区二区福利视频| 欧美日韩国产精品专区| 欧美视频手机在线| 国产精品中文在线| 国产亚洲毛片在线| 在线播放日韩| 99视频+国产日韩欧美| 在线一区二区三区四区| 亚洲影视九九影院在线观看| 欧美一区二区高清在线观看| 久久精品国产欧美激情| 另类春色校园亚洲| 你懂的国产精品| 亚洲精品视频在线观看免费| 这里只有视频精品| 欧美一级久久久| 欧美sm视频| 国产精品r级在线| 国产一区三区三区| 午夜精品剧场| 久久亚洲影音av资源网| 欧美精品成人一区二区在线观看| 欧美日韩一二三区| 国语自产精品视频在线看一大j8 | 欧美一区二区久久久| 久久久久久穴| 亚洲精品日韩欧美| 欧美一级在线播放| 欧美人成网站| 国内外成人免费视频| 亚洲精品四区| 久久免费国产精品| 日韩西西人体444www| 欧美在线1区| 欧美午夜www高清视频| 亚洲二区在线| 午夜在线视频一区二区区别| 欧美aaaaaaaa牛牛影院| 亚洲午夜av| 欧美精品一卡二卡| 黄色av成人| 香蕉久久久久久久av网站| 亚洲国产欧美不卡在线观看| 性欧美长视频| 国产精品久久久久久久免费软件 | 欧美韩日一区二区| 亚洲欧美激情视频|