10102 getting Wrong Answer , please help me to solve it
Moderator: Board moderators
-
- New poster
- Posts: 2
- Joined: Sun Mar 12, 2017 9:15 pm
10102 getting Wrong Answer , please help me to solve it
I dont know why I am getting wrong answer. Please help me to find it.
- Attachments
-
- 10102.zip
- (639 Bytes) Downloaded 76 times
Last edited by back bencher on Wed Mar 15, 2017 7:09 am, edited 3 times in total.
Re: getting WA in 10102 , please help me to solve it
Your code gets compile error.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
-
- New poster
- Posts: 2
- Joined: Sun Mar 12, 2017 9:15 pm
Re: 10102 getting Wrong Answer , please help me to solve it
Dear Mr. lighted ,
some parts of the proper code is missing in the pasted code and I could not pest/edit it properly . Please check the attachment and you will find the proper code.Thanks for helping me.
some parts of the proper code is missing in the pasted code and I could not pest/edit it properly . Please check the attachment and you will find the proper code.Thanks for helping me.
Re: 10102 getting Wrong Answer , please help me to solve it
You initialized variable e by value 1, so your code always prints blank line before printing the answer.
Also you should print a newline after the answer.
Code: Select all
int xo[1000], yo[1000], xt[1000], yt[1000], maxi, N,e=1;
..
if (e)cout << endl;
cout << maxi;
e = 1;
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Re: 10102 getting Wrong Answer , please help me to solve it
If you assume that square field can have size 1000x1000, then you should also assume that number of cells with color 1 or color 3 can be at most 999999. But your arrays xo, yo, xt, yt have size only 1000. You should get RE in this case, but not always. Sometimes you get WA. I checked that size of 4000 is enough for this problem's input.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman