17
3 3
1 9
7 8
4 0
2 6
12 5
3 0
0 10
0 11
0 0
5 3
10 10
6 5
8 0
9 2
8 1
5 0
5 1
7
<2829398 bytes omitted>
系统信息
Killed: Segmentation fault
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#47180 | #1008. H. 开疆辟土,公司成立 | Runtime Error | 0 | 429 ms | 352 K | C++ 11 / 1.2 K | 计试001陈子鹏 | 2021-02-19 11:55:51 |
#include <iostream>
#include <cmath>
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const LL LINF = 0x3f3f3f3f3f3f3f3f;
bool hill[60][60], flwr[60][60];
int main() {
// freopen("input.in", "r", stdin);
int T;
scanf("%d", &T);
while (T--) {
int N, M, n, m;
char c;
scanf("%d%d", &N, &M);
for (int i = 0; i < N; i++) {
getchar();
for (int j = 0; j < M; j++) {
c = getchar();
if (c == '#')
hill[i][j] = 1;
if (c == '.')
hill[i][j] = 0;
}
}
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
getchar();
for (int j = 0; j < m; j++) {
c = getchar();
if (c == '#')
flwr[i][j] = 1;
if (c == '.')
flwr[i][j] = 0;
}
}
int a = (n - 1) / 2;
int b = (m - 1) / 2;
int ans = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
bool match = 1;
for (int u = -a; u <= a; u++) {
for (int v = -b; v <= b; v++) {
if (i + u >= 0 && i + u < N && j + v >= 0 && j + v < M) {
if (hill[i + u][j + v] && flwr[a + u][b + v]) {
match = 0;
goto BREAK;
}
}
}
}
BREAK:
ans += match;
}
}
printf("%d\n", ans);
}
return 0;
}
17
3 3
1 9
7 8
4 0
2 6
12 5
3 0
0 10
0 11
0 0
5 3
10 10
6 5
8 0
9 2
8 1
5 0
5 1
7
<2829398 bytes omitted>
系统信息
Killed: Segmentation fault
1
464 491
795 867
164 87
803 106
734 583
278 855
600 628
824 780
992 364
778 598
747 423
<1999727 bytes omitted>
系统信息
Killed: Segmentation fault
1
491 462
33 971
433 904
185 869
103 87
507 127
238 315
994 56
215 73
771 129
430 505
281
<1990927 bytes omitted>
系统信息
Killed: Segmentation fault