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

隨筆 - 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>
            亚洲人体影院| 一本综合久久| 久久精品2019中文字幕| 国产一区二区高清视频| 久久久www成人免费无遮挡大片| 亚洲四色影视在线观看| 国产欧美在线看| 久久久综合视频| 久久综合久久久久88| 亚洲开发第一视频在线播放| 日韩视频一区| 国产精品自拍在线| 久久婷婷麻豆| 欧美国产激情| 欧美一区亚洲一区| 久久五月激情| 一区二区免费在线观看| 亚洲综合日韩| 亚洲国产精品一区制服丝袜| 最新成人在线| 国产亚洲毛片| 亚洲高清av| 欧美三日本三级三级在线播放| 久久精品国产99| 欧美国产专区| 欧美制服丝袜| 欧美伦理一区二区| 久久久久久久激情视频| 欧美激情成人在线| 欧美在线播放视频| 欧美精品午夜| 久久婷婷色综合| 国产精品va在线播放| 久久夜色精品国产欧美乱| 欧美女同在线视频| 久久久久这里只有精品| 欧美日韩高清在线观看| 久久精品国产第一区二区三区最新章节 | 国产精品揄拍一区二区| 你懂的国产精品永久在线| 欧美日韩一区在线视频| 免费观看成人www动漫视频| 欧美色道久久88综合亚洲精品| 久久综合图片| 国产日韩欧美精品一区| 亚洲美女免费视频| 亚洲国产精品一区二区三区| 欧美伊人影院| 午夜精品免费视频| 欧美日韩国产精品| 欧美成人一二三| 国产一区在线看| 亚洲欧美日韩精品久久亚洲区 | 久久久水蜜桃av免费网站| 欧美日韩高清在线| 亚洲国产成人精品女人久久久| 国产伊人精品| 亚洲女性裸体视频| 亚洲女人av| 国产精品久久久久久久一区探花| 亚洲高清视频一区| 91久久久久久国产精品| 久久综合导航| 欧美成人免费在线| 亚洲国产精品久久精品怡红院| 欧美在线视频免费| 久久久www免费人成黑人精品 | 欧美激情一二区| 欧美成人首页| 亚洲韩国一区二区三区| 麻豆九一精品爱看视频在线观看免费| 久久精品午夜| 国内一区二区三区在线视频| 欧美一级欧美一级在线播放| 久久精品男女| 韩国一区电影| 毛片精品免费在线观看| 亚洲国产精品999| 99在线|亚洲一区二区| 欧美日韩国产三区| 亚洲网站在线播放| 久久精品99国产精品酒店日本| 国产一区二区三区成人欧美日韩在线观看| 亚洲女同精品视频| 久久深夜福利免费观看| 亚洲国产高清在线| 欧美精品福利视频| 亚洲综合欧美日韩| 免费亚洲电影在线观看| 亚洲日韩第九十九页| 欧美亚州一区二区三区 | 亚洲性夜色噜噜噜7777| 欧美亚洲视频一区二区| 极品中文字幕一区| 欧美激情亚洲国产| 亚洲午夜激情免费视频| 久热精品视频在线观看| 亚洲精品一区二区网址| 欧美日韩在线综合| 欧美一区二区高清| 亚洲人成毛片在线播放女女| 午夜精品剧场| 亚洲国产片色| 国产精品一区二区三区四区五区| 久久久青草婷婷精品综合日韩 | 国产视频自拍一区| 男女精品视频| 亚洲免费视频中文字幕| 免费亚洲网站| 亚洲欧美日韩爽爽影院| 亚洲国产99精品国自产| 欧美午夜免费电影| 久色成人在线| 午夜久久久久久| 91久久久精品| 久久婷婷国产麻豆91天堂| 亚洲天堂久久| 91久久国产综合久久蜜月精品| 国产伦一区二区三区色一情| 欧美激情一区二区三区不卡| 欧美一区三区二区在线观看| 99国产成+人+综合+亚洲欧美| 麻豆免费精品视频| 久久国产乱子精品免费女| 一本一本大道香蕉久在线精品| 激情综合色综合久久综合| 国产精品久久婷婷六月丁香| 欧美激情视频一区二区三区在线播放 | 在线综合欧美| 亚洲激情影视| 在线观看国产日韩| 国产日韩欧美中文| 国产精品美女www爽爽爽视频| 欧美精品久久99久久在免费线| 久久免费视频网站| 久久久久九九九| 久久99伊人| 西西裸体人体做爰大胆久久久| 亚洲天天影视| 亚洲午夜激情网页| 国产精品99久久久久久有的能看| 亚洲精品国产精品久久清纯直播 | 亚洲三级免费| 亚洲国产岛国毛片在线| 免费欧美在线视频| 牛人盗摄一区二区三区视频| 久久久久久伊人| 久久久蜜桃精品| 久久综合伊人| 蜜乳av另类精品一区二区| 麻豆精品视频在线| 欧美成人精品1314www| 欧美国产第二页| 亚洲电影激情视频网站| 亚洲国产欧美不卡在线观看| 欧美激情国产日韩| 最近看过的日韩成人| 夜夜爽www精品| 亚洲欧美电影院| 欧美中文字幕第一页| 久久久免费精品视频| 美女黄毛**国产精品啪啪| 欧美第一黄网免费网站| 欧美色图五月天| 国产片一区二区| 在线精品亚洲一区二区| 亚洲人体1000| 亚洲一卡二卡三卡四卡五卡| 欧美一区激情| 欧美大片在线看| 亚洲精品中文字| 亚洲欧美日韩综合一区| 久久久久久高潮国产精品视| 欧美成人有码| 国产欧美亚洲精品| 1769国产精品| 亚洲一区二区不卡免费| 久久精品国产一区二区三区| 亚洲电影免费观看高清| 一本色道久久综合亚洲精品婷婷| 欧美伊人久久久久久久久影院| 免费日韩av电影| 国产精品欧美日韩久久| 狠狠色2019综合网| 一区二区三区四区精品| 久久久久国色av免费观看性色| 欧美激情一区二区三级高清视频| 中文国产一区| 免费久久99精品国产自在现线| 欧美网站在线观看| 亚洲风情亚aⅴ在线发布| 亚洲欧美文学| 亚洲人成网站精品片在线观看 | 欧美在线免费| 欧美日韩国产一区二区三区地区| 一本色道久久综合亚洲精品婷婷 | 久久这里只有| 国产伦一区二区三区色一情| av成人福利| 亚洲第一综合天堂另类专|