Background:
Link: http://www.lclark.edu/~miller/langford.html
In short:
1. The sequence contains 2N integers, where N = 4x or 4x-1 .
2. Each of the integers between 1 and N appears twice in the sequence.
3. The two integers K in the sequence are separated by exactly K other numbers.
e.g. Solution for N = 3 is "3 1 2 1 3 2"
Now, I have to write a Pascal program to generate a single solution for any valid N(3 <= N <= 200). However, my program is extremely slow when N > 64 ... >_<
So, could anyone help me? Thx in advance!
Langford's Problem
Moderator: Board moderators
Langford's Problem
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org