Submission #564495

# Submission time Handle Problem Language Result Execution time Memory
564495 2022-05-19T09:56:43 Z 1zaid1 Question (Grader is different from the original contest) (CEOI14_question_grader) C++17
Compilation error
0 ms 0 KB
#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";
}

Compilation message

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*