Submission #1330095

#TimeUsernameProblemLanguageResultExecution timeMemory
1330095gkos5678Question (Grader is different from the original contest) (CEOI14_question_grader)C++20
0 / 100
475 ms39756 KiB
#include <bits/stdc++.h>
using namespace std;

const int maxn = 930;

int br[maxn];
bool b = 0;

void build(){
  if (b) return;
  b = 1;
  int tr = 1;
  for (int i = 1; i < (1 << 12); i++){
    if (__builtin_popcount(i) != 6) continue;
    br[tr] = i;
    tr++;
  }
}

int encode(int n, int x, int y){
  build();
  for (int i = 0; i < 12; i++){
    if (((br[x] >> i) & 1) == 1 && ((br[y] >> i) & 1) == 0)
      return i + 1;
  }
}
#include <bits/stdc++.h>
using namespace std;

const int maxn = 930;

int br[maxn];
bool b = 0;

void build(){
  if (b) return;
  b = 1;
  int tr = 1;
  for (int i = 1; i < (1 << 12); i++){
    if (__builtin_popcount(i) != 6) continue;
    br[tr] = i;
    tr++;
  }
}

int decode(int n, int q, int h){
  build();
  h--;
  return (q >> h) & 1;
}

Compilation message (stderr)

# 1번째 컴파일 단계

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