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

隨筆 - 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精品视频免费观看视频| 国产精品久久久久久久久搜平片 | 日韩视频永久免费观看| 亚洲日本欧美天堂| 国产精品多人| 美女精品在线观看| 欧美伦理91i| 欧美在线中文字幕| 米奇777在线欧美播放| 一本色道久久88综合亚洲精品ⅰ| 亚洲色图自拍| 极品尤物久久久av免费看| 最新国产の精品合集bt伙计| 欧美日韩在线观看一区二区三区| 欧美在线日韩在线| 欧美承认网站| 久久国内精品自在自线400部| 久久免费午夜影院| 亚洲欧美999| 久久综合网hezyo| 亚洲欧美日本国产有色| 久久精品一区二区国产| 亚洲午夜激情| 久久在线免费| 欧美自拍偷拍午夜视频| 欧美激情2020午夜免费观看| 久久精品99国产精品| 欧美日韩精品一区二区在线播放 | 国产综合久久久久久| 亚洲激情av在线| 国内精品久久久久久 | 亚洲精品欧美| 在线观看视频欧美| 亚洲欧美精品在线观看| 99视频超级精品| 免费在线观看日韩欧美| 久久国产一区| 国产精品亚洲一区| 91久久精品国产91性色| 在线日韩一区二区| 久久久久.com| 久久久久**毛片大全| 国产精品麻豆欧美日韩ww | 久久精彩视频| 国产精品日韩高清| 亚洲伦理精品| 一区二区三区视频观看| 欧美.com| 亚洲高清视频在线| 亚洲人体一区| 欧美成人乱码一区二区三区| 免费永久网站黄欧美| 国产综合欧美| 久久久久久久97| 久久伊人亚洲| 亚洲成人中文| 免费h精品视频在线播放| 免费国产自线拍一欧美视频| 黄色一区二区在线观看| 久久久青草青青国产亚洲免观| 久久午夜色播影院免费高清| 国产亚洲视频在线观看| 久久狠狠亚洲综合| 欧美freesex交免费视频| 亚洲国产精品成人精品| 免费一级欧美片在线观看| 欧美韩日精品| 中文在线资源观看网站视频免费不卡 | 亚洲欧洲精品一区二区三区| 91久久国产精品91久久性色| 久久久亚洲欧洲日产国码αv| 久久久精品免费视频| 国产综合久久久久久鬼色| 久久九九电影| 欧美二区在线观看| 亚洲毛片在线看| 国产精品护士白丝一区av| 亚洲欧美日韩系列| 欧美在线视频免费观看| 国产一区二区三区在线观看精品| 久久国产精品网站| 欧美黑人国产人伦爽爽爽| 一区二区三区色| 国产午夜精品一区理论片飘花| 久久久欧美精品| 99视频热这里只有精品免费| 欧美在线免费观看视频| 亚洲国产高清一区| 国产精品mm| 另类酷文…触手系列精品集v1小说| 亚洲激情影视| 久久精品视频亚洲| 99国产精品| 国内精品视频一区| 欧美日韩国产麻豆| 久久精品国产久精国产思思| 亚洲人成在线影院| 久久青草久久| 亚洲欧美国产毛片在线| 亚洲激情一区二区三区| 国产精品一区二区三区四区五区| 老司机精品导航| 一区二区三区国产盗摄| 欧美成人蜜桃| 欧美一区二区成人6969| 日韩午夜免费| 精品69视频一区二区三区| 欧美色大人视频| 免费成人网www| 欧美一站二站| 亚洲特黄一级片| 亚洲欧洲日产国产网站| 久久这里有精品15一区二区三区| 亚洲天堂网站在线观看视频| 亚洲福利视频二区| 韩国欧美一区| 国产拍揄自揄精品视频麻豆| 欧美日韩视频在线一区二区 | 日韩午夜中文字幕| 欧美激情按摩在线| 久久蜜臀精品av| 久久精品亚洲一区二区三区浴池| 亚洲伊人色欲综合网| 亚洲精品一区二区三区在线观看| 国产一区二区三区久久| 国产乱码精品1区2区3区| 国产精品久久久久久超碰| 欧美日韩人人澡狠狠躁视频| 欧美激情欧美激情在线五月| 狂野欧美性猛交xxxx巴西| 久久裸体艺术| 老司机成人在线视频| 久久精品色图| 久久综合久久88| 美女亚洲精品| 欧美激情二区三区| 欧美日韩国产不卡在线看| 欧美日韩高清在线| 欧美日韩一区二区在线播放| 欧美视频在线观看视频极品| 欧美特黄一级大片| 国产精品看片你懂得| 国产老女人精品毛片久久| 国精产品99永久一区一区| 国模私拍视频一区| 在线精品国精品国产尤物884a| 亚洲国产成人av好男人在线观看| 亚洲第一天堂无码专区| 亚洲精品麻豆| 亚洲一区二区成人| 久久精品国产一区二区三区免费看 | 欧美日韩三区四区| 国产精品久久激情| 国产综合久久| 亚洲国产电影| 在线天堂一区av电影| 午夜天堂精品久久久久 | 亚洲精品日韩一| 亚洲网站在线看| 久久久精品国产一区二区三区| 欧美成人蜜桃| 国产精品99久久久久久宅男| 性色av一区二区怡红| 嫩模写真一区二区三区三州| 欧美三区视频| 一区二区在线视频播放| 一本色道久久综合亚洲精品高清 | 欧美激情一区二区久久久| 亚洲精品美女| 香蕉av福利精品导航| 欧美黑人一区二区三区| 国产精品美女久久久免费| 亚洲大胆在线| 亚洲欧美一区二区原创| 欧美激情1区2区3区| 亚洲免费一区二区| 欧美国产视频日韩| 国产亚洲第一区| 亚洲一区国产| 欧美91福利在线观看| 亚洲欧美日本国产有色| 欧美成人日本| 伊伊综合在线| 先锋资源久久| 一区二区欧美日韩| 欧美成人黄色小视频| 狠狠做深爱婷婷久久综合一区 | 午夜免费电影一区在线观看|