QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#663652 | #2672. Rectangles | Pioneer# | Compile Error | / | / | C++20 | 1.2kb | 2024-10-21 16:34:31 | 2024-10-21 16:34:32 |
Judging History
answer
#include "rect.h"
#include <bits/stdc++.h>
#define sz(s) ((int)s.size())
using namespace std;
const int MAX=710;
bool L[MAX][MAX][MAX],R[MAX][MAX][MAX];
int lef[MAX][MAX][MAX],rig[MAX][MAX][MAX];
long long count_rectangles(vector<vector<int>> a) {
int n=sz(a),m=sz(a[0]);
for(int i=0;i<n;i++){
for(int j=1;j<m-1;j++){
int mx=0;
for(int k=j;k<m-1;k++){
mx=max(mx,a[i][k]);
L[i][j][k]=(mx<min(a[i][j-1],a[i][k+1]));
}
}
}
for(int i=0;i<m;i++){
for(int j=1;j<n-1;j++){
int mx=0;
for(int k=j;k<n-1;k++){
mx=max(mx,a[k][i]);
R[i][j][k]=(mx<min(a[j-1][i],a[k+1][i]));
}
}
}
for(int j=1;j<m-1;j++){
for(int k=1;k<m-1;k++){
for(int i=1;i<n-1;i++){
if(L[i][j][k])lef[i][j][k]=lef[i-1][j][k];
else lef[i][j][k]=i;
}
}
}
for(int j=1;j<n-1;j++){
for(int k=1;k<n-1;k++){
for(int i=1;i<m-1;i++){
if(R[i][j][k])rig[i][j][k]=rig[i-1][j][k];
else rig[i][j][k]=i;
}
}
}
long long ans=0;
for(int lx=1;lx<n-1;lx++){
for(int rx=lx;rx<n-1;rx++){
for(int ly=1;ly<m-1;ly++){
for(int ry=ly;ry<m-1;ry++){
if(lef[rx][ly][ry]<lx&&rig[ry][lx][rx]<ly)ans++;
}
}
}
}
return ans;
}
詳細信息
implementer.cpp:22:34: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 22 | inline void freadn(register int *Q) { | ^ implementer.cpp:27:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister] 27 | inline void freadstr(register char *s) { | ^ implementer.cpp: In function ‘void readinp()’: implementer.cpp:19:14: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | fread(ptr, 0x1, inSize, stdin); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/ccgMAQod.o: in function `count_rectangles(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)': answer.code:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccgMAQod.o answer.code:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccgMAQod.o answer.code:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccgMAQod.o answer.code:(.text+0x2fc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccgMAQod.o collect2: error: ld returned 1 exit status