제출 #166676

#제출 시각아이디문제언어결과실행 시간메모리
166676CaroLinda질문 (CEOI14_question_grader)C++14
100 / 100
1650 ms86056 KiB
#include <bits/stdc++.h>

#define lp(i,a,b) for(int i=a;i<b;i++)
#define ff first
#define ss second
#define pb push_back
#define ll long long
#define sz size()

using namespace std ;

int type , t , n , a , b ;
vector<int> v ;
bool ok = false ;

bool isOn(int m, int bit) { return ((1<<bit)&m) != 0 ; }

int encode(int n , int x , int y)
{

      if(!ok)
      {
        lp(i,1,(1<<12))
          if( __builtin_popcount(i) == 6 ) v.pb( i ) ;
        ok = true ;
      }

      lp(i,0,12)
        if( isOn(v[x-1],i) && !isOn(v[y-1], i) )
          return i+1 ;

}

#include <bits/stdc++.h>

#define lp(i,a,b) for(int i=a;i<b;i++)
#define ff first
#define ss second
#define pb push_back
#define ll long long
#define sz size()

using namespace std ;

vector<int> v ;
bool ok = false ;

bool isOn(int m, int bit) { return ((1<<bit)&m) != 0 ; }

bool decode(int n, int q, int h)
{

  if(!ok)
  {
    lp(i,1,(1<<12))
      if( __builtin_popcount(i) == 6 ) v.pb(i) ;
    ok = true ;
  }

  if( isOn(v[q-1],h-1) ) return true ;
  return false ;

}


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

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