ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2023. Donald is a postman

WA #6 ???
Posted by Александр 29 Aug 2018 12:35
n=int(input())
s1=['Alice','Ariel','Aurora','Phil','Peter','Olaf','Phoebus','Ralph','Robin' ]
s2=['Bambi','Belle', 'Bolt','Mulan','Mowgli','Mickey','Silver','Simba','Stitch']
s3=['Dumbo','Genie','Jiminy','Kuzko','Kida','Kenai','Tarzan','Tiana','Winnie']
a=s1
k=0
for i in range(n):
    s=input()
    if s in s1:
        if a==s1:
            continue
        elif a==s2:
            k+=1
            a=s1
        elif a==s3:
            k+=2
            a=s1
    elif s in s2:
        if a==s1:
            k+=1
            a=s2
        elif a==s2:
            continue
        elif a==s3:
            k+=1
            a=s2
    elif s in s3:
        if a==s1:
            k+=2
            a=s3
        elif a==s2:
            k+=1
            a=s2
        elif a==s3:
            continue
print(k)

Re: WA #6 ???
Posted by Pearl 2 Oct 2018 09:15
 elif s in s3:
        if a==s1:
            k+=2
            a=s3
        elif a==s2:
            k+=1
            a=s2

Wait, doesn't this letter is sent to block s3, why a = s2?