1547B — Alphabetical Strings exit code 1 error

Правка en1, от DavidVictor2004, 2021-08-19 18:18:19

Hello all, I get the error exit code 1 for the following test. Can you help me understanding why? Thanks in advance! https://mirror.codeforces.com/contest/1547/submission/126455872

alfabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"] k=int(input()) while k > 0: y=1 stringul=input() if y==0: print("NO") else:
pozitia=stringul.find("a", 0, len(stringul)) if pozitia>-1: dreapta=pozitia stanga=pozitia else: y=0 for i in range(1, len(stringul)): pozitia=stringul.find(alfabet[i], 0, len(stringul)) dif_d=pozitia-dreapta dif_s=stanga-pozitia

if dif_d==1 and pozitia>-1: dreapta=pozitia

elif dif_s==1 and pozitia>-1: stanga=pozitia

else: y=0 i=len(stringul)

if y==1: print("YES") else: print("NO") k=k-1

Теги #runtime error

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский DavidVictor2004 2021-08-19 18:18:46 6 Tiny change: '"y","z"]\nk=int(input())\nwhile k ' -> '"y","z"]\n\nk=int(input())\n\nwhile k '
en1 Английский DavidVictor2004 2021-08-19 18:18:19 922 Initial revision (published)