← Back to topics
Topic

Autoput

A
Asmirasmir
Hi , may i get the 2. test case in this task , or can someone help me with it , I get invalid memory reference or memory limit exceeded error.
D
Daniel93
Are you sure that your array is big enough?
A
Asmirasmir
You're a genius , for some odd reason , in the middle of the programm , i just reduced it to 50 k elements. >.>
f
fushar
Can anyone give hint on how to solve this problem?
A
Asmirasmir
just brute force it , the time and memory limit aren't bad , just read all the input and then try all the combinations.
p
picsel
Sort cities by X axis and try to put the road on every possible X. As you move forward on the X axis, remove the cities that come out of interval and add the new ones that come in (from the right).
f
fushar
Thanks.
That's a kind of line sweeping problem, right?
p
picsel
I guess it's something like that