Stacy numbers

Sort by

recency

|

11 Discussions

|

  • + 0 comments

    Can someone please explain the problem setter's solution ?

  • + 0 comments

    I tried using suffix arrays, still too slow. Any hints?

  • + 0 comments

    [lenth,que]=input().split(" "); lenth=int(lenth); que=int(que); num=input(); ans=[]; for i in range(0,lenth): if int(num[i])==0: ans.append(int(num[i])); continue; for j in range(i+1,lenth+1): ans.append(int(num[i]+num[i+1:j])); ans.sort(); for i in range(que): print((ans[int(input())-1])%(10**9+7));

    Can you tell me what is wrong in the code? Test case 6 onwards this code is not working. It is failing due to time out.

  • + 0 comments

    Segmentations faults from test case 8 and 5,6,7 produce wrong answers . Possible deductions? Thanks.

  • + 0 comments

    The queries in test case 7 does not follow the constraint of 0<=qi<= 10^5.