제출 #564495

#제출 시각아이디문제언어결과실행 시간메모리
5644951zaid1질문 (CEOI14_question_grader)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int encode (int n, int x, int y) { for (int i = 1; i <= 20; i++) { if ((x%i)%2 == 0 && (y%i)%2 == 1) return i; } return 1; }
#include<bits/stdc++.h> using namespace std; int decode (int n, int q, int h) { if ((q%h)%2 == 0) return "YES"; else return "NO"; }

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

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:4:27: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    4 |  if ((q%h)%2 == 0) return "YES";
      |                           ^~~~~
      |                           |
      |                           const char*
decoder.cpp:5:14: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    5 |  else return "NO";
      |              ^~~~
      |              |
      |              const char*