|
|
Edited by author 11.05.2021 19:41 My full search say that solution exist for n<=22292 There is solution for all n <= 10^5 though I still can not fast enough generate answer I've solved this problem using DP. Hint: The maximum sum of numbers for required sequence does not exceed 1568617. According to my calculations the largest such sequence can be 344001 for the constraints of the problem. answer for every n exists there is no possibility to output “impossible” My AC is 0.8 seconds, what is the idea for 0.01sec solutions? may be precalc? Yea, precalc actually does work. I had an ineffecient solution which spent ~30 seconds and ~65 MB, so then i tried to precalc, but my initial variant didn't pass because it was 204kb of code, and the limit of 64kb is suddenly back (i don't recall it from before...) In the end, i finally managed to compress it down to 63kb, due to the fact that out of 100k values, certain four numbers were present in 80%+ cases. java 0.156 | 45 000 КБ precalc) 100000 char's to 64K theare is some big number ang long path from it to [1,100] by dividing we can start moving from any place of this path This problem text add If there are several solutions output any one. For example n=3 1 2 2 k=3 sum=7 divisors number 2, k=2 sum=3 divisors number 2, k=1 sum=1 divisors number 1 У меня на первый тест (n=3) ответ 1 6 2. Вроде ответ правильный: (1+6)=7 (2 делителя: 1,7), (1+6+2)=9 (3 делителя: 1,3,9). А система выдаёт мне WA на етом тесте. Пожалуйста проверьте чекер :) Судя по примеру из задачи единица не считается делителем. Единица считается делителем У 1 + 6 должно быть 6 делителей, а не 2. |
|
|