#๐Ÿ”’ Codeforces 469a

38 messages ยท Page 1 of 1 (latest)

tawny oracle
#

I am getting error on test 27

n = int(input())
if 0 <= n <= 100:
    s1 = input().split()
    s2 = input().split()
    s1.extend(s2)
    uniques = set(map(int, s1))
    sorted_uniques = sorted(uniques)
    if 0 in uniques:
        if sorted_uniques == list(range(0, n + 1)):
            print("I become the guy.")
        else:
            print("Oh, my keyboard!")
    else:
        if sorted_uniques == list(range(1, n + 1)):
            print("I become the guy.")
        else:
            print("Oh, my keyboard!")
else:
    print("Oh, my keyboard!")

Test 27 is :
3
1 2
2 2 3

modern boltBOT
#

@tawny oracle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hidden aspen
#

you are not parsing the input correctly

tawny oracle
#

??

#

parsing means

hidden aspen
#

your code assumes that little X is capable of passing levels 1 and 2
and little Y is capable of passing levels 2 and 3

#

i.e. together they can pass 1, 2, and 3

tawny oracle
#

yes

hidden aspen
#

this is not true - that isn't what the input means

tawny oracle
#

isnt that true

hidden aspen
#

that is not the intended interpretation of the input

#

i.e. you're pasing the input incorrectly

#

this is the part you're doing wrong

tawny oracle
#

3
1 2
2 2 3
Which means X can do 1,2 and Y can do 2, 3, ie together than can do 1,2,3

tawny oracle
#

Indices of the levels X can pass

#

but still

#

0, 1 level and 2, 3 level

#

i still dont understand what is wrong

hidden aspen
#

read carefully

#

X cannot pass level 1

#

3
1 2
2 2 3

X can pass level 2
Y can pass levels 2 and 3
together they can pass levels 2 and 3
they cannot pass level 1

tawny oracle
#

1 means the number of levels X can pass

hidden aspen
#

yes

tawny oracle
#

Not the fact that X can pass level 1

#

Oh thnxx @hidden aspen

#

should i close the ticket

#

?

hidden aspen
#

same for the third line for Y

hidden aspen
tawny oracle
#

Yeah

hidden aspen
tawny oracle
#

!close

modern boltBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.