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

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

I was confident I had solved yesterday's C question correctly. But could not clear the idleness verdict even after flushing the output. What can be the reasons my flush didn't work as expected ?? I tried all ways fflush(stdout), cout.flush() and even just endl. None of them could clear pretest 2. All gave me idleness issues.

void response(int x, int y) {
    cout << "! " << x << " " << y << endl;
    cout.flush();
}
 
int query(int x, int y) {
    cout << "? " << x << " " << y << endl;
    cout.flush();
    int res = ini();
    return res;
}

Complete submission : 249149514

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

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

I think the issue is that you're missing some condition in your nested if-else, because of which you're not printing a guess for a particular test case and hence the idleness limit is exceeded.

Because if it was an input-output issue then you wouldn't have passed test 1.