Submission #565209

# Submission time Handle Problem Language Result Execution time Memory
565209 2022-05-20T12:58:43 Z 1zaid1 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
1797 ms 24124 KB
#include<bits/stdc++.h>
using namespace std;
vector<int> v;
int encode (int n, int x, int y) {
    if (!v.size()) {
        for (int i = 0; i < (1<<12); i++) {
            int cnt = 0;
            for (int j = 0; j < 12; j++) if (i&(1<<j)) cnt++;
            if (cnt == 6) v.push_back(i);
        }
    }

    for (int k = 0; k < 12; k++) {
        if ((v[x]&(1<<k)) && !(v[y]&(1<<k))) return k+1;
    }
}
#include<bits/stdc++.h>
using namespace std;
vector<int> v;
int decode (int n, int q, int h) {
	if (!v.size()) {
        for (int i = 0; i < (1<<12); i++) {
            int cnt = 0;
            for (int j = 0; j < 12; j++) if (i&(1<<j)) cnt++;
            if (cnt == 6) v.push_back(i);
        }
    }

    return (q&(1<<(h-1))) != 0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 1732 ms 24124 KB wrong answer
2 Incorrect 1797 ms 23980 KB wrong answer