ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211290 | #3802. 印章 | shiruiheng | 0 | 2490ms | 9972kb | C++11 | 1.1kb | 2024-08-10 12:29:31 | 2024-08-10 12:42:04 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
//using LL = __int128
#define pi pair<ll, ll>
#define N 4444
ll n, m, t, w, l, a[N], vis[111][111];
char c[N][N];
int main(){
scanf("%lld", &t);
while(t--){
scanf("%lld%lld%lld%lld", &w, &l, &n, &m);
a[0] = a[2] = n;
a[1] = a[3] = m;
for(ll i = 1 ; i <= n ; i++){
scanf("%s", c[i] + 1);
for(ll j = 1 ; j <= m ; j++)
if(c[i][j] == '#'){
a[0] = min(a[0], i - 1);
a[2] = min(a[2], n - i);
a[1] = min(a[1], j - 1);
a[3] = min(a[3], m - 1);
}
}
if(w <= 100 && l <= 100){
memset(vis, 0, sizeof vis);
for(int i = 1 ; i <= w - n ; i++)
for(int j = 1 ; j <= l - m ; j++)
for(int k = i ; k <= i + n ; k++)
for(int l = j ; l <= j + m ; l++)
vis[k][l] |= (c[k - i + 1][l - j + 1] == '#');
int ans = 0;
for(int i = 1 ; i <= w ; i++)
for(int j = 1 ; j <= l ; j++){
ans += vis[i][j];
//cerr << vis[i][j] << " \n"[j == l];
}
printf("%lld\n", ans);
continue;
}
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 38ms
memory: 1396kb
input:
2040 20 2 1 1 . 24 4 1 2 .# 24 3 5 2 .# #. .. .# ## 36 35 1 4 #..# 1 47 1 7 ##..#.# 4 9 2 7 ....... ...
output:
0 46 45 1221 0 0 165 895 0 28 0 1080 183 37 470 412 1098 1225 638 26 0 0 0 745 238 350 218 772 0 0 2...
result:
wrong answer 2nd words differ - expected: '72', found: '46'
Test #2:
score: 0
Wrong Answer
time: 71ms
memory: 1396kb
input:
3691 50 41 1 1 # 10 43 5 4 .... .... .... .... #... 3 1 2 1 . # 13 8 7 7 ####..# #.#.... .....## ..#...
output:
1960 195 0 76 66 1265 229 195 349 0 327 117 0 1030 0 4 1509 202 240 93 11 1265 0 1962 88 0 646 0 293...
result:
wrong answer 1st words differ - expected: '2050', found: '1960'
Test #3:
score: 0
Wrong Answer
time: 54ms
memory: 1496kb
input:
307 19 2 1 1 . 4 6 3 3 #.. ### #.# 1 11 1 8 .#####.. 16 7 10 5 .###. .###. ##... .#.#. .###. ...#. #...
output:
0 13 0 72 1628 39 192 0 322 72 22 426 581 118 246 0 0 209 419 260 224 271 541 287 468 84 104 486 19 ...
result:
wrong answer 2nd words differ - expected: '22', found: '13'
Test #4:
score: 0
Wrong Answer
time: 97ms
memory: 1492kb
input:
1151 2 2 1 2 ## 4 90 2 1 # . 4 3 2 2 .. .. 55 39 8 8 ....#... ......#. ...#..#. #......# ##.#...# .....
output:
0 178 0 2034 0 0 137 154 144 80 205 689 115 2964 36 543 27 91 176 580 208 18 5687 0 4154 185 257 116...
result:
wrong answer 1st words differ - expected: '4', found: '0'
Test #5:
score: 0
Wrong Answer
time: 344ms
memory: 1296kb
input:
142992 1 71640447 1 5 .#.#. 1 32 1 16 .##..#.#.##.#.## 1 128754717 1 13 #...#.#####.# 1 412912033 1 ...
output:
0 0 0 0 11 0 0 0 4 0 0 0 0 0 12 0 0 0 0 0 8 16 0 0 0 0 0 12 32 22 0 20 0 8 0 0 11 0 7 0 0 0 0 15 4 0...
result:
wrong answer 1st words differ - expected: '71640445', found: '0'
Test #6:
score: 0
Wrong Answer
time: 391ms
memory: 1296kb
input:
182430 1 462437573 1 2 .. 1 4 1 2 #. 2 2 1 1 # 1 117654376 1 6 .#..## 1 3 1 2 ## 1 4 1 4 ...# 1 2 1 ...
output:
0 1 0 0 0 0 0 0 1 0 0 0 8 0 0 0 6 0 0 0 0 0 0 0 1 0 0 5 17 2 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 5 9 6...
result:
wrong answer 2nd words differ - expected: '3', found: '1'
Test #7:
score: 0
Wrong Answer
time: 243ms
memory: 1296kb
input:
167051 949063550 696367111 1 9 #.####... 2 5 1 4 .... 18713003 154314157 1 6 ...... 144789507 649449...
output:
0 5 0 4 13 0 0 0 13 0 6 2 0 0 8 16 0 10 1 22 0 0 5 14 18 0 0 17 1 0 2 0 0 5 7 0 20 0 3 15 0 0 0 0 0 ...
result:
wrong answer 1st words differ - expected: '660896639621713400', found: '0'
Test #8:
score: 0
Wrong Answer
time: 249ms
memory: 1300kb
input:
182067 1 970907619 1 5 ..... 1 11 1 6 ..#.#. 588221550 1 1 1 # 1 16 1 8 ###.#.#. 1 13 1 9 .#...#... ...
output:
0 0 0 10 0 7 0 0 0 0 0 0 2 0 2 0 0 0 1 8 2 0 10 0 0 0 5 0 1 2 2 12 0 0 0 0 1 0 0 0 0 1 4 0 0 0 4 0 1...
result:
wrong answer 2nd words differ - expected: '8', found: '0'
Test #9:
score: 0
Wrong Answer
time: 9ms
memory: 1668kb
input:
49 518642469 504232726 3 66 ...#...............#............#................................. ........
output:
143 0 1855 7835 0 642 2428 4164 0
result:
wrong answer 1st words differ - expected: '261516504407313028', found: '143'
Test #10:
score: 0
Wrong Answer
time: 2ms
memory: 1700kb
input:
340 2 305388993 1 1 # 6 450728609 3 12 ............ ............ ..#......... 23 55 12 32 #.#...###....
output:
1186 0 230 423 4 65 287 91 1296 288 211 214 196 0 228 0 94 117 187 432 133 0 0 459 33 0 118 710 145 ...
result:
wrong answer 1st words differ - expected: '610777986', found: '1186'
Test #11:
score: 0
Wrong Answer
time: 28ms
memory: 3460kb
input:
9859 39 2 27 1 . . . . . . . . . . . . . . . . . . . . . . . # . . . 464574874 21687964 9 3 ... .#. ...
output:
12 52 0 6 102 324 190 63 0 105 14 8 0 106 0 16 11 16 0 18 0 10 100 0 90 0 0 13 222 0 110 5 0 18 0 55...
result:
wrong answer 1st words differ - expected: '26', found: '12'
Test #12:
score: 0
Wrong Answer
time: 55ms
memory: 3460kb
input:
5532 283728969 997644030 17 11 #.........# ........#.. ..#........ ........... #...#...#.. #.....#.....
output:
277 44 864 39 396 126 87 119 395 204 0 221 21 76 517 428 0 8 60 675 36 0 164 165 47 0 50 312 318 0 1...
result:
wrong answer 1st words differ - expected: '283060512060905035', found: '277'
Test #13:
score: 0
Wrong Answer
time: 31ms
memory: 4764kb
input:
419 61075512 474658573 4 11 ###...#.... .....#...## ###..###..# #.##.#..### 2 42 2 24 ...#.....####....
output:
0 1528 2413 0 5 477 0 14 1927 91 251 1469 0 311 0 1119 3347 0 334 0 283 0 983 979 862 273 383 1259 1...
result:
wrong answer 1st words differ - expected: '28990015371164372', found: '0'
Test #14:
score: 0
Wrong Answer
time: 11ms
memory: 5628kb
input:
116 658506323 6 2 6 ...... .....# 2 465009927 2 3 .#. ### 4 2 2 2 .. .. 3 109507599 2 4 ##.. ...# 47...
output:
0 17 0 0 0 0 3 0 19 0 22 8 0 0 7 0 6 0 0 0 16 8 4 0 12 0 0 21 28 0 17 0 4 6
result:
wrong answer 1st words differ - expected: '658506322', found: '0'
Test #15:
score: 0
Wrong Answer
time: 23ms
memory: 5320kb
input:
498 217 913116486 174 8 ...#...# ........ ........ #.##.... .......# #....... ........ ........ .......
output:
898 0 610 1175 608 413 967 23 458 12 150 6 0 776 445 468 278 1883 0 0 82 1207 280 0 60 0 10 518 2397...
result:
wrong answer 1st words differ - expected: '198146277411', found: '898'
Test #16:
score: 0
Wrong Answer
time: 60ms
memory: 5632kb
input:
1152 6 45902942 3 1000 ................................................................................
output:
2926 1178 4136 1985 2525 158 1297 742 606 0 3586 198 792 1040 81 2239 321 812 159 152 2297 0 0 2516 ...
result:
wrong answer 1st words differ - expected: '0', found: '2926'
Test #17:
score: 0
Wrong Answer
time: 314ms
memory: 5628kb
input:
3328 5 710527822 4 200 .............................................#..................................
output:
242 5760 3320 1157 253 6477 7000 2811 2601 6727 3941 6097 8822 4649 8654 7637 648 5302 0 7435 4060 3...
result:
wrong answer 1st words differ - expected: '3552638778', found: '242'
Test #18:
score: 0
Wrong Answer
time: 14ms
memory: 9972kb
input:
248 625825389 5 4 3 .## .#. #.. .## 27877511 627106582 3 2 .# #. .. 2317584 8 3 6 .#...# ..#... ...#...
output:
3 0 0 0 0 6 0 0 0 4 0 9 35 32 6 19 6 0 7 0 22 13 24 0 55 0 0 0 22 6 0 24 3 0 32 18 51 0 26 6 11 23 0...
result:
wrong answer 1st words differ - expected: '3129126942', found: '3'
Test #19:
score: 0
Wrong Answer
time: 387ms
memory: 1340kb
input:
165923 21611739 641706900 9 3 ..# ... #.. ... .#. ... .## ... ... 283865732 7 2 6 ####.. ....#. 3146...
output:
144 0 0 4 0 67 0 42 5 0 44 0 0 0 7 393 2 6 29 23 0 103 22 151 146 0 146 30 36 0 0 0 0 2 49 0 10 24 0...
result:
wrong answer 1st words differ - expected: '13868400753885292', found: '144'
Test #20:
score: 0
Wrong Answer
time: 69ms
memory: 9380kb
input:
566 579629199 26826670 3 2000 .........................................................................
output:
0 55 0 12
result:
wrong answer 1st words differ - expected: '15548651746488490', found: '0'