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

隨筆 - 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>
            免费久久99精品国产自| 欧美成人一区二免费视频软件| 国产精品有限公司| 欧美一区二区三区精品| 久久综合伊人77777| 亚洲精品欧美在线| 欧美日一区二区三区在线观看国产免 | 狠狠干综合网| 另类激情亚洲| 欧美激情一二三区| 中文亚洲欧美| 亚洲第一精品夜夜躁人人爽| 欧美一区二区三区久久精品| 性欧美长视频| 亚洲精品久久久久| 久久久久久久久久看片| 在线亚洲成人| 亚洲区一区二区三区| 国产精品扒开腿做爽爽爽软件| 久久亚洲不卡| 亚洲欧美综合国产精品一区| 亚洲电影自拍| 亚洲最新视频在线播放| 亚洲高清在线视频| 亚洲网站在线看| 99在线精品视频在线观看| 亚洲欧美一区二区三区极速播放| 久久久久国产精品一区二区| 99国内精品| 亚洲欧美三级在线| 久久免费精品日本久久中文字幕| 欧美日韩成人一区二区| 美女图片一区二区| 欧美与欧洲交xxxx免费观看| 亚洲视频日本| 久久综合久久综合久久| 欧美午夜无遮挡| 亚洲精品欧美极品| 久久九九热免费视频| 日韩视频免费观看| 日韩一区二区精品视频| 久久久国产一区二区| 久久精品主播| 欧美四级在线观看| 亚洲人成网站999久久久综合| 亚洲永久精品国产| 午夜视频一区二区| 欧美伦理a级免费电影| 久久精品国产精品亚洲精品| 久久精品30| 国产精品第2页| 欧美视频一区二区三区…| 在线观看国产精品淫| 亚洲精品久久久久中文字幕欢迎你| 欧美中文字幕第一页| 久久aⅴ国产紧身牛仔裤| 免费试看一区| 亚洲一区二区在| 欧美亚洲日本国产| 国产精品久久久久久久久久免费| 欧美国产三区| 欧美日韩免费视频| 欧美日韩一区精品| 日韩网站在线看片你懂的| 一本色道久久88综合日韩精品 | 正在播放欧美视频| 欧美人成在线视频| 99re在线精品| 日韩午夜高潮| 国产精品久久91| 羞羞视频在线观看欧美| 狂野欧美激情性xxxx欧美| 免费观看国产成人| 久久福利影视| 亚洲第一综合天堂另类专| 日韩视频免费观看高清在线视频| 亚洲综合视频网| 亚洲一区二区三区激情| 国产麻豆精品在线观看| 欧美中文字幕在线| 久久久久国产一区二区三区| 亚洲国语精品自产拍在线观看| 亚洲欧美在线高清| 午夜精品久久久久久久| 极品日韩久久| 香蕉乱码成人久久天堂爱免费 | 欧美wwwwww| 亚洲素人在线| 另类春色校园亚洲| 免费高清在线一区| 国产精品国产成人国产三级| 亚洲欧美国产日韩天堂区| 欧美+亚洲+精品+三区| 亚洲综合三区| 欧美日韩精品在线| 欧美一区二区成人| 99在线精品观看| 国产亚洲欧美色| 亚洲欧美国产精品专区久久| 午夜精品理论片| 亚洲精品中文字幕有码专区| 亚洲欧美欧美一区二区三区| 精品88久久久久88久久久| 亚洲毛片一区| 欧美激情亚洲视频| 欧美一区二区三区另类| 久久这里有精品15一区二区三区| 亚洲美女中出| 欧美一区二区在线观看| 欧美成人福利视频| 宅男噜噜噜66一区二区| 欧美亚洲午夜视频在线观看| 91久久久亚洲精品| 亚洲在线免费| aa国产精品| 两个人的视频www国产精品| 亚洲欧美综合国产精品一区| 久久全球大尺度高清视频| 亚洲欧美日韩国产一区二区| 麻豆精品精品国产自在97香蕉| 午夜国产精品视频| 欧美日韩mp4| 亚洲国产日韩欧美| 女女同性精品视频| 久久国产精品毛片| 久久久国产精品一区二区三区| 亚洲综合色自拍一区| 欧美日韩一区在线观看| 亚洲欧洲日韩女同| 国产精品久久久久av| 亚洲日本va午夜在线电影| 亚洲成色999久久网站| 久久精品国产999大香线蕉| 欧美在线观看网址综合| 国产精品午夜久久| 美乳少妇欧美精品| 国产精品视频| 亚洲美女黄色| 99riav久久精品riav| 欧美韩日亚洲| 欧美激情在线播放| 国产精品v片在线观看不卡| 欧美激情小视频| 亚洲国产一区二区三区在线播| 久久精品视频免费播放| 老司机成人在线视频| 伊人久久av导航| 久久影视三级福利片| 欧美韩日一区二区| 一区二区三区久久精品| 欧美日韩一区二区欧美激情 | 美女诱惑一区| 亚洲国产精品一区二区www| 一区二区成人精品| 欲色影视综合吧| 久久青草欧美一区二区三区| 欧美大片在线看| 国产精品丝袜91| 午夜精品久久久久久久男人的天堂 | 日韩亚洲精品电影| 亚洲男人的天堂在线观看| 一本色道**综合亚洲精品蜜桃冫| 夜夜嗨av一区二区三区免费区| 欧美日韩国产一区二区三区地区| 日韩亚洲国产欧美| 久久视频国产精品免费视频在线 | 欧美乱妇高清无乱码| 欧美成年人视频| 亚洲日本欧美在线| 欧美三区在线观看| 欧美一区午夜精品| 亚洲电影第三页| 亚洲欧美国产日韩中文字幕| 国产美女诱惑一区二区| 久久性天堂网| 一区二区三区高清在线观看| 久久久国产成人精品| 亚洲人线精品午夜| 国产精品揄拍一区二区| 欧美成年人视频网站| 亚洲亚洲精品三区日韩精品在线视频| 久久久在线视频| 亚洲一区激情| 亚洲欧洲一区二区三区| 国产精品午夜久久| 欧美日韩国产精品一卡| 午夜精品久久久久久久久| 亚洲欧洲精品一区二区三区不卡 | 欧美寡妇偷汉性猛交| 欧美一区二区三区精品电影| 日韩视频在线观看免费| 老司机精品导航| 久久精品理论片| 亚洲先锋成人| 欧美三级不卡| 麻豆91精品91久久久的内涵| 午夜精品一区二区三区在线视| 亚洲片在线资源| 欧美成人精品不卡视频在线观看| 欧美伊人久久久久久午夜久久久久 |