ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1470. UFOs

WA2
Posted by RASTA 22 Apr 2009 19:06
why my progam get it???
I think its correct
z wrote many tests and all of them my program pass corectly
but in test 2 some strange...
I know that N in 2 test = 2
if it test from statement?
please give me some tests like test #2

here is my code(Fenvick Tree 3D)

//code deleted

some tests for WA2
3
1 1 1 0 2
1 0 0 0 3
1 0 0 1 3
2 1 1 0 2 2 2
3
answer 2
2
1 0 0 0 10
1 0 0 1 10000
1 0 1 0 50
1 0 1 1 1000
1 1 0 0 5
1 1 0 1 100
1 1 1 0 1
1 1 1 1 127
2 1 1 1 1 1 1
3
answer 127
this tests useful for fenvick tree solution!

Edited by author 22.04.2009 20:19
Re: WA2
Posted by Vitalii Arbuzov 17 Apr 2011 14:35
Thanks, second test helped a lot.
I've got AC using java in 1 sec with 3D Fenwick tree.
Solution can be improved in constant factor if search is done more effectively to avoid duplicate searches while subtracting and adding peaces.

Edited by author 17.04.2011 14:39
Re: WA2
Posted by kryi 31 Jul 2013 07:21
THX