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

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

潛心看書研究!

常用鏈接

留言簿(19)

隨筆分類(81)

文章分類(89)

相冊

ACM OJ

My friends

搜索

  •  

積分與排名

  • 積分 - 219403
  • 排名 - 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>
            国产亚洲人成a一在线v站| 欧美色123| 91久久夜色精品国产网站| 男女激情久久| 欧美日本一区| 欧美亚洲一区二区在线| 欧美一区二区在线视频| 亚洲成人在线观看视频| 欧美韩日高清| 国产精品久久久一本精品| 午夜精品福利在线| 久久精品亚洲精品| 亚洲欧洲精品一区二区精品久久久| 亚洲国产一成人久久精品| 欧美激情在线观看| 欧美在线视频a| 久久一区二区三区国产精品 | 欧美电影在线| 亚洲免费在线看| 久久久水蜜桃| 亚洲一本大道在线| 久久久久久久久久久久久久一区| 亚洲精品一区二区三区婷婷月 | 亚洲精品免费在线| 国产欧美91| 亚洲日本免费| 精品不卡在线| 亚洲一区二区三区免费观看 | 欧美日本一区| 男人天堂欧美日韩| 国产精品视频你懂的| 亚洲国产精品123| 国产美女精品免费电影| 亚洲国产精品久久久久秋霞影院| 国产伦精品一区二区三区在线观看| 欧美大学生性色视频| 国产精品亚洲综合| 日韩视频免费观看高清完整版| 国产午夜精品全部视频在线播放| 亚洲免费成人| 亚洲人成在线观看一区二区| 午夜精品免费在线| 亚洲欧美日韩国产中文| 欧美国产精品v| 欧美大片在线影院| 韩日午夜在线资源一区二区| 中文精品视频| 亚洲手机视频| 久久福利视频导航| 国产日本欧美一区二区三区在线| 欧美插天视频在线播放| 国产片一区二区| 国产精品99久久久久久人| 日韩午夜免费视频| 男人的天堂亚洲在线| 蜜臀a∨国产成人精品| 好看的亚洲午夜视频在线| 午夜精品在线| 久久精品30| 国产日韩欧美电影在线观看| 亚洲一区二区三区免费视频| 亚洲免费小视频| 国产精品视频yy9299一区| 在线一区二区三区四区五区| 亚洲一区精彩视频| 国产精品av免费在线观看| 一本色道久久88精品综合| 亚洲一区三区在线观看| 国产精品久久久久免费a∨大胸 | 午夜精品国产| 国产麻豆成人精品| 香蕉久久夜色精品| 老色鬼久久亚洲一区二区| 亚洲国产精品一区二区第一页 | 久久久久国产精品厨房| 欧美sm极限捆绑bd| 日韩午夜电影av| 欧美日韩在线免费观看| 亚洲一区二区欧美| 久久不见久久见免费视频1| 国内成人自拍视频| 欧美成人激情视频免费观看| 日韩视频永久免费观看| 欧美一区二区三区视频| 韩国三级电影一区二区| 欧美成人精品激情在线观看 | 欧美一区深夜视频| 在线不卡亚洲| 欧美精品在线网站| 亚洲欧美自拍偷拍| 欧美国产日韩一区| 亚洲综合色自拍一区| 国产一区二区中文| 欧美精品粉嫩高潮一区二区| 亚洲在线国产日韩欧美| 蜜月aⅴ免费一区二区三区 | 亚洲国产免费看| 国产精品国产精品| 久久精品一区二区三区中文字幕 | 亚洲无毛电影| 免费不卡亚洲欧美| 亚洲尤物精选| 亚洲国产欧美一区| 国产精品免费网站在线观看| 美女精品视频一区| 亚洲欧美国产精品va在线观看| 欧美777四色影视在线| 亚洲综合日韩在线| 日韩视频免费观看高清完整版| 国产亚洲视频在线| 欧美日韩久久精品| 麻豆视频一区二区| 欧美亚洲日本国产| 一本色道久久88亚洲综合88| 免费看黄裸体一级大秀欧美| 亚洲欧美视频在线| 99精品国产99久久久久久福利| 国内久久婷婷综合| 国产精品丝袜白浆摸在线| 欧美激情亚洲精品| 裸体素人女欧美日韩| 久久精品91| 校园激情久久| 亚洲欧美国产视频| 一本色道久久综合狠狠躁篇的优点| 毛片av中文字幕一区二区| 欧美亚洲综合久久| 亚洲欧美日本另类| 亚洲伊人第一页| 亚洲视频在线二区| 一区电影在线观看| 日韩天堂av| 99国产一区| 9色porny自拍视频一区二区| 亚洲国产精选| 亚洲国产日韩欧美在线图片| 亚洲大胆视频| 亚洲国产欧美日韩精品| 亚洲高清一区二| 最新成人av网站| 亚洲人成在线观看一区二区 | 国产精品女主播在线观看| 欧美日韩一区免费| 国产精品久久久久久影视| 国产精品福利影院| 国产精品日韩久久久| 国产欧美日韩综合精品二区| 国产欧美视频一区二区三区| 国产欧美婷婷中文| 国语自产精品视频在线看抢先版结局| 国产一区二区按摩在线观看| 在线观看欧美黄色| 亚洲激情成人网| 99re6这里只有精品| av不卡在线观看| 亚洲专区免费| 久久久99免费视频| 欧美大片一区二区| 日韩视频免费| 亚洲欧美综合网| 久久久青草青青国产亚洲免观| 欧美成人在线免费视频| 欧美视频久久| 韩国av一区二区三区在线观看| 一区二区视频免费完整版观看| 亚洲国产清纯| 午夜精品久久久久久久久久久久久 | 欧美激情按摩| 国产精品男人爽免费视频1 | 久久视频这里只有精品| 男女av一区三区二区色多| 亚洲人成毛片在线播放| 亚洲午夜在线观看| 久久久久久久综合狠狠综合| 欧美激情一区二区在线| 国产日韩欧美自拍| 亚洲青涩在线| 欧美一区二区视频97| 欧美激情一区二区久久久| 亚洲深爱激情| 欧美不卡激情三级在线观看| 国产精品都在这里| 亚洲激情在线观看| 欧美在线观看视频在线| 亚洲国产欧美久久| 欧美一级精品大片| 欧美特黄一级大片| 亚洲黄色精品| 久久久久综合一区二区三区| av不卡在线看| 免费日韩一区二区| 国产日韩视频一区二区三区| 亚洲经典三级| 久久亚洲欧美国产精品乐播| 夜夜嗨av一区二区三区四季av| 免费看av成人| 在线免费观看视频一区| 欧美一级二区| 在线亚洲电影| 欧美视频手机在线|