QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#691783 | #6341. The Last Battle | L_Hospital_# | Compile Error | / | / | C++17 | 3.8kb | 2024-10-31 12:59:23 | 2024-10-31 12:59:27 |
Judging History
Anna
#include "Anna.h"
#include <string>
#include<bits/stdc++.h>
# define int long long
# define rep(i, j, k) for (int i = j; i <= k; ++i)
using namespace std;
namespace {
int ccr[8][8] =
{{8336472289217LL, 5639512599365LL, 1871250638342LL, 3390137130908LL, 2530027537138LL, 6552170723915LL, 3251759294492LL, 929957346565LL},
{25314763727LL, 2970367782506LL, 5527222402534LL, 6577898502454LL, 7127768016113LL, 3901949843252LL, 5636633740636LL, 6616692904317LL},
{7681352977774LL, 2375001204905LL, 4929867600779LL, 4862126206117LL, 8167356340727LL, 3035625863743LL, 6559553015134LL, 1935233326026LL},
{5707803600531LL, 6199538358365LL, 734043647614LL, 2266684804241LL, 5137174576748LL, 3594890660019LL, 500607681489LL, 687940303769LL},
{511884368862LL, 1438606257434LL, 7514839894893LL, 8340731692060LL, 1780971378244LL, 3093181020765LL, 4116667040631LL, 2716731664696LL},
{1248747142959LL, 6235375997772LL, 6957362059910LL, 2323727036899LL, 2396710924683LL, 5070921600379LL, 205564431433LL, 6467932111513LL},
{3371733935LL, 961720284132LL, 2176602768852LL, 2820141481226LL, 233272507539LL, 1660705470819LL, 5377457925919LL, 7456736482082LL},
{3908948650271LL, 8665163992602LL, 6067865243888LL, 2568877634971LL, 8603921027952LL, 2818931663736LL, 4006172116513LL, 3714897363758LL}};
}
void Anna(int X, int Y, int N, std::string S) {
int now = 0;
rep(i, 0, N - 1) now = 2 * now + (S[i] == 'A');
rep(i, 0, 7) rep(j, 0, 7) if (i != X && j != Y) Paint(i, j, (__builtin_popcountll(ccr[i][j] & now) + (ccr[(i + 4) % 8][(j + 4) % 8] & 1)) % 2 == 0 ? 0 : 1);
}
Bruno
#include "Bruno.h"
#include <vector>
#include <string>
#include<bits/stdc++.h>
# define int long long
# define rep(i, j, k) for (int i = j; i <= k; ++i)
using namespace std;
namespace {
int ccr[8][8] =
{{8336472289217LL, 5639512599365LL, 1871250638342LL, 3390137130908LL, 2530027537138LL, 6552170723915LL, 3251759294492LL, 929957346565LL},
{25314763727LL, 2970367782506LL, 5527222402534LL, 6577898502454LL, 7127768016113LL, 3901949843252LL, 5636633740636LL, 6616692904317LL},
{7681352977774LL, 2375001204905LL, 4929867600779LL, 4862126206117LL, 8167356340727LL, 3035625863743LL, 6559553015134LL, 1935233326026LL},
{5707803600531LL, 6199538358365LL, 734043647614LL, 2266684804241LL, 5137174576748LL, 3594890660019LL, 500607681489LL, 687940303769LL},
{511884368862LL, 1438606257434LL, 7514839894893LL, 8340731692060LL, 1780971378244LL, 3093181020765LL, 4116667040631LL, 2716731664696LL},
{1248747142959LL, 6235375997772LL, 6957362059910LL, 2323727036899LL, 2396710924683LL, 5070921600379LL, 205564431433LL, 6467932111513LL},
{3371733935LL, 961720284132LL, 2176602768852LL, 2820141481226LL, 233272507539LL, 1660705470819LL, 5377457925919LL, 7456736482082LL},
{3908948650271LL, 8665163992602LL, 6067865243888LL, 2568877634971LL, 8603921027952LL, 2818931663736LL, 4006172116513LL, 3714897363758LL}};
int b[8][8];
int kkr[44];
}
std::string Bruno(int N, std::vector<std::vector<int>> T) {
rep(i, 0, 7) rep(j, 0, 7) b[i][j] = (T[i][j] ^ (ccr[(i + 4) % 8][(j + 4) % 8] & 1)), b[i][j] <<= 43, b[i][j] += ccr[i][j];
rep(i, 0, 7) rep(j, 0, 7)
{
memset(kkr, 0, sizeof(kkr));
bool ok = true;
rep(k, 0, 7) rep(l, 0, 7) if (k != i && j != l)
{
int now = b[i][j], pos = -1;
for (int p = N - 1; p >= 0; --p) if (now & (1LL << p))
{
if (kkr[p]) now ^= kkr[p]; else if (pos == -1) pos = p;
}
if (pos == -1 && now) {ok = false; k = 8; break;}
kkr[pos] = now;
rep(p, pos + 1, N - 1) if (kkr[p] & (1LL << pos)) kkr[p] ^= kkr[pos];
}
if (ok)
{
string s = "";
rep(i, 0, N - 1) s += ((kkr[i] >> 43) ? 'B' : 'A');
return s;
}
}
}
Details
/usr/bin/ld: /tmp/cckI12pY.o: in function `main': grader_Anna.cpp:(.text.startup+0x5c2): undefined reference to `Anna(int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' collect2: error: ld returned 1 exit status