제출 #1077453

#제출 시각아이디문제언어결과실행 시간메모리
1077453IgnutRectangles (IOI19_rect)C++17
컴파일 에러
0 ms0 KiB
// Ignut #include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9 + 123; const int N = 777; int min_h[N][N], max_h[N][N], min_v[N][N], max_v[N][N]; int minH[N][N][N], maxH[N][N][N], minV[N][N][N], maxV[N][N][N]; ll count_rectangles(vector<vector<int>> a) { int n = a.size(), m = a[0].size(); for (int i = 0; i < n; i ++) { for (int j = 0; j < m; j ++) { for (int ii = i; ii >= 0; ii --) { if (a[ii][j] > a[i][j]) break; min_v[i][j] = ii; } for (int ii = i; ii < n; ii ++) { if (a[ii][j] > a[i][j]) break; max_v[i][j] = ii; } for (int jj = j; jj >= 0; jj --) { if (a[i][jj] > a[i][j]) break; min_h[i][j] = jj; } for (int jj = j; jj < m; jj ++) { if (a[i][jj] > a[i][j]) break; max_h[i][j] = jj; } } } for (int j = 0; j < m; j ++) { for (int l = 0; l < n; l ++) { minH[j][l][l] = min_h[l][j]; maxH[j][l][l] = max_h[l][j]; minV[j][l][l] = min_v[l][j]; maxV[j][l][l] = max_v[l][j]; for (int r = l + 1; r < n; r ++) { minH[j][l][r] = min(minH[j][l][r - 1], min_h[r][j]); maxH[j][l][r] = max(maxH[j][l][r - 1], max_h[r][j]); minV[j][l][r] = min(minV[j][l][r - 1], min_v[r][j]); maxV[j][l][r] = max(maxV[j][l][r - 1], max_v[r][j]); } } } int res = 0; for (int u = 1; u < n - 1; u ++) { for (int d = u; d < n - 1; d ++) { for (int l = 1; l < m - 1; l ++) { int mnh = INF, mxh = -INF, mnv = INF, mxv = -INF; for (int r = l; r < m - 1; r ++) { mnh = min(mnh, minH[r][u][d]); mxh = max(mxh, maxH[r][u][d]); mnv = min(mnv, minV[r][u][d]); mxv = max(mxv, maxV[r][u][d]); if (mnh < l) break; if (mnv < u) break; if (mxv > d) break; res += (mxh == r); } } } } return res; }

컴파일 시 표준 에러 (stderr) 메시지

/usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(vterminate.o): in function `__gnu_cxx::__verbose_terminate_handler()':
(.text._ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x1e): relocation truncated to fit: R_X86_64_PC32 against `.bss._ZZN9__gnu_cxx27__verbose_terminate_handlerEvE11terminating'
(.text._ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x2b): relocation truncated to fit: R_X86_64_PC32 against `.bss._ZZN9__gnu_cxx27__verbose_terminate_handlerEvE11terminating'
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status