Submission #1245083

#TimeUsernameProblemLanguageResultExecution timeMemory
1245083repmann질문 (CEOI14_question_grader)C++20
100 / 100
733 ms39600 KiB
#include <bits/stdc++.h>
using namespace std;
static int B[925];
static bool flag = false;
inline void Pre()
{
  flag = true;
  for(int i = 1, j = 0; i < 4096; i++)
  {
    if(__builtin_popcount(i) != 6) continue;
    B[++j] = i;
  }
  return;
}
int encode(int n, int x, int y)
{
  if(!flag) Pre();
  for(int i = 0; i < 12; i++) if((B[x] & (1 << i)) && !(B[y] & (1 << i))) return i + 1;
}
#include <bits/stdc++.h>
using namespace std;
static int B[925];
static bool flag = false;
inline void Pre()
{
  flag = true;
  for(int i = 1, j = 0; i < 4096; i++)
  {
    if(__builtin_popcount(i) != 6) continue;
    B[++j] = i;
  }
  return;
}
int decode(int n, int q, int h)
{
  if(!flag) Pre();
  return bool(B[q] & (1 << (h - 1)));
}

Compilation message (stderr)

# 1번째 컴파일 단계

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