Submission #819762

#TimeUsernameProblemLanguageResultExecution timeMemory
819762benjaminkleyn버섯 세기 (IOI20_mushrooms)C++17
Compilation error
0 ms0 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;

int count_mushrooms(int n)
{
    bool A = true;
    for (int i = 0; i + 1 < n; i++)
    {
        cnt += A;
        A ^= use_machine({i, i + 1});
    }
    return cnt + A;
}

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:10:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   10 |         cnt += A;
      |         ^~~
      |         int
mushrooms.cpp:13:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |     return cnt + A;
      |            ^~~
      |            int