Submission #927214

# Submission time Handle Problem Language Result Execution time Memory
927214 2024-02-14T12:17:26 Z vjudge1 Hotter Colder (IOI10_hottercolder) C++11
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

void HC(int n) {
    int l = 1, r = n, mid;
    int last = n;
    //Guess(n);
    while(false) {
        mid = (l + r) >> 1;
        int g = 0;//Guess(mid);
        if(g == 1) {
            r = mid;
        } else if(g == -1) {
            l = mid;
        } else {
            cout << (last - mid) / 2;
            return;
        }
        last = mid;
    }
    return n;
}

Compilation message

hottercolder.cpp: In function 'void HC(int)':
hottercolder.cpp:21:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   21 |     return n;
      |            ^