Triangle Quest 2

Sort by

recency

|

1145 Discussions

|

  • + 0 comments

    Why isn't this code accepted :

    def work(l, last) :
        print(l,end=last)
    
    n = int(input())
    for i in range(n) :
        for j in range(i+1) :
            work(j+1,"")
        for k in range(i) :
            work(i-k,"")
        work("", "\n")
    
  • + 1 comment

    for i in range(1,int(input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also print ((((10**i)-1)//9)**2)

  • + 1 comment

    mod method:

    1. seperate the number into 2 parts: e.g. 12345678987654321 => 12345678900000000 + 87654321
    2. use % to adjust no. of digit to show
    3. combine 2 parts
    for i in range(int(input())):
        print(int((123456789 - 123456789 % 10 ** (8 - i)) * 10 ** (-8 + i * 2)) + 87654321 % 10 ** i)
    
  • + 0 comments

    for i in range(1,int(input())): #More than 2 lines will result in 0 score. Do not l print(((10*(1-10**(i-1))//-9)+1)*i)

  • + 0 comments
    1. num = b_num = 0
    2. for i in range(1, int(input()) + 1):num = num * 10 + i; b_num = (i - 1) * int(10 ** (i - 2)) + b_num; print(num * int(10 ** (i - 1)) + b_num)
    3. read effectively you find it easy to solve