Re: WA on Problem #122
Posted: Thu Jun 27, 2013 9:31 pm
Damn I see it... my array won't handle 256 nodes if they're not perfectly arranged.
Scare thing is: to handle up to 256 ordered like that, my array needs 2²?? integers, that's fucked up...
I'll try bigger arrays, if they don't do it, I'll have to create a whole different algorithm =/.
Thanks.
EDIT: Changed it to suppor 65536 nodes, and also changed the printing loop, so it goes to NUM_NODES instead of 256, now it gives me PE, I think it means I'm returning the right answers (?), but in the wrong format.
Scare thing is: to handle up to 256 ordered like that, my array needs 2²?? integers, that's fucked up...
I'll try bigger arrays, if they don't do it, I'll have to create a whole different algorithm =/.
Thanks.
EDIT: Changed it to suppor 65536 nodes, and also changed the printing loop, so it goes to NUM_NODES instead of 256, now it gives me PE, I think it means I'm returning the right answers (?), but in the wrong format.