Submission #319539

# Submission time Handle Problem Language Result Execution time Memory
319539 2020-11-05T13:36:36 Z ehdtjskaqhd Hotter Colder (IOI10_hottercolder) C++17
Compilation error
0 ms 0 KB
int HC(int N)
{
    int i;
    _v<int> rt(N + 1);
    for (int i = 1; i <= N; i++) rt[i] = Guess(i);
    for (int i = 2; i <= N; i++) if (rt[i] == -1) return i - 1;
    return rt[2] < 0 ? 1 : N;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:4:5: error: '_v' was not declared in this scope
    4 |     _v<int> rt(N + 1);
      |     ^~
hottercolder.cpp:4:8: error: expected primary-expression before 'int'
    4 |     _v<int> rt(N + 1);
      |        ^~~
hottercolder.cpp:5:34: error: 'rt' was not declared in this scope
    5 |     for (int i = 1; i <= N; i++) rt[i] = Guess(i);
      |                                  ^~
hottercolder.cpp:5:42: error: 'Guess' was not declared in this scope
    5 |     for (int i = 1; i <= N; i++) rt[i] = Guess(i);
      |                                          ^~~~~
hottercolder.cpp:6:38: error: 'rt' was not declared in this scope
    6 |     for (int i = 2; i <= N; i++) if (rt[i] == -1) return i - 1;
      |                                      ^~
hottercolder.cpp:7:12: error: 'rt' was not declared in this scope
    7 |     return rt[2] < 0 ? 1 : N;
      |            ^~
hottercolder.cpp:3:9: warning: unused variable 'i' [-Wunused-variable]
    3 |     int i;
      |         ^