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

隨筆 - 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>
            久久精品国产精品亚洲精品| 另类激情亚洲| 亚洲作爱视频| 欧美视频一区二| 亚洲综合色视频| 亚洲愉拍自拍另类高清精品| 国产精品男女猛烈高潮激情 | 免费黄网站欧美| 亚洲国产欧洲综合997久久| 久久一区二区三区四区五区| 久久久一区二区三区| 91久久精品国产91久久性色tv| 亚洲国产成人一区| 你懂的国产精品| 亚洲无玛一区| 欧美在线免费视频| 亚洲国产精品123| 欧美激情一区在线| 亚洲欧美成人在线| 久久久久免费观看| 99国产精品视频免费观看一公开| 一区二区三区国产精品| 国产亚洲视频在线| 亚洲黄色在线看| 国产日韩精品视频一区| 欧美成年人视频网站欧美| 欧美日韩免费观看一区| 久久国产精品久久久| 免费看的黄色欧美网站| 亚洲专区在线| 久久人人爽国产| 亚洲在线视频一区| 免费永久网站黄欧美| 亚洲欧美成人在线| 免费在线欧美黄色| 欧美一区二区免费| 欧美剧在线观看| 久久婷婷久久| 国产精品每日更新在线播放网址| 欧美高清视频www夜色资源网| 欧美婷婷在线| 亚洲黑丝在线| 黄色av一区| 午夜精品一区二区在线观看 | 国产精品亚洲综合天堂夜夜| 欧美岛国激情| 极品av少妇一区二区| 亚洲视频在线一区观看| 亚洲激情一区| 久久日韩精品| 久久精品一区二区三区中文字幕| 欧美日韩国产专区| 欧美顶级艳妇交换群宴| 国内精品视频666| 亚洲一二三区视频在线观看| 亚洲六月丁香色婷婷综合久久| 久久国产精品亚洲va麻豆| 亚洲综合色噜噜狠狠| 欧美日韩在线免费| 亚洲精品国产精品久久清纯直播 | 欧美乱妇高清无乱码| 欧美成人国产一区二区| 国产一区二区欧美| 欧美一级大片在线免费观看| 亚洲欧美激情一区二区| 欧美性开放视频| 亚洲午夜一区| 午夜精品国产精品大乳美女| 国产精品sm| 亚洲视频一区二区免费在线观看| 99视频精品全部免费在线| 欧美成人中文| 日韩五码在线| 久久综合九色综合欧美就去吻| 久久九九全国免费精品观看| 国产视频久久久久久久| 欧美在线观看一区二区三区| 久久国产免费看| 一区免费在线| 欧美电影打屁股sp| 日韩一级欧洲| 欧美一区免费| 尤物99国产成人精品视频| 蜜桃伊人久久| 亚洲毛片在线看| 欧美一区二区三区在线播放| 国产日韩成人精品| 久久久视频精品| 91久久久国产精品| 亚洲欧美日韩在线播放| 国产视频欧美| 免播放器亚洲一区| 一区二区三区**美女毛片| 欧美一区二区三区四区高清 | 国产精品网站在线| 亚洲人成人一区二区三区| 一区二区三区高清在线| 亚洲欧美国产高清va在线播| 亚洲第一区在线| 欧美freesex8一10精品| 亚洲老板91色精品久久| 欧美一区二区观看视频| 韩国福利一区| 欧美日韩成人在线视频| 欧美一区国产一区| 亚洲国产影院| 久久久噜噜噜久久人人看| 亚洲精品在线电影| 国产一区二区精品久久91| 欧美激情亚洲国产| 久久精品国产2020观看福利| 99国产精品久久久久老师| 久久露脸国产精品| 亚洲欧美日本精品| 亚洲人体偷拍| 在线精品国精品国产尤物884a| 欧美日韩三级一区二区| 久久尤物视频| 午夜日本精品| 中文日韩电影网站| 最新亚洲激情| 欧美www视频在线观看| 久久电影一区| 亚洲一区中文| 洋洋av久久久久久久一区| 国际精品欧美精品| 国产精品美女主播在线观看纯欲| 欧美国产日韩一区| 久久久久亚洲综合| 欧美中文在线观看国产| 亚洲午夜电影在线观看| 亚洲精品一区二区三区福利| 欧美国产先锋| 蜜臀av性久久久久蜜臀aⅴ| 欧美在线看片a免费观看| 亚洲永久免费观看| 在线综合视频| 亚洲私人影吧| 亚洲一区二区三区免费在线观看| 亚洲免费电影在线| 亚洲精品免费在线播放| 在线视频国内自拍亚洲视频| 国产在线视频欧美| 国产性猛交xxxx免费看久久| 国产欧美高清| 国产午夜精品久久久久久久| 国产日韩欧美亚洲| 国产亚洲电影| 国产一区二区三区四区| 好吊妞**欧美| 亚洲国产第一| 99riav久久精品riav| 中文久久精品| 午夜精品久久久久久久久久久久 | 国产精品久久久久9999| 欧美午夜宅男影院| 国产伦精品免费视频| 国产午夜精品福利| 尤物九九久久国产精品的分类| 精品白丝av| 日韩一二三区视频| 亚洲影院污污.| 欧美一区=区| 免费一级欧美在线大片| 亚洲国产一区二区在线| 夜夜嗨av一区二区三区| 亚洲视频在线观看| 久久国产精品亚洲va麻豆| 久久久人成影片一区二区三区| 欧美.日韩.国产.一区.二区| 欧美日韩精品免费观看视频完整| 欧美色综合网| 好吊日精品视频| 亚洲免费成人av电影| 欧美一区二区免费视频| 欧美岛国激情| 亚洲视频在线观看网站| 久久久久**毛片大全| 欧美日韩成人一区| 国产欧美日本一区二区三区| 亚洲国产精品久久| 亚洲女人天堂成人av在线| 久久精品国产亚洲5555| 亚洲国产福利在线| 亚洲欧美三级在线| 欧美电影在线观看| 国产日韩欧美不卡| 一区二区三区精密机械公司 | 亚洲国产精品一区二区www| 99视频精品在线| 久久久人成影片一区二区三区观看| 欧美韩日一区二区三区| 国产亚洲精品一区二区| 日韩一区二区精品葵司在线| 久久激情中文| 一片黄亚洲嫩模| 亚洲一区二区网站| 欧美成人午夜影院| 午夜亚洲福利| 国产精品电影在线观看|