This is the code I wrote: have been testing you can think of is correct, but always WA,,
# include
#include
#include
#include
using namespace std;
Typedef struct node
{
int x,y;
} the node;
Bool CMP (node a and node b)
{
Return a.x & lt; B.x;
}
The node p [1000005];
Int dp [1000005];
Int main ()
{
Int n, m, k, I, j;
While (cin> N> M) {
Memset (dp, 0, sizeof (dp));
Cin> k;
for(i=0; iCin> P [I] x> P [I] y;
Sort (p, p + k, CMP);
for(i=0; iFor (j=I + 1; J If (p [j] x> P [I]. X & amp; & P [j] y> P [I] y & amp; & Dp [I] + 1 & gt; Dp [j])//p [j]. J x> P [I] has incremental feature x in x axis
Dp [j]=dp [I] + 1;
Int sum=dp [k - 1) + 1;//article walked a total sum of special edge (the longest monotone increasing the length of the subsequence)
Double ans=100 * ((m + n) - (sum * (2 - SQRT (2))));//each take a special edge is less walk 2 - SQRT (2)
If (ans - int (ans) & gt;=0.5)
Cout<(int) ans + 1 & lt;The else
Cout<(int) ans
}
return 0;
}
CodePudding user response:
WA is what mean?This problem is the key to the processing of bevel edge, we can remove the hypotenuse does not contain rows and columns are, if small bevel edge, so the size will reduce a lot of, can improve the processing efficiency
CodePudding user response:
WA is the Wrong Answer, it is logical and problem, may be missed, or didn't want to knowCodePudding user response: