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

隨筆 - 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>
            亚洲桃色在线一区| 亚洲一区二区三区在线观看视频| 亚洲大片在线观看| 欧美一区二区黄色| 狠狠色狠狠色综合系列| 久久久午夜精品| 另类酷文…触手系列精品集v1小说| 亚洲精品乱码久久久久久蜜桃麻豆 | 性伦欧美刺激片在线观看| 欧美视频在线不卡| 午夜精品一区二区三区在线视 | 一区二区三区不卡视频在线观看 | 美女黄毛**国产精品啪啪| 久久国产精品99精品国产| **欧美日韩vr在线| 亚洲激情电影中文字幕| 欧美日韩成人一区| 亚洲私拍自拍| 亚洲欧美大片| 在线日韩av| 一区二区三区国产在线| 国产欧美69| 欧美大片网址| 国产精品久久综合| 模特精品在线| 欧美性事免费在线观看| 美国十次了思思久久精品导航| aaa亚洲精品一二三区| 国产欧美精品日韩精品| 欧美大片在线观看| 国产精品日韩欧美| 亚洲国产成人不卡| 国产精品一区二区三区久久| 欧美成人黄色小视频| 欧美午夜宅男影院| 久久亚洲精品视频| 国产精品高潮呻吟| 欧美国产视频一区二区| 国产麻豆精品久久一二三| 欧美黑人多人双交| 国产日韩在线不卡| 一本色道久久综合狠狠躁的推荐| 欧美顶级艳妇交换群宴| 欧美一区二区日韩| 欧美日韩一区综合| 欧美电影在线观看| 国产一区二区三区免费在线观看| 亚洲一级二级| 欧美成年人网站| 久久久久久久综合色一本| 欧美精品videossex性护士| 久久精品一区二区三区中文字幕 | 亚洲毛片在线看| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲黄色小视频| 国产综合色一区二区三区| 亚洲视频999| 亚洲天堂第二页| 欧美激情黄色片| 亚洲福利视频二区| 亚洲国产精品99久久久久久久久| 欧美高清一区二区| 国产综合在线视频| 午夜精品影院在线观看| 午夜视频一区| 国产精品色网| 99热在线精品观看| 亚洲一区二区视频在线| 欧美日本不卡| 亚洲精品视频在线播放| 亚洲人体一区| 欧美精品色一区二区三区| 欧美激情bt| 日韩午夜在线视频| 欧美另类一区二区三区| 亚洲精选一区| 亚洲一区二区成人| 国产精品一级久久久| 亚洲在线一区二区| 久久精品官网| 在线播放国产一区中文字幕剧情欧美 | 日韩视频在线观看免费| 欧美电影免费观看网站| 亚洲狼人综合| 午夜精品一区二区三区在线| 国产精品日韩久久久久| 午夜精品电影| 欧美成人在线免费视频| 一本色道精品久久一区二区三区 | 亚洲网站视频福利| 欧美一区二区三区在线观看视频| 久久久亚洲欧洲日产国码αv | 激情久久五月| 女人香蕉久久**毛片精品| 亚洲国产午夜| 亚洲欧美在线高清| 影音先锋亚洲精品| 欧美日韩99| 欧美一区二区性| 欧美高清在线精品一区| 亚洲综合电影| 永久免费视频成人| 欧美日韩在线视频首页| 欧美与欧洲交xxxx免费观看| 欧美国产日韩一区二区三区| 亚洲欧美电影院| 亚洲国产精品小视频| 国产精品捆绑调教| 老司机午夜精品视频在线观看| 欧美有码视频| 亚洲激情电影在线| 国产精品一区二区久久久久| 狼人天天伊人久久| 亚洲一区中文| 最新成人av网站| 猛男gaygay欧美视频| 亚洲尤物影院| 亚洲毛片在线观看| 精品福利免费观看| 国产精品免费网站| 欧美成人精品福利| 久久精品国产77777蜜臀| 一本久道久久久| 亚洲韩国精品一区| 久久亚洲不卡| 欧美亚洲三区| 亚洲性色视频| 99精品国产在热久久下载| 怡红院精品视频| 国产亚洲人成a一在线v站| 国产精品高潮粉嫩av| 欧美精选午夜久久久乱码6080| 亚洲高清免费| 久久免费国产| 久久久久国产精品麻豆ai换脸| 国产亚洲一区二区在线观看 | 亚洲欧洲一区二区在线播放| 国产精品午夜国产小视频| 欧美日韩hd| 欧美国产高潮xxxx1819| 久久一区中文字幕| 久久精品99无色码中文字幕| 午夜在线一区二区| 亚洲欧美日本精品| 亚洲性视频h| 亚洲在线免费观看| 亚洲一级在线观看| 日韩一区二区精品葵司在线| 亚洲精品美女在线观看| 亚洲欧洲日韩在线| 亚洲精品乱码久久久久久黑人| 午夜精品视频在线| 香蕉久久a毛片| 欧美一级视频| 久久精品欧洲| 美女精品在线| 亚洲电影av在线| 亚洲免费观看高清完整版在线观看熊 | 久久久午夜电影| 久久久91精品国产一区二区三区| 国产一区再线| 在线观看日韩国产| 亚洲精品国产精品乱码不99按摩 | 久久久久久久欧美精品| 久久免费国产精品1| 欧美成人自拍视频| 欧美日韩国产成人精品| 国产精品久久| 一区二区三区在线视频观看| 最新69国产成人精品视频免费| 国产精品人人爽人人做我的可爱| 久久亚洲精选| 欧美日韩精品一区| 国产精品自在欧美一区| **性色生活片久久毛片| 亚洲欧洲在线免费| 性欧美大战久久久久久久免费观看 | 亚洲一区二区三区在线观看视频| 欧美成人伊人久久综合网| 亚洲精品免费网站| 亚洲视频二区| 久久一区国产| 国产精品色婷婷| 亚洲精品无人区| 久久激情视频久久| 欧美国产另类| 亚洲一区二区视频在线观看| 欧美一区二区三区免费观看| 久久亚洲一区二区| 国产精品视频免费观看| 国内成+人亚洲+欧美+综合在线| 欧美另类一区| 欧美视频在线观看一区二区| 国产农村妇女精品| 91久久精品日日躁夜夜躁国产| 欧美经典一区二区| 激情久久久久| 一本久道综合久久精品| 久久精品国产一区二区三区| 亚洲美女啪啪|