fork download
  1. cl, cr = [0 for i in range(28)], [0 for i in range(28)]
  2. for i in range(1000):
  3. cs = sum(int(d) - int('0') for d in str(i))
  4. if i >= 100: cl[cs] += 1
  5. cr[cs] += 1
  6. print(sum(cl[i] * cr[i] for i in range(28)))
  7.  
Success #stdin #stdout 0.02s 9936KB
stdin
Standard input is empty
stdout
50412