|
|
Show all threads Hide all threads Show all messages Hide all messages | Hint | andreyDagger`~ | 1758. Bald Spot Revisited 2 | 7 Oct 2024 02:40 | 1 | Hint andreyDagger`~ 7 Oct 2024 02:40 For big tests (at least for n >= 44, but may be works for smaller n's) you can assume that firstt 4 numbers are 33 11 22 44 Edited by author 07.10.2024 02:40 | some test cases | reshke | 1758. Bald Spot Revisited 2 | 8 Jan 2020 19:42 | 1 | 50 39 1 33 11 22 44 4 28 14 42 21 7 35 5 25 50 10 20 40 8 32 16 48 24 12 36 18 6 30 15 45 9 27 3 39 13 26 2 34 17 21 17 1 16 8 4 20 10 5 15 3 9 18 6 12 2 14 7 21 | Request for helpful optimizations :-) | Artem Khyzha | 1758. Bald Spot Revisited 2 | 8 Oct 2018 13:06 | 3 | Hi guys, Could you please share any hint on how to optimize backtracking? I've been trying to solve this problem, but it seems that I haven't got the idea good enough: my precalculation has been working for an hour and there's still N>45 cases to solve. :-) Edited by author 10.07.2012 10:14 Try to set maximum border of the answer for every big N (for example, you can exclude all primes > N/2 etc.) After that think whether this maximum value can be achieved (as I remember, it is possible only if numbers with less count of divisors should apeear first in resulting sequence - it's not hard to prove). Such thinking allows you to set some numbers in the beginning of the sequence. Other 40-45 values can be found by backtrack. I use random search in this problem ,and it is fine. when dfs and we can't find a number to add it to the last, then we perform reverse,reverse [id,end], and continue dfs search.. then we can get correct answer very fast. then we can use if(times>1e4) return prunning. it can AC... it is a bit similar as LKH algo Edited by author 08.10.2018 13:09 | No subject | bygaga | 1758. Bald Spot Revisited 2 | 17 Nov 2017 13:19 | 1 | Edited by author 18.11.2017 07:25 | NP? | Vit Demidenko | 1758. Bald Spot Revisited 2 | 21 Mar 2010 03:57 | 3 | NP? Vit Demidenko 19 Mar 2010 22:07 Re: NP? Erop [USU] 19 Mar 2010 22:56 Re: NP? Roman Atangulov (Moscow SU) 21 Mar 2010 03:57 |
|
|
|