The following code will be uploaded to vjudge system always prompt wrong answer on the test of 3 is why
# include & lt; iostream>
# include & lt; Algorithm>
using namespace std;
Int main ()
{
Long int n=0;
Cin & gt;> n;
Int flag=1;
int c=0;
A=new long long long long int * int [n + 2);
A [n + 1)=0;
A [0]=0;
For (int I=1; i
While (flag!=0)
{
flag=0;
For (int I=1; i
If (a [I] & gt; A [I - 1] & amp; & A [I] & gt; A [I + 1])
{
A=a [I] - [I] (a [I] - Max (a [I - 1], a [I + 1)));
Flag=1;
c++;
}
}
}
Flag=1;
While (flag!=0)
{
flag=0;
For (int I=1; i
If (a [I] & gt; 0)
{
A [I] -;
Flag=1;
}
}
c++;
}
Cout & lt;
}
CodePudding user response:
Do you have any topic linkCodePudding user response:
Operation guarantee can reduce 1 column 2The operation must ensure that reduces the average is more than 1 column to choose operation 1
The basic idea should be
If there is a link
I want to commit code can try this idea will work
CodePudding user response:
Your first two operating cycle can't corresponding subject