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

隨筆 - 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>
            亚洲国产精品va在线看黑人动漫 | 夜夜爽www精品| 欧美精品久久一区二区| 宅男噜噜噜66一区二区 | 欧美伊人久久| 精品91在线| 亚洲欧洲日本在线| 欧美日韩亚洲91| 欧美怡红院视频| 久久夜色精品国产欧美乱| 99国产精品久久久| 亚洲欧美美女| 最新亚洲激情| 午夜精品一区二区在线观看| 在线精品视频一区二区| 亚洲人成久久| 国产亚洲精品bt天堂精选| 欧美成人资源| 国产精品久久国产精麻豆99网站| 欧美中文字幕不卡| 欧美经典一区二区三区| 性欧美1819sex性高清| 久热精品在线视频| 欧美一区二区精品在线| 欧美成人激情在线| 久久国产婷婷国产香蕉| 欧美欧美全黄| 欧美99在线视频观看| 国产精品极品美女粉嫩高清在线 | 亚洲精品欧美在线| 又紧又大又爽精品一区二区| 日韩视频免费大全中文字幕| 国产一区视频在线看| 中文亚洲免费| 亚洲精品视频免费观看| 久久gogo国模啪啪人体图| 亚洲影院在线| 欧美久色视频| 欧美激情网友自拍| 韩日成人av| 午夜一区二区三区在线观看| 99视频精品| 欧美国产成人在线| 欧美国产成人精品| 影音先锋一区| 久久九九免费| 狂野欧美一区| 国产曰批免费观看久久久| 亚洲影视在线| 欧美一区二区三区喷汁尤物| 欧美日韩美女一区二区| 欧美高清你懂得| 在线精品国产成人综合| 久久九九热re6这里有精品| 久久激情婷婷| 国内精品久久久久伊人av| 亚洲欧美高清| 久久av一区二区三区漫画| 国产精品久久一区主播| 亚洲免费综合| 久久久亚洲国产美女国产盗摄| 国产老女人精品毛片久久| 亚洲在线一区| 久久久精品欧美丰满| 国产自产v一区二区三区c| 欧美一区二区三区四区夜夜大片| 欧美在线视频在线播放完整版免费观看 | 99视频在线精品国自产拍免费观看 | 免费不卡视频| 亚洲精品美女久久7777777| 日韩一二三区视频| 欧美体内谢she精2性欧美| 亚洲一区黄色| 乱中年女人伦av一区二区| 在线日韩一区二区| 欧美精品久久久久久久免费观看| 亚洲精品中文字| 午夜免费电影一区在线观看| 国产日韩欧美一区二区三区四区| 欧美一级理论片| 欧美成人69| 亚洲先锋成人| 国模精品一区二区三区色天香 | 欧美黑人一区二区三区| 亚洲免费观看高清在线观看 | 一区二区三区黄色| 国产伦精品一区二区三| 久久嫩草精品久久久精品| 亚洲精品欧美日韩专区| 欧美一区二区| 亚洲精品乱码久久久久久黑人 | 亚洲一区二区三区成人在线视频精品| 国产精品播放| 久久这里只有精品视频首页| 亚洲区在线播放| 久久久天天操| 一本大道久久a久久精二百| 国产欧美在线观看一区| 女仆av观看一区| 午夜综合激情| 日韩午夜剧场| 免费在线视频一区| 午夜精品在线看| 亚洲美女色禁图| 黑人一区二区三区四区五区| 欧美日产国产成人免费图片| 欧美在线|欧美| 一本大道久久a久久精品综合| 久久免费视频一区| 亚洲中字在线| 亚洲老板91色精品久久| 国内精品久久久久伊人av| 欧美日韩一区二区欧美激情| 久久视频一区二区| 亚洲综合激情| 一区二区三区视频免费在线观看| 欧美成人中文字幕| 葵司免费一区二区三区四区五区| 亚洲私人黄色宅男| 亚洲精品日韩一| 在线看一区二区| 国内精品久久久久久| 国产精品久久久久影院亚瑟| 欧美精品福利| 欧美精品日韩www.p站| 鲁大师影院一区二区三区| 久久久久国产一区二区三区四区 | 亚洲国产高潮在线观看| 美女黄色成人网| 久久免费视频一区| 久久久久久穴| 久久久99精品免费观看不卡| 欧美一级二级三级蜜桃| 亚洲欧美在线x视频| 亚洲综合激情| 午夜精品久久久久久久99樱桃 | 日韩亚洲欧美成人| 日韩午夜精品| 一个色综合导航| 一区二区欧美日韩| 亚洲一区二区三区乱码aⅴ| 亚洲性感激情| 午夜精品久久久久| 欧美在线亚洲| 久久蜜桃精品| 欧美a一区二区| 亚洲电影毛片| 99re成人精品视频| 亚洲一区在线播放| 欧美一区二区精美| 久久蜜桃资源一区二区老牛| 久久这里有精品视频| 欧美激情综合五月色丁香| 欧美日韩在线三区| 国产乱肥老妇国产一区二| 狠狠入ady亚洲精品| 亚洲国产一区二区视频| 亚洲色在线视频| 久久9热精品视频| 母乳一区在线观看| 亚洲美女色禁图| 性久久久久久久久久久久| 久久久久.com| 欧美日韩一区二区视频在线| 国产精品五区| 亚洲激情在线观看| 午夜精品视频在线观看| 久久视频在线看| 亚洲美女在线视频| 欧美在线视频在线播放完整版免费观看| 久久久久se| 欧美午夜激情视频| 在线观看国产日韩| 亚洲自拍三区| 欧美黄色小视频| 亚洲欧美国产制服动漫| 蜜臀av一级做a爰片久久| 欧美午夜欧美| 亚洲片在线资源| 久久久999精品| 日韩一级大片| 欧美a级在线| 国产一区二区三区的电影| 亚洲九九九在线观看| 久久亚洲精品伦理| 亚洲一区二区精品在线观看| 美女露胸一区二区三区| 国产精品一区二区三区免费观看| 亚洲国产精品va在线看黑人| 午夜精品一区二区三区四区 | 蜜臀久久99精品久久久久久9| 一级日韩一区在线观看| 葵司免费一区二区三区四区五区| 国产精品国产一区二区| 亚洲精品免费看| 欧美大色视频| 玖玖综合伊人| 好吊日精品视频| 久久成人18免费网站| 一区二区三区.www|