#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 + 1);
}
}
}
#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);
for (int i = 0; i < 9; ++i) --value[i];
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]] % 2)) ans[i] = j, value[arr[j]] /= 2;
}
value[4] /= 2;
}
reverse(ans.begin(), ans.end());
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
192 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |