can you give me how to solve this problem? at first sight i think it can be solve by binary search, but since there could be possible maximum value, i'm going mad now.
-titid-
10647 - Optimal House Placement
Moderator: Board moderators
-
- Experienced poster
- Posts: 187
- Joined: Wed Dec 11, 2002 2:03 pm
- Location: Mount Papandayan, Garut
10647 - Optimal House Placement
Kalo mau kaya, buat apa sekolah?
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
I did that, and got correct results for the sample test cases, but still got WA. Is there some subtle thing that I've missed?
----------------
Update: ok, problem fixed. it's an int overflow mistake (what else is new)...
for whatever reason i stored the locations in an int array, while all other arrays are long long...
----------------
Update: ok, problem fixed. it's an int overflow mistake (what else is new)...
for whatever reason i stored the locations in an int array, while all other arrays are long long...