Submission #421996

# Submission time Handle Problem Language Result Execution time Memory
421996 2021-06-09T14:35:45 Z shenxy Navigation 2 (JOI21_navigation2) C++17
0 / 100
0 ms 192 KB
#include "Anna.h"
#include <algorithm>
#include <vector>
using namespace std;
void Anna(int N, int K, vector<int> R, vector<int> C) {
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			int flag = (i + j) % 2;
			for (int k = 0; k < K; ++k) {
				if ((i + j) % 2) {
					if ((abs(R[k] - i) + abs(C[k] - j)) % 4 == 2 || (abs(R[k] - i) + abs(C[k] - j)) % 4 == 3) flag = flag * 2 + 1;
					else flag = flag * 2;
				} else if ((abs(R[k] - i) + abs(C[k] - j)) % 4 == 0 || (abs(R[k] - i) + abs(C[k] - j)) % 4 == 3) flag = flag * 2 + 1;
				else flag = flag * 2;
			}
			SetFlag(i, j, flag);
		}
	}
}
#include "Bruno.h"
#include <algorithm>
#include <vector>
using namespace std;
int arr[4] = {5, 3, 7, 1};
vector<int> Bruno(int K, vector<int> value) {
	vector<int> ans(K, 4);
	int ptr = value[4] / (1 << K);
	for (int i = 0; i < K; ++i) {
		for (int j = 0; j < 4; ++j) {
			if ((value[4] ^ ptr) == value[arr[j]]) ans[i] = j, value[arr[j]] /= 3;
		}
		value[4] /= 3;
	}
	reverse(ans.begin(), ans.end());
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 192 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -