operator_'s blog

By operator_, 4 months ago, In English

(Please forgive my poor English, and this is also my first time blogging)As the title suggests, I am confused。

link:273185566(As a contestant) and 273270938(As a practice)

Can anyone answer my problem? Is it my problem or a bug? Or is it a features?

  • Vote: I like it
  • +117
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

is it a feature?

»
4 months ago, # |
  Vote: I like it +20 Vote: I do not like it

I heard rumors about the interactor acting up in this problem, and your output seems coherent here. So I guess it's not your fault.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I also spent an hour yesterday failing on test 1 despite my code working fine testing locally, only to learn that it was registering an extra "\n" as the line where I choose to be Alice or Bob in test case 2 (after like 20 testing submissions), so the interactor definitely had some issues.

»
4 months ago, # |
  Vote: I like it +4 Vote: I do not like it

I can't believe a same code which can pass the pretest WA on pretest again. Did you use anything random?

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    In fact, I don't. You can use the Compare button to find that the two codes are identical, so I'm confused.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

me too

»
4 months ago, # |
  Vote: I like it +71 Vote: I do not like it

Your rd() function seems to contain undefined behavior when used with cin

See 273354445 and 273354530

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    Yeah, I agree. Specifically, the code is mixing C I/O (getchar()) and C++ I/O (cin) after it calls ios::sync_with_stdio(false), which breaks buffering and results implementation-defined behavior (cppreference).

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    Well, I think you're right. Thanks.