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

隨筆 - 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>
            性刺激综合网| 中日韩在线视频| 国内免费精品永久在线视频| 日韩午夜免费| 夜夜爽av福利精品导航| 牛人盗摄一区二区三区视频| 嫩草伊人久久精品少妇av杨幂| 国产在线国偷精品产拍免费yy| 午夜一级久久| 欧美高清免费| 亚洲欧美日韩国产成人| 国产视频一区二区在线观看| 久久av在线| 欧美sm极限捆绑bd| 一区二区三区色| 国内精品伊人久久久久av影院 | 合欧美一区二区三区| 欧美一区2区视频在线观看| 久久亚洲色图| 99国产精品久久久| 国产精品网站一区| 久久伊人精品天天| 亚洲在线免费| 亚洲第一色中文字幕| 亚洲美女电影在线| 国产一区二区三区在线观看视频 | 久久综合国产精品| 一区二区三区免费网站| 蜜桃精品一区二区三区 | 另类亚洲自拍| 欧美一区二区三区男人的天堂| 亚洲国产精品www| 国产精品一卡二卡| 欧美亚洲一区二区在线| 亚洲欧美日韩国产成人精品影院| 两个人的视频www国产精品| 99视频精品全部免费在线| 国语精品中文字幕| 国产精品免费一区二区三区观看| 麻豆精品一区二区综合av| 亚洲女与黑人做爰| 夜夜嗨av一区二区三区四季av| 久久综合给合| 久久超碰97人人做人人爱| 99成人在线| 99精品免费视频| 亚洲精品乱码久久久久久黑人 | 免费在线一区二区| 久久久久九九视频| 欧美一区91| 亚洲伊人观看| 亚洲无限乱码一二三四麻| 亚洲精品乱码视频| 91久久夜色精品国产九色| 黑人一区二区三区四区五区| 国产色视频一区| 国产日韩精品一区二区三区在线| 国产精品毛片| 国产午夜精品久久久| 国产日本欧洲亚洲| 国产一区观看| 在线成人www免费观看视频| 国产一区自拍视频| 国产在线视频欧美| 韩国美女久久| 亚洲福利在线看| 亚洲精品麻豆| 亚洲欧美日本伦理| 久久久精品一区| 免费看黄裸体一级大秀欧美| 欧美国产丝袜视频| 亚洲精品一区在线观看| 夜色激情一区二区| 午夜精品久久久久久| 久久精品一区蜜桃臀影院| 美女啪啪无遮挡免费久久网站| 欧美国产日本高清在线| 欧美深夜福利| 国内一区二区在线视频观看| 精品动漫一区二区| 亚洲免费观看在线观看| 亚洲一区二区在线播放| 久久精品免费观看| 亚洲激情综合| 亚洲一区二区在线免费观看视频| 欧美一区二区三区久久精品茉莉花| 在线成人h网| 一区二区三区视频在线播放| 亚洲一区二区精品在线| 久久综合九色综合网站| 亚洲精品在线观看免费| 午夜精品久久久久久久久久久久 | 日韩视频精品在线| 亚洲欧美精品中文字幕在线| 免费看av成人| 亚洲免费视频一区二区| 欧美成年人网| 黄色成人在线| 亚洲视频高清| 欧美二区在线看| 正在播放欧美一区| 美女亚洲精品| 国产一区二区久久久| 一道本一区二区| 男人的天堂亚洲| 午夜免费日韩视频| 国产精品观看| 亚洲精品小视频在线观看| 久久成人av少妇免费| 一本久久a久久免费精品不卡| 久久久久一区| 国内揄拍国内精品少妇国语| 亚洲欧美日韩精品久久久久| 亚洲国产成人精品久久久国产成人一区 | 国产精品视频999| 亚洲精品免费网站| 久久精品亚洲精品| 亚洲视频一二三| 欧美理论视频| 日韩午夜电影| 欧美激情亚洲一区| 久久精品国产一区二区三区免费看| 国产精品二区影院| 一区二区三区免费看| 亚洲第一在线综合在线| 欧美亚洲视频一区二区| 国产精品va在线播放| 亚洲人成网站在线播| 久久夜色精品国产噜噜av| 一个色综合导航| 欧美日本不卡高清| 亚洲国产一区二区三区青草影视 | 欧美日韩在线精品| 亚洲美女中出| 亚洲黑丝在线| 国产欧美日韩综合一区在线观看| 99视频在线观看一区三区| 亚洲国产国产亚洲一二三| 久久精品视频在线| 国产女主播一区| 欧美在线视频a| 午夜日韩激情| 国产精品呻吟| 久久全国免费视频| 亚洲欧美综合另类中字| 国产精品影片在线观看| 羞羞色国产精品| 亚洲欧美另类久久久精品2019| 国产精品福利网| 亚洲欧美成人综合| 亚洲一区二区三区在线视频| 国产女优一区| 女女同性精品视频| 欧美国产乱视频| 午夜精品福利一区二区三区av| 一区二区欧美日韩| 国产精品丝袜白浆摸在线| 欧美一区二区三区在线观看| 亚洲在线播放电影| 国内精品福利| 亚洲大黄网站| 欧美视频不卡| 久久精品在线播放| 免费亚洲视频| 亚洲免费在线观看| 欧美伊人精品成人久久综合97| 黑人操亚洲美女惩罚| 亚洲国内精品| 国产精品女同互慰在线看| 久久久久久成人| 欧美激情第五页| 欧美在线首页| 欧美国产日韩一区二区| 亚洲欧美卡通另类91av| 欧美一区二区私人影院日本 | 一区二区国产日产| 久久国产精品一区二区三区| 亚洲成色www久久网站| 日韩一级不卡| 尤物99国产成人精品视频| 欧美好吊妞视频| 国产精品一二一区| 欧美激情亚洲一区| 国产一区日韩一区| 亚洲精品一区二区三区蜜桃久| 国产亚洲欧美一区在线观看| 亚洲黄色视屏| 狠狠久久亚洲欧美| 99pao成人国产永久免费视频| 国产一区二区三区丝袜| 亚洲伦理网站| 在线观看一区视频| 午夜精品电影| 在线综合亚洲| 毛片一区二区三区| 久久精品国产成人| 亚洲精品护士| 欧美精彩视频一区二区三区| 久久久国产精品亚洲一区| 欧美日韩成人|