제출 #1262241

#제출 시각아이디문제언어결과실행 시간메모리
1262241miniob질문 (CEOI14_question_grader)C++20
0 / 100
495 ms39552 KiB
#include <bits/stdc++.h>
using namespace std;

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;
}
#include <bits/stdc++.h>
using namespace std;

vector<int> maska;

int decode(int n, int q, int h)
{
  if(maska.size() == 0)
   {
        for(int i = 0; i < 1 << 12; i++)
        {
            bitset<12> temp = i;
            if(temp.count() == 6)
            {
                maska.push_back(i);
            }
        }
    }
  return (maska[q] & (1 << (h - 1)));
}

컴파일 시 표준 에러 (stderr) 메시지

# 1번째 컴파일 단계

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...