답안 #565178

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565178 2022-05-20T12:01:42 Z Dodo 질문 (CEOI14_question_grader) C++14
0 / 100
1914 ms 24116 KB
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pb push_back
using namespace std;


int encode (int n, int x, int y)
{
  int h;
  for(int i=0;i<=9;i++)
  {
    bool f,s;
    if((x&(1<<i)))f=1;
    else f=0;
    if((y&(1<<i)))s=1;
    else s=0;  
    if(x==1&&y==0)
    return i;
    if(x==0&&y==1)h=i;
  }
  return (10+h);
}
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pb push_back
using namespace std;


int decode (int n, int q, int h)
{
  if(h<10)
  {
    if((q&(1<<h)))
    return 1;
    else return 0;
  }
  else
  {
    h-=10;
    if((q&(1<<h)))
    return 0;
    else return 1;
  }
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:13:10: warning: variable 'f' set but not used [-Wunused-but-set-variable]
   13 |     bool f,s;
      |          ^
encoder.cpp:13:12: warning: variable 's' set but not used [-Wunused-but-set-variable]
   13 |     bool f,s;
      |            ^
encoder.cpp:22:15: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
   22 |   return (10+h);
      |               ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1914 ms 24024 KB wrong answer
2 Incorrect 1876 ms 24116 KB wrong answer