#include "Anna.h"
#include <bits/stdc++.h>
namespace {
}
void Anna(int N, int K, std::vector<int> R, std::vector<int> C) {
int T[10];
T[0] = 1;
for (int i=1; i<7; i++) T[i] = T[i-1]*3;
for (int i=0; i<N; i++) for (int j=0; j<=N; j++){
int x=0;
for (int k=0; k<7; k++)x += (abs(i-R[k]) + abs(j-C[k]))%3 * T[k];
SetFlag(i, j, x);
}
}
#include "Bruno.h"
#include <vector>
namespace {
}
std::vector<int> Bruno(int K, std::vector<int> value) {
int T[10];
T[0] = 1;
for (int i=1; i<7; i++) T[i] = T[i-1]*3;
std::vector<int> ans;
for (int k=0; k<7; k++){
int p = value[4]/T[K]%3;
if (p==0){
if (value[5]/T[K]%3 == 2) ans.push_back(0);
if (value[3]/T[K]%3 == 2) ans.push_back(1);
if (value[7]/T[K]%3 == 2) ans.push_back(2);
if (value[1]/T[K]%3 == 2) ans.push_back(3);
}
if (p==1){
if (value[5]/T[K]%3 == 0) ans.push_back(0);
if (value[3]/T[K]%3 == 0) ans.push_back(1);
if (value[7]/T[K]%3 == 0) ans.push_back(2);
if (value[1]/T[K]%3 == 0) ans.push_back(3);
}
if (p==2){
if (value[5]/T[K]%3 == 1) ans.push_back(0);
if (value[3]/T[K]%3 == 1) ans.push_back(1);
if (value[7]/T[K]%3 == 1) ans.push_back(2);
if (value[1]/T[K]%3 == 1) ans.push_back(3);
}
if (ans.size() == k) ans.push_back(4);
}
return ans;
}
Compilation message
Bruno.cpp: In function 'std::vector<int> Bruno(int, std::vector<int>)':
Bruno.cpp:33:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
33 | if (ans.size() == k) ans.push_back(4);
| ~~~~~~~~~~~^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
192 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |