Submission #1262238

#TimeUsernameProblemLanguageResultExecution timeMemory
1262238miniobQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
Compilation error
0 ms0 KiB
vector<int> maska;

int encode(int n, int x, int y)
{
   if(maska.size() == 0)
   {
        for(int i = 0; i < 1 << 12; i++)
        {
            bitset<12> temp = i;
            if(temp.count() == 6)
            {
                maska.push_back(i);
            }
        }
    }
    for(int i = 0; i < 12; i++)
    {
        if((maska[x] & (1 << i)) > 0 && (maska[y] & (1 << i)) == 0)
        {
            //cout << i + 1 << endl;
            return i + 1;
        }
    }
    //cout << (maska[L] & (1 << 4)) << endl;
    //cout << maska[L] << " " << maska[P] << endl;
    //cout << "kon" << endl;
}
int decode(int n, int q, int h)
{
  return (maska[q] & (1 << (h - 1)));
}

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> maska;
      | ^~~~~~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:5:7: error: 'maska' was not declared in this scope
    5 |    if(maska.size() == 0)
      |       ^~~~~
encoder.cpp:9:13: error: 'bitset' was not declared in this scope
    9 |             bitset<12> temp = i;
      |             ^~~~~~
encoder.cpp:9:24: error: 'temp' was not declared in this scope
    9 |             bitset<12> temp = i;
      |                        ^~~~
encoder.cpp:18:13: error: 'maska' was not declared in this scope
   18 |         if((maska[x] & (1 << i)) > 0 && (maska[y] & (1 << i)) == 0)
      |             ^~~~~
encoder.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^