Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя operator_

Автор operator_, 2 месяца назад, По-английски

(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?

  • Проголосовать: нравится
  • +117
  • Проголосовать: не нравится

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

is it a feature?

»
2 месяца назад, # |
  Проголосовать: нравится +20 Проголосовать: не нравится

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.

  • »
    »
    2 месяца назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    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.

»
2 месяца назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

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

  • »
    »
    2 месяца назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

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

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

me too

»
2 месяца назад, # |
  Проголосовать: нравится +71 Проголосовать: не нравится

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

See 273354445 and 273354530

  • »
    »
    2 месяца назад, # ^ |
      Проголосовать: нравится +14 Проголосовать: не нравится

    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).

  • »
    »
    2 месяца назад, # ^ |
      Проголосовать: нравится +16 Проголосовать: не нравится

    Well, I think you're right. Thanks.