#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.pb(0);
if (value[3]/T[K]%3 == 2) ans.pb(1);
if (value[7]/T[K]%3 == 2) ans.pb(2);
if (value[1]/T[K]%3 == 2) ans.pb(3);
}
if (p==1){
if (value[5]/T[K]%3 == 0) ans.pb(0);
if (value[3]/T[K]%3 == 0) ans.pb(1);
if (value[7]/T[K]%3 == 0) ans.pb(2);
if (value[1]/T[K]%3 == 0) ans.pb(3);
}
if (p==2){
if (value[5]/T[K]%3 == 1) ans.pb(0);
if (value[3]/T[K]%3 == 1) ans.pb(1);
if (value[7]/T[K]%3 == 1) ans.pb(2);
if (value[1]/T[K]%3 == 1) ans.pb(3);
}
if (ans.size() == k) ans.pb(4);
}
return ans;
}
Compilation message
Bruno.cpp: In function 'std::vector<int> Bruno(int, std::vector<int>)':
Bruno.cpp:16:34: error: 'class std::vector<int>' has no member named 'pb'
16 | if (value[5]/T[K]%3 == 2) ans.pb(0);
| ^~
Bruno.cpp:17:34: error: 'class std::vector<int>' has no member named 'pb'
17 | if (value[3]/T[K]%3 == 2) ans.pb(1);
| ^~
Bruno.cpp:18:34: error: 'class std::vector<int>' has no member named 'pb'
18 | if (value[7]/T[K]%3 == 2) ans.pb(2);
| ^~
Bruno.cpp:19:34: error: 'class std::vector<int>' has no member named 'pb'
19 | if (value[1]/T[K]%3 == 2) ans.pb(3);
| ^~
Bruno.cpp:22:34: error: 'class std::vector<int>' has no member named 'pb'
22 | if (value[5]/T[K]%3 == 0) ans.pb(0);
| ^~
Bruno.cpp:23:34: error: 'class std::vector<int>' has no member named 'pb'
23 | if (value[3]/T[K]%3 == 0) ans.pb(1);
| ^~
Bruno.cpp:24:34: error: 'class std::vector<int>' has no member named 'pb'
24 | if (value[7]/T[K]%3 == 0) ans.pb(2);
| ^~
Bruno.cpp:25:34: error: 'class std::vector<int>' has no member named 'pb'
25 | if (value[1]/T[K]%3 == 0) ans.pb(3);
| ^~
Bruno.cpp:28:34: error: 'class std::vector<int>' has no member named 'pb'
28 | if (value[5]/T[K]%3 == 1) ans.pb(0);
| ^~
Bruno.cpp:29:34: error: 'class std::vector<int>' has no member named 'pb'
29 | if (value[3]/T[K]%3 == 1) ans.pb(1);
| ^~
Bruno.cpp:30:34: error: 'class std::vector<int>' has no member named 'pb'
30 | if (value[7]/T[K]%3 == 1) ans.pb(2);
| ^~
Bruno.cpp:31:34: error: 'class std::vector<int>' has no member named 'pb'
31 | if (value[1]/T[K]%3 == 1) ans.pb(3);
| ^~
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.pb(4);
| ~~~~~~~~~~~^~~~
Bruno.cpp:33:28: error: 'class std::vector<int>' has no member named 'pb'
33 | if (ans.size() == k) ans.pb(4);
| ^~