Submission #37039

# Submission time Handle Problem Language Result Execution time Memory
37039 2017-12-20T15:24:56 Z aome Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
0 ms 27480 KB
#include <bits/stdc++.h>
using namespace std;

namespace Encoder {
	int mask[925], id;

	void label() {
		for (int i = 0; i < (1 << 12); ++i) {
			if (__builtin_popcount(i) != 6) continue;
			mask[++id] = i; 
		}
	}	
}

int encode(int N, int x, int y) {
	Encoder::label();
	for (int i = 0; i < 6; ++i) {
		bool X = Encoder::mask[x] >> i & 1;
		bool Y = Encoder::mask[y] >> i & 1;
		if (X != Y) return i + 6 * X;
	}
}
#include <bits/stdc++.h>
using namespace std;

namespace Decoder {
	int mask[925], id;

	void label() {
		for (int i = 0; i < (1 << 12); ++i) {
			if (__builtin_popcount(i) != 6) continue;
			mask[++id] = i; 
		}
	}	
}

int decode(int N, int q, int h) {
	Decoder::label();
	int pos = h % 6;
	bool X = h / 6;
	bool Q = Decoder::mask[q] >> pos & 1;
	return Q == X;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 27480 KB Output isn't correct
2 Incorrect 0 ms 27480 KB Output isn't correct