首页 > ACM题库 > HDU-杭电 > hdu 2849 For Kisses待解决[解题报告]C++
2014
02-17

hdu 2849 For Kisses待解决[解题报告]C++

For Kisses

问题描述 :

WisKey has a little lovely sister named Sweet. One day Sweet wants play a game with him. The game rules like this, in the N*N girds, you can choose K girds to make any 4 of grids not rectangles vertexes, Sweet say if WisKey can find out the max K, she will give him a Kiss !!
WoW, this is a funny and cute challenge, everybody rise UP~
This is not rectangle.
This is a rectangle.

输入:

The Sweet just has 9 questions, any questions have an N(N<=21). and WisKey want 9 Kisses!

输出:

The Sweet just has 9 questions, any questions have an N(N<=21). and WisKey want 9 Kisses!

样例输入:

1
2
3
4
5
6
7
13
21

样例输出:

1
3
.
.
.

Hint
Hint When N = 2, the one of the solutions is , so the max K is 3.


  1. 第一句可以忽略不计了吧。从第二句开始分析,说明这个花色下的所有牌都会在其它里面出现,那么还剩下♠️和♦️。第三句,可以排除2和7,因为在两种花色里有。现在是第四句,因为♠️还剩下多个,只有是♦️B才能知道答案。

  2. L(X [0 .. M-1],Y [0 .. N-1])= 1 + L(X [0 .. M-2],Y [0 .. N-1])这个地方也也有笔误
    应改为L(X [0 .. M-1],Y [0 .. N-1])= 1 + L(X [0 .. M-2],Y [0 .. N-2])