Triangle Quest

Sort by

recency

|

1066 Discussions

|

  • + 0 comments

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

  • + 0 comments

    This works for me:

    for i in range(1,int(input())): 
        print(i*(10**i-1)//9)
    

    it is important delete all comments because the judge count every line

  • + 0 comments

    I didn't figure out the math but found a way of using the walruss operator:

    for i in range(1,int(input())):
        print( i * (prev := (1 if i == 1 else prev + pow(10, i - 1) ) ) )
    
  • + 0 comments

    The normal solution

    for i in range(1,int(input())): print(int(i * 10**i/9))
    
  • + 0 comments

    The Abnormal Solution

    for i in range(1,int(input())):
        print([1, 22, 333, 4444, 55555, 666666, 7777777, 88888888, 999999999][i-1])