Home > Back-end >  Pampas eagle, eldest brother elder sister, knock code tired, rest after help look at what's goi
Pampas eagle, eldest brother elder sister, knock code tired, rest after help look at what's goi

Time:10-06

Link: http://acm.nyist.net/JudgeOnline/problem.php? Pid=195
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; JIf (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 know

CodePudding user response:

reference 1st floor dataxdata 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 many
WA is the Wrong Answer, is the logic have some problem, may be missed, or didn't want to know

CodePudding user response:

Does not contain the rows and columns of hypotenuse are removed, will shrink, and at worst according to shortest path algorithm to calculate, and were finally get rid of the number of rows and columns, is the shortest path
  • Related