Interactive problem no more interactive

Правка en1, от practice_has, 2024-07-29 21:48:32

I was learning about interactive problems, and I solved a few problems such as:

1. Guess the Number

E. Interview

I also read this blog:

Interactive Problems: Guide for Participants

I learned that you have to use either endl or cout.flush() after "\n".

However, I tried not using cout.flush() at all and just used "\n" or endl.

Now, endl works because it includes the flush operation, but why is "\n" working without cout.flush()?

Are interactive problems only interactive during live contests?

Can someone please try solving the above two problems with "\n" and no cout.flush() and explain this behavior to me?

Here are my solutions with "\n" only:

1. Guess the Number

E. Interview

Теги interactive, interactive problem, interactive-problem, interactive problems

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский practice_has 2024-07-29 21:48:32 1017 Initial revision (published)