QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#523254 | #9164. Toy | Dan4Life# | Compile Error | / | / | C++23 | 1.6kb | 2024-08-17 23:58:03 | 2024-08-17 23:58:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a), end(a)
using vi = vector<int>;
using ll = long long;
const int mxN = (int)365;
string a[mxN];
int n, m, H, V;
int pref[mxN][mxN];
int hr, hc, vr, vc, dr, dc;
bitset<mxN> vis[mxN][mxN][mxN];
int getSum(int x1, int y1, int x2, int y2){
x1++, y1++, x2++, y2++;
return pref[x2][y2]-pref[x1-1][y2]-pref[x2][y1-1]+pref[x1-1][y1-1];
}
bool dfs(int hr, int hc, int vr, int vc){
if(hr<0 or hr>=n or hc<0 or hc>m-H) return 0;
if(vr<0 or vr>n-V or vc<0 or vc>=m) return 0;
if(vr+V-1<hr or vr>hr or vc<hc or vc>hc+H-1) return 0;
if(getSum(hr,hc,hr,hc+H-1)) return 0;
if(getSum(vr,vc,vr+V-1,vc)) return 0;
if(vis[hr][hc][vr][vc]) return 0;
vis[hr][hc][vr][vc]=1;
if(hr==dr and hc>dc-H and hc<=dc)
if(vc==dc and vr>dr-V and vr<=dr)
return 1;
if(dfs(hr-1,hc,vr,vc)) return 1;
if(dfs(hr+1,hc,vr,vc)) return 1;
if(dfs(hr,hc-1,vr,vc)) return 1;
if(dfs(hr,hc+1,vr,vc)) return 1;
if(dfs(hr,hc,vr-1,vc)) return 1;
if(dfs(hr,hc,vr+1,vc)) return 1;
if(dfs(hr,hc,vr,vc-1)) return 1;
if(dfs(hr,hc,vr,vc+1)) return 1;
return 0;
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n >> m >> H >> V >> hr >> hc >> vr >> vc;
swap(n,m), swap(hr,hc), swap(vr,vc);
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(a[i][j]=='*') dr=i, dc=j;
pref[i+1][j+1] = pref[i+1][j]+pref[i][j+1]-pref[i][j]+(a[i][j]=='X');
}
}
cout << (dfs(hr,hc,vr,vc)?"YES":"NO") << "\n";
}
详细
/tmp/ccAi0bcC.o: in function `__tcf_0': answer.code:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `a[abi:cxx11]' defined in .bss section in /tmp/ccAi0bcC.o /tmp/ccAi0bcC.o: in function `getSum(int, int, int, int)': answer.code:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `pref' defined in .bss section in /tmp/ccAi0bcC.o /tmp/ccAi0bcC.o: in function `dfs(int, int, int, int)': answer.code:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `pref' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x100): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x117): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against symbol `H' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x139): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x28a): relocation truncated to fit: R_X86_64_PC32 against symbol `dr' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x296): relocation truncated to fit: R_X86_64_PC32 against symbol `dc' defined in .bss section in /tmp/ccAi0bcC.o answer.code:(.text+0x37e): relocation truncated to fit: R_X86_64_PC32 against symbol `pref' defined in .bss section in /tmp/ccAi0bcC.o /tmp/ccAi0bcC.o: in function `main': answer.code:(.text.startup+0x1d): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status