I went through AC submissions and could not figure out why my solution fails.
Here is the link-
My WA code

I think there is some problem with taking string as input in queries, though it works fine on Codechef IDE. It would be great if someone can help me out.

I could not find an announcement for this contest, so if any of the organizers are reading this. IMO it was very stupid to have queries like x = c or y = c. Could have been simply done as type 1 or 2. It makes me feel as if it was deliberately done so that people are stuck in implementation (thinking about the solution was pretty easy). You can do that, you are the organizers but doing it so that the contest seems to have a nice difficulty curve is very stupid (I could not think of any other explaination to this).

You could have taken a char for axis, then a string, and then an int as input in each query.

Yes, I saw a lot of AC submissions do that. Although I have used cin.ignore() and getline in past without any trouble, so was pretty sure this would work. This works on Codechef IDE as well (you can check). I think there are spaces after the query in the test data but I am not too sure so didn’t write that in the post.

Technically, cin.ignore() and getline should work. So probably there’s some problem with test data. I’m not sure though.

1 Like

You’re right. It’s stupid to have x = c or y = c should be just like x c and y c


Yeah. That’s even better than type 1 or 2.

1 Like

The same problem occured with me. It cost me nearly 20 minutes. Then, I just used cin>>ws before taking string input. Question Formating was not Good.