eambutu's blog

By eambutu, history, 10 years ago, In English

I am new to C++ so sorry if this question is dumb.

I am solving this problem: http://codeforces.me/contest/707/problem/A

And couldn't understand why this solution failed: http://codeforces.me/contest/707/submission/20019326 According to http://www.cplusplus.com/reference/cstdio/scanf/ , the %s tag should only take one character at a time, right? So reading into a 1 element character array should be fine. Switching variable x to a 2 element character array makes this work for some reason.

Also, the particular test case that fails works locally for me?

Full text and comments »

Tags c++, new
  • Vote: I like it
  • +3
  • Vote: I do not like it