fork download
  1. s=input()
  2. slist = list(s)
  3. n=1
  4. for i in range(97,123):
  5. alpha = chr(i)
  6. if n<26:
  7. if alpha in slist:
  8. where = slist.index(alpha)
  9. print(where,' ',end='')
  10. n+=1
  11. else:
  12. print('-1 ',end='')
  13. n+=1
  14. else:
  15. if alpha in slist:
  16. where = slist.index(alpha)
  17. print(where)
  18. else:
  19. print('-1')
  20.  
  21.  
Success #stdin #stdout 0.03s 9188KB
stdin
baekjoon
stdout
1  0  -1 -1 2  -1 -1 -1 -1 4  3  -1 -1 7  5  -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1