QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#746894#9562. 欧伊昔SunsetGlow95Compile Error//C++113.3kb2024-11-14 15:48:512024-11-14 15:48:51

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 15:48:51]
  • 评测
  • [2024-11-14 15:48:51]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

const int RDX = 3;
const int MXR = 6;
const int MXN = 12;
const int MXL = 180000;
const int MXC = 3.7e8;
int N, table[RDX][RDX];
long long arr[MXC], brr[MXC];
int scnt[RDX], spv, R(1), pwr[MXN];
int coa[RDX][MXR], cob[RDX][MXR], coc[MXR][RDX], tmp[MXR];
bitset<MXC> legal;

int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  for (int i(0); i != RDX; ++i)
    for (int j(0); j != RDX; ++j)
      cin >> table[i][j], ++scnt[table[i][j]];
  spv = max_element(scnt, scnt + RDX) - scnt;
  coc[0][spv] = 1;
  for (int i(0); i != RDX; ++i) {
    coa[i][0] = cob[i][0] = 1;
    if (i == spv) continue;
    for (int j(0); j != RDX; ++j) scnt[j] = 0;
    for (int j(0); j != RDX; ++j)
      for (int k(0); k != RDX; ++k) scnt[k] += table[j][k] == i;
    bool typ(*max_element(scnt, scnt + RDX) <= 1);
    for (int j(0); j != RDX; ++j) {
      bool ex(false);
      for (int k(0); k != RDX; ++k) {
        if ((typ ? table[j][k] : table[k][j]) == i)
          (typ ? cob : coa)[k][R] = 1, ex = true;
      }
      if (ex) {
        (typ ? coa : cob)[j][R] = 1;
        coc[R][i] = 1;
        coc[R][spv] = -1;
        ++R;
      }
    }
  }
//for (int i(0); i != RDX; ++i) {
//  for (int j(0); j != R; ++j) cout << coa[i][j] << ' ';
//  cout << endl;
//}
//cout << endl;
//for (int i(0); i != RDX; ++i) {
//  for (int j(0); j != R; ++j) cout << cob[i][j] << ' ';
//  cout << endl;
//}
//cout << endl;
//for (int i(0); i != R; ++i) {
//  for (int j(0); j != RDX; ++j) cout << coc[i][j] << ' ';
//  cout << endl;
//}
//cout << endl;
  assert(R <= MXR);
   
  cin >> N;
  pwr[0] = 1;
  for (int i(1); i <= N; ++i) pwr[i] = pwr[i - 1] * R;
  for (int i(0); i != pwr[N]; ++i) {
    legal[i] = true;
    for (int j(0); j != N && legal[i]; ++j)
      if (i / pwr[j] % R >= RDX) legal[i] = false;
    if (!legal[i]) continue;
    cin >> arr[i];
  }
  for (int i(0); i != pwr[N]; ++i) {
    if (!legal[i]) continue;
    cin >> brr[i];
  }
  for (int i(0); i != N; ++i) {
    for (int j(0); j != pwr[N]; ++j) {
      if (j / pwr[i] % R) continue;
      for (int k(0); k != RDX; ++k)
        for (int l(0); l != R; ++l)
          tmp[l] += arr[j + k * pwr[i]] * coa[k][l];
      for (int k(0); k != R; ++k)
        arr[j + k * pwr[i]] = tmp[k], tmp[k] = 0;
      for (int k(0); k != RDX; ++k)
        for (int l(0); l != R; ++l)
          tmp[l] += brr[j + k * pwr[i]] * cob[k][l];
      for (int k(0); k != R; ++k)
        brr[j + k * pwr[i]] = tmp[k], tmp[k] = 0;
    }
  }
//for (int i(0); i != pwr[N]; ++i) cout << arr[i] << ' ';
//cout << endl;
//for (int i(0); i != pwr[N]; ++i) cout << brr[i] << ' ';
//cout << endl;
  for (int i(0); i != pwr[N]; ++i) arr[i] *= brr[i], brr[i] = 0;
  for (int i(0); i != N; ++i) {
//  for (int j(0); j != pwr[N]; ++j)
//    cout << arr[j] << ' ';
//  cout << endl;
    for (int j(0); j != pwr[N]; ++j) {
      if (j / pwr[i] % R) continue;
      for (int k(0); k != R; ++k)
        for (int l(0); l != RDX; ++l)
          tmp[l] += arr[j + k * pwr[i]] * coc[k][l];
      for (int k(0); k != R; ++k)
        arr[j + k * pwr[i]] = tmp[k], tmp[k] = 0;
    }
  }
  for (int i(0); i != pwr[N]; ++i) {
    if (!legal[i]) continue;
    cout << arr[i] << ' ';
  }
  cout << endl;
  return 0;
}

Details

/tmp/ccxZj3vh.o: in function `main':
answer.code:(.text.startup+0x1c): relocation truncated to fit: R_X86_64_PC32 against symbol `table' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0xea): relocation truncated to fit: R_X86_64_PC32 against symbol `table' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x125): relocation truncated to fit: R_X86_64_PC32 against symbol `table' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x19a): relocation truncated to fit: R_X86_64_PC32 against symbol `table' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x2a7): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x2ba): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x321): relocation truncated to fit: R_X86_64_PC32 against symbol `arr' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x3c0): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x46b): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x4c2): relocation truncated to fit: R_X86_64_PC32 against symbol `arr' defined in .bss section in /tmp/ccxZj3vh.o
answer.code:(.text.startup+0x51d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status