QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#569139 | #9224. Express Eviction | ucup-team3519 | AC ✓ | 10ms | 8020kb | C++20 | 3.5kb | 2024-09-16 20:44:39 | 2024-09-16 20:44:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define V vector
#define all0(x) (x).begin(),(x).end()
#define all1(x) (x).begin()+1,(x).end()
#define pb push_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define cin std::cin
#define cout std::cout
typedef long long LL;
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
//const int MN = 2e5 + 20;
const int INF = 2e9 + 1000;//INF
const LL INFLL = 8e18 + 1000;//INF long long
mt19937 mrand(chrono::steady_clock().now().time_since_epoch().count());
//模板区域~~~~~~~
template<class T> //流的类型
struct flow{
static const int N = 2e5 + 1000;
static const int E = 2e5 + 1000;
int s, t, vtot;
int h[N], etot;
int dis[N], cur[N];
struct edge{
int v,nxt;
T f;
}e[E * 2];
void add(int u, int v, T f){
e[etot] = {v, h[u], f};
h[u] = etot++;
e[etot] = {u, h[v], 0};
h[v] = etot++;
}
bool bfs(){
for(int i = 1; i <= vtot; i++){
dis[i] = 0;
cur[i] = h[i];
}
queue<int> que;
que.push(s);
dis[s] = 1;
while(que.size()){
int u = que.front();
que.pop();
for(int i = h[u]; ~i; i = e[i].nxt){
if(e[i].f && !dis[e[i].v]){
int v = e[i].v;
dis[v] = dis[u] + 1;
if(v == t) return 1;
que.push(v);
}
}
}
return 0;
}
T dfs(int u, T m){
if(u == t) return m;
LL flow = 0;
for(int i = cur[u]; ~i; cur[u] = i = e[i].nxt)
if(e[i].f && dis[e[i].v] == dis[u] + 1){
T f = dfs(e[i].v, min(m,e[i].f));
e[i].f -= f;
e[i ^ 1].f += f;
m -= f;
flow += f;
if(!m) break;
}
if(!flow) dis[u] = -1;
return flow;
}
T dinic(){
T flow = 0;
while(bfs()) flow += dfs(s,numeric_limits<T>::max());
return flow;
}
void ini(int ss, int tt, int vt){
s = ss;
t = tt;
vtot = vt;
etot = 0;
for(int i = 1; i <= vtot; i++) h[i] = -1;
}
};
flow<int> f;
//模板结束~~~~~~~
void solve() {
int n; cin >> n;
int m; cin >> m;
V<string> vs(n + 1);
for(int i =1 ; i <= n; i++) cin >> vs[i], vs[i] = " " + vs[i];
int s = 3 * (n * m) + 1, t = s + 1;
f.ini(s, t, t);
auto id = [&](int x, int y, int type) -> int {
if(y <= 0 || x >= n + 1) return s;
if(y >= m + 1 || x <= 0) return t;
return x + (y - 1) * n + type * n * m;
};
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= m; j++) {
if(vs[i][j] == '#') {
for(int dx = -1; dx <= 1; dx++) {
for(int dy = -1; dy <= 1; dy++) {
if(dx == 0 && dy == 0) continue;
f.add(id(i, j, 1), id(i + dx, j + dy, 0), INF);
f.add(id(i + dx, j + dy, 0), id(i, j, 2), INF);
}
}
f.add(id(i, j, 0), id(i, j, 1), 1);
f.add(id(i, j, 2), id(i, j, 0), 1);
}
}
}
cout << f.dinic() << endl;
}
int32_t main() {
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int t=1;
//cin >> t;
while (t--)
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5840kb
input:
4 6 .##... .#.... ##.... ....#.
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 5704kb
input:
20 30 ...########################### #..########################### ...########################### ...########################### .############################# ...########################### ...########################### #..########################### ...########################### ..#...............
output:
11
result:
ok 1 number(s): "11"
Test #3:
score: 0
Accepted
time: 2ms
memory: 5792kb
input:
35 35 ....###########...#########........ ##..#######################..#####. ....#######################..#####. ...#.....##################..#####. .##......##################.....##. .##..##..#############.....#....##. .....##..#############......##..##. ....#....#############..##..##..##. ####.....
output:
16
result:
ok 1 number(s): "16"
Test #4:
score: 0
Accepted
time: 0ms
memory: 7972kb
input:
30 20 .#..........##...... ..#......#..##...... .......#..........#. ..#......#..##...... .....#......#....... .#.........#........ ......#...#......... ..#..##..#...#...... ......#.......#..... ..#....#............ ........#..#.#...... ....##..#........... .........#.#.......# ........##.......... ...
output:
5
result:
ok 1 number(s): "5"
Test #5:
score: 0
Accepted
time: 3ms
memory: 5688kb
input:
50 45 ...##................##...................#.. ...#......#.#..........#.#.....####....#....# ....#.....#..............#..#..##......##..#. .....#......######........#.............#.... ......##...#...##...##.......#....#..#...##.. ...#..##.....##...###.............#..##.....# ...#......########...
output:
24
result:
ok 1 number(s): "24"
Test #6:
score: 0
Accepted
time: 0ms
memory: 5928kb
input:
50 45 ...#...................#.####................ ...........................#......###.#..##.. ..#.#........##.##....#....#................. .....#.....#.##.#.#.........#................ ...........#.#.#.#.##....#.#.......##.#..#... ...#......#...#####......#...##.##........#.. ............####.....
output:
23
result:
ok 1 number(s): "23"
Test #7:
score: 0
Accepted
time: 0ms
memory: 5744kb
input:
50 50 ##................................................ #################################################. ####.............................................. ####.............................................. ####..############################################ ####......................................
output:
7
result:
ok 1 number(s): "7"
Test #8:
score: 0
Accepted
time: 10ms
memory: 7832kb
input:
50 50 #.##.##..###...#######.##..#####.#...######.###### .####.##.##.#############.#.#.###.##.###.#.#.###.# ...####.##########.###.####.#.####.#############.. #.#..########.#.#####.#..#.##....##########.#.#### ###.##.####.###.#######..##.#####...##.#######..#. #####.########..########..#######.##.#....
output:
72
result:
ok 1 number(s): "72"
Test #9:
score: 0
Accepted
time: 1ms
memory: 5812kb
input:
50 50 .................................................. .................................................. .................................................. .................................................. .................................................. ..........................................
output:
0
result:
ok 1 number(s): "0"
Test #10:
score: 0
Accepted
time: 0ms
memory: 7912kb
input:
43 50 ...........####################################### #########...###################################### #########...####....############################## ##########..#........############################# ##########...........############################# #####.....#....####...##########......#...
output:
5
result:
ok 1 number(s): "5"
Test #11:
score: 0
Accepted
time: 0ms
memory: 5676kb
input:
8 13 .##.......... .##..#######. .##......#.#. ...#.....#.#. ....###..#.#. ##..###..#.#. ##.......#.#. ##.......#.#.
output:
1
result:
ok 1 number(s): "1"
Test #12:
score: 0
Accepted
time: 0ms
memory: 5792kb
input:
36 25 ##....................... ......................... #........................ ......................... ......................... ......................... ......................... ......................... ......................... ..................#.....# ..............#.#..#..#.. ...........
output:
7
result:
ok 1 number(s): "7"
Test #13:
score: 0
Accepted
time: 0ms
memory: 5644kb
input:
30 20 ...............#.... .#......#...#.....#. .#...##..####..#..#. ...............#..#. .....##.##.##....... ....#........#...... ..#.#.........#..... .#.##......#..#..##. #.#........#........ ##.#.##.....#....... .......#.....####### ##......#.#......##. ....##..#....#..##.# #...##..###..#...#.# ...
output:
6
result:
ok 1 number(s): "6"
Test #14:
score: 0
Accepted
time: 1ms
memory: 5688kb
input:
1 50 ....#.#####.########.#.#...##..#..#..##.....##.#..
output:
25
result:
ok 1 number(s): "25"
Test #15:
score: 0
Accepted
time: 7ms
memory: 7732kb
input:
50 50 ....############################################## ##..############################################## ....############################################## ...#....########################################## ..#.....########################################## .....#..###############################...
output:
22
result:
ok 1 number(s): "22"
Test #16:
score: 0
Accepted
time: 1ms
memory: 5760kb
input:
40 50 ...###############################................ .....#############################...############. ##....############################..#############. ###...############################...############. ####...###########################...############. #####...###########################..##...
output:
9
result:
ok 1 number(s): "9"
Test #17:
score: 0
Accepted
time: 1ms
memory: 5676kb
input:
8 13 .##.......... .##..#######. .##......###. ...#.....###. ....###..###. ##..###..###. ##.......###. ##.......###.
output:
1
result:
ok 1 number(s): "1"
Test #18:
score: 0
Accepted
time: 1ms
memory: 5672kb
input:
10 15 ...#........... ............... .#............. ...#........... ......#.#.....# .....#.....#### ....#.....#.... ...#...#.#..... ...#........#.. ...##.......#..
output:
2
result:
ok 1 number(s): "2"
Test #19:
score: 0
Accepted
time: 1ms
memory: 5700kb
input:
50 3 .## .#. #.. ..# ..# #.. ### ... ### ... ### ##. ... ... ##. .#. #.. ... ##. ... #.. ..# ..# ..# ##. ..# ..# #.. .## ... ##. ..# ... ... ### ..# .#. #.# #.. .#. ### ### #.# #.# ### ..# ### ... #.. ..#
output:
21
result:
ok 1 number(s): "21"
Test #20:
score: 0
Accepted
time: 4ms
memory: 7728kb
input:
50 50 .##...#..########################......########### #######..########################......########### #######..########################..##..########### #######..########################..##.........#### ####.....########################....#.........### ####....#.....##############.....#....#...
output:
29
result:
ok 1 number(s): "29"
Test #21:
score: 0
Accepted
time: 1ms
memory: 5900kb
input:
20 30 .....####......####........... ###..####..##..####..########. ###..####..##.....#..####..##. .....####....#....#..####..##. ....#....#....##.....##....... .###......##..##.....##....... .###..##..##..#########..##### .###..##..##..######.....##### ......##..##..######....#..... .....#....##..#...
output:
6
result:
ok 1 number(s): "6"
Test #22:
score: 0
Accepted
time: 0ms
memory: 5700kb
input:
25 36 ....###########....................# ##..#############...##########....## ....#############....########....### ...#.....#########...########...#### .##......##########....######..##### .##..##..##########.....#####..##### .....##..###########......###....... ....#....#############.......#........
output:
11
result:
ok 1 number(s): "11"
Test #23:
score: 0
Accepted
time: 1ms
memory: 5776kb
input:
50 50 ##................................................ #################################################. ####.............................................. ####.............................................. ####..############################################ ####......................................
output:
3
result:
ok 1 number(s): "3"
Test #24:
score: 0
Accepted
time: 8ms
memory: 7760kb
input:
50 50 ################################################## ################################################## ################################################## ################################################## ################################################## #######################################...
output:
99
result:
ok 1 number(s): "99"
Test #25:
score: 0
Accepted
time: 1ms
memory: 5972kb
input:
50 50 ................#.....#....#..........#..#..#....# #...........#........#..................#......... ....#......#....#..........#...................... #...............#.##.....#..#...#.#.#.#...#...#... .........#..#..............#...........#....#..... .......##.....#.........##....##..........
output:
0
result:
ok 1 number(s): "0"
Test #26:
score: 0
Accepted
time: 1ms
memory: 5620kb
input:
4 2 #. #. ## ..
output:
2
result:
ok 1 number(s): "2"
Test #27:
score: 0
Accepted
time: 0ms
memory: 5684kb
input:
1 1 .
output:
0
result:
ok 1 number(s): "0"
Test #28:
score: 0
Accepted
time: 0ms
memory: 5872kb
input:
4 6 .##... .#.... ##.... ....#.
output:
1
result:
ok 1 number(s): "1"
Test #29:
score: 0
Accepted
time: 1ms
memory: 5844kb
input:
4 3 .## ### .#. #.#
output:
3
result:
ok 1 number(s): "3"
Test #30:
score: 0
Accepted
time: 0ms
memory: 5620kb
input:
2 2 .# #.
output:
1
result:
ok 1 number(s): "1"
Test #31:
score: 0
Accepted
time: 2ms
memory: 7704kb
input:
25 36 ....################################ ##..################################ ....################################ ...#.....########################### .##......########################### .##..##..########################### .....##..########################### ....#....##########################...
output:
10
result:
ok 1 number(s): "10"
Test #32:
score: 0
Accepted
time: 5ms
memory: 7756kb
input:
50 50 ..#.#####....##...#..##.##....###....##.##.####.#. ..#######...#..###..#....#..##..###.....##...#...# ..#.#..#........#..####..#######.##...##.###..#.#. ###.....#......#..#.##.#....##..#.#............... ....##.##...#.#....#.#####.......#..#.....##...##. ###..#..##..#..#.#...##..........#........
output:
29
result:
ok 1 number(s): "29"
Test #33:
score: 0
Accepted
time: 1ms
memory: 5644kb
input:
6 10 .##.....## .##..#.... .##...#... ...#...##. ....#..##. ##.....##.
output:
2
result:
ok 1 number(s): "2"
Test #34:
score: 0
Accepted
time: 1ms
memory: 5680kb
input:
18 13 #..#..#.#..#. ...#....##.## ###...#.#.... .###...#.#.#. ...###..#.#.. ..#.....####. ##...####.... ..####.#..... #####...#.... ..##.##....## .#....#..##.# #..#......### #.#.##...###. #..##.......# #.####..#...# #.#.#...#...# ...#.#.##.### ...#.#.###..#
output:
11
result:
ok 1 number(s): "11"
Test #35:
score: 0
Accepted
time: 3ms
memory: 5932kb
input:
45 50 ....#######...##################.......###........ ##..#######....#################..##...###..#####. ....########...#################..##..####..#####. ...#.....###############.....###..##........#####. .##......###############.....###....#......#....#. .##..##..###############..#.....#....##...
output:
24
result:
ok 1 number(s): "24"
Test #36:
score: 0
Accepted
time: 1ms
memory: 5676kb
input:
5 10 ..#.#.#.#. .#.####.#. ##...#...# ######.##. .###.###.#
output:
6
result:
ok 1 number(s): "6"
Test #37:
score: 0
Accepted
time: 4ms
memory: 5712kb
input:
45 50 ....#################...############......######## ##..#################...########............###### ....##################...###.........####....##### ...#.....############.....#......#########...##### .##......############..#......#############...#### .##..##..############...#..#..#########...
output:
24
result:
ok 1 number(s): "24"
Test #38:
score: 0
Accepted
time: 1ms
memory: 5588kb
input:
1 1 #
output:
1
result:
ok 1 number(s): "1"
Test #39:
score: 0
Accepted
time: 1ms
memory: 5920kb
input:
25 36 .....#################.............. ###..#################...##########. .....#################...##########. ....#......###########....#########. .###.......############........####. .###..###..#############........###. .###..###..##################...###. ......###..###################..###...
output:
8
result:
ok 1 number(s): "8"
Test #40:
score: 0
Accepted
time: 5ms
memory: 7824kb
input:
50 50 .#..#..##..#......####...##....##.##...###....#..# .....#.#..###....##..#####..##..###.##.##.#.#.#.## #.#..##.#..#....##..#..##...#.##..#########.#.##.# ###...#.#....##..##.###....#.##..#...####.#.####.# .#.#.#.#...#..#####.#.##..##.#.##..##.#....#####.. #.##.#.#####....###.###.......##..###.....
output:
43
result:
ok 1 number(s): "43"
Test #41:
score: 0
Accepted
time: 1ms
memory: 5568kb
input:
6 10 .#.....#.. ....#..##. ...#...### ###...#... .##..#.... ..#.....#.
output:
2
result:
ok 1 number(s): "2"
Test #42:
score: 0
Accepted
time: 0ms
memory: 7764kb
input:
43 50 ##...#............################################ ######.....................####################### ###############..................################# #########################...........############## ###############################.......############ ######....................#######.........
output:
6
result:
ok 1 number(s): "6"
Test #43:
score: 0
Accepted
time: 0ms
memory: 5908kb
input:
15 10 ....##.... ##..##..#. ##..##..#. ....##..#. ...#....#. .##.....#. .##..####. .##..####. .....####. ....#..... ####...... ####..#### ......#### ......#### ..........
output:
2
result:
ok 1 number(s): "2"
Test #44:
score: 0
Accepted
time: 2ms
memory: 5676kb
input:
30 30 ##...#####.....#.##..#.##.#### #.#...#.#.####.##.###..#.#..#. ##..#..#.#....#####..#..#..... .##.#.##..#...####..#..#..##.. #.####..##...##.#....#.###...# #.###.####.#....###.#...#.#... .#..#.#.##..#...##.......##.#. ...#.#.##.#.#.#.#.#####.#.#### ##.#....###..#.#..###....###.# .##.##.#..###.#...
output:
27
result:
ok 1 number(s): "27"
Test #45:
score: 0
Accepted
time: 3ms
memory: 5740kb
input:
50 50 ....#.#..#.......#..#...##......#.#....#....#...#. ...#..##....#.#.....##.#........###.....#......... .......#.#......#.#.....##.....#.#..........#.#... .#.......#...##.#......#.....#.#...##.##.....#.#.# ....#..#..............#.#..#....#..#......#.....#. ...#...#...#......##.....##.#.....#..#....
output:
22
result:
ok 1 number(s): "22"
Test #46:
score: 0
Accepted
time: 1ms
memory: 5724kb
input:
35 35 ##................................. .#.........................#.#..... ........#.................#....#... ...#....#...........#.............. ...#.##...#............##......#... ###.#.##..#........#..#........#... #.......##..##.#.#...##.#..##...... #.#.#.#.#..##......#.#..#....#..... ###.##...
output:
16
result:
ok 1 number(s): "16"
Test #47:
score: 0
Accepted
time: 1ms
memory: 5960kb
input:
36 25 .......................#. #.#....#.#.##.#........#. ..#.##.#.##.#..##..#.##.. ####............#..#..... #...##.......##.#..#..... ##.##.#..#...#.#......... .#.####..##......#.....#. ...#.##....#..........#.. ##.....#....#..#..##.#... .#......##...#.....#...#. .#...#...#...###.......#. .#..##.....
output:
11
result:
ok 1 number(s): "11"
Test #48:
score: 0
Accepted
time: 4ms
memory: 7920kb
input:
50 50 ####.#.#.###.#.##.....#.##.#.##.............#..#.. #....#.#..#..##.......#...........##.#......#..... ##.......##.##........#...#.###..##...##....#...## ........##.#.##.......#.#..##.#................... ..#.#......#.#.#...#..#........#......#..#........ ##.......##..###......##.#......#....##...
output:
27
result:
ok 1 number(s): "27"
Test #49:
score: 0
Accepted
time: 2ms
memory: 5680kb
input:
20 49 #..#.###.#...##..######..#..#.#.##.##....#..#.#.# #...##..####.##.####.#.#.#.##.#.#..#.######....#. .##.###.#.#..#####.####.#.##..###.##.####.##.#.## ...#.###....#######.#.#..#.....##.##..##.#...#.## .##..##.###.#.....###.....#.#..##.######...###### ##.#.##.#..##......###..#..#..##.##...##.###...
output:
32
result:
ok 1 number(s): "32"
Test #50:
score: 0
Accepted
time: 1ms
memory: 5804kb
input:
50 50 ###.....#.....#................................... .##..#..#..#..#..################################. .....#.....#.....################################. .....#.....#.....###.............................. ####################.............................. ####################..#################...
output:
3
result:
ok 1 number(s): "3"
Test #51:
score: 0
Accepted
time: 1ms
memory: 5648kb
input:
25 36 .......############################# #####..############################# #####..############################# .......############################# ......#.......###################### .#####........###################### .#####..####..###################### .#####..####..#####################...
output:
7
result:
ok 1 number(s): "7"
Test #52:
score: 0
Accepted
time: 5ms
memory: 8020kb
input:
40 50 #################..##################...########## #################..###############......########## #################..############.........########## ############################........############## ########################.........################# #####################.........#########...
output:
48
result:
ok 1 number(s): "48"
Test #53:
score: 0
Accepted
time: 3ms
memory: 5680kb
input:
50 50 .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#...
output:
49
result:
ok 1 number(s): "49"
Test #54:
score: 0
Accepted
time: 5ms
memory: 5780kb
input:
50 50 ######........................#............#...### #############################################..### #############################################..### ##############..#############################..### ##############....########....###############..### ##############......######......#######...
output:
32
result:
ok 1 number(s): "32"
Test #55:
score: 0
Accepted
time: 1ms
memory: 5908kb
input:
3 3 .#. ### .##
output:
3
result:
ok 1 number(s): "3"
Test #56:
score: 0
Accepted
time: 1ms
memory: 5744kb
input:
50 50 .#..#.......#.##...#..#....#..#.#.............#... #....#...#.#..........#..#.#.....#......#......... #.....##.#..#....###...............#...#.........# #........##..#...#..##..#..............#.#.#...... ##.#..................#.............#........#...# ..........#...###.#.#.....#.....#...#.....
output:
4
result:
ok 1 number(s): "4"
Test #57:
score: 0
Accepted
time: 1ms
memory: 5932kb
input:
20 30 ...#################.......... #..#################..#######. ...#################..##...... ...#################..##...... .###################..##..#### ...#################..##...... ...#################....#..... #..###########......#....####. ...###########.......##..####. ..#......#####....
output:
6
result:
ok 1 number(s): "6"
Test #58:
score: 0
Accepted
time: 2ms
memory: 5956kb
input:
40 50 #.....#####...........#############.........###### ####..#####.....####..############............#### ###...#####...######..###########....#####.....### ###...####...####.....##########....########....## ##...#####...####....#.............##########...## ##...#####...####..##.............#####...
output:
9
result:
ok 1 number(s): "9"
Test #59:
score: 0
Accepted
time: 0ms
memory: 5796kb
input:
50 43 .#####..################################### .####...################################### .#####..#############......################ .##################...........############# .################.......#.......########### .###############......####.#.....########## ..#############....###########...
output:
6
result:
ok 1 number(s): "6"
Test #60:
score: 0
Accepted
time: 4ms
memory: 5780kb
input:
50 50 #####...........####.##.###########....#..#.#....# #..##..##.##...#####.##.###..###.#..#...#.......#. .#......####.##.#####.#..#..#.###..#..#...#....... ...#############.......#.####.#.........#......... #.#.###.....#####....##..#..###.........#......... ##.#..#..#..#...#......###...#..#..#.##...
output:
32
result:
ok 1 number(s): "32"
Test #61:
score: 0
Accepted
time: 5ms
memory: 5744kb
input:
50 50 ####............############..####.##########..#.# ##..###.#.##.#.##.#.########.#..###.#########.#### #.##.###.#####.#.#.#####.##.#####...##.########.## ###..####.######.##..####.#..##.........#......... #.######.#..#...#######.#######.........#......... ..###...##..#.###.####.##.###...##...##...
output:
31
result:
ok 1 number(s): "31"
Test #62:
score: 0
Accepted
time: 5ms
memory: 5740kb
input:
50 43 ....#############...#.###.##.#............. ...###...#.###......#.#..#................. ...#####.###..#..###..#.#..#............... ##########.#........#....#................. ####....#..#..##.#...#...#.#............... ####......#..##.#..#.#....#................ ###.......##..#.....#..##...#....
output:
38
result:
ok 1 number(s): "38"
Test #63:
score: 0
Accepted
time: 3ms
memory: 5900kb
input:
50 50 #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. .#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#....
output:
50
result:
ok 1 number(s): "50"
Test #64:
score: 0
Accepted
time: 5ms
memory: 7784kb
input:
50 50 ######........................#............#...### #############################################..### #############################################..### #############################################..### #############################################..### #######################################...
output:
31
result:
ok 1 number(s): "31"
Test #65:
score: 0
Accepted
time: 1ms
memory: 5920kb
input:
4 6 .##... .#.... ##.... #...#.
output:
2
result:
ok 1 number(s): "2"
Test #66:
score: 0
Accepted
time: 3ms
memory: 7760kb
input:
50 50 ..##.#....#.........#...#..#.....#...##.#.....#... ........#..#.#............#....#.#......#...#..... .#....#.#.......#..#..#.....................##..#. #..........#.#.###.#.....#...#........#.#.....#.#. .....#####.##....#...##..#.......#...#...##....#.. ....##.#.#..##..#...#.#...............#...
output:
13
result:
ok 1 number(s): "13"
Test #67:
score: 0
Accepted
time: 2ms
memory: 7756kb
input:
43 50 .#################################................ ##################################................ ##################################..############.. ##################################..############.. #..###############################..#############. #..###############################........
output:
38
result:
ok 1 number(s): "38"
Test #68:
score: 0
Accepted
time: 1ms
memory: 5680kb
input:
15 10 .......... #########. .......... .......... .######### .......... .......... #########. ......###. ......###. .###..###. .###...... .###...... .######### ..........
output:
0
result:
ok 1 number(s): "0"
Test #69:
score: 0
Accepted
time: 1ms
memory: 5688kb
input:
11 18 ##....##..####...# ##.##..##..##.#.#. ...##.#.##..#.##.# #...########...### ..#.##.#.#.##.#.## #####....#..###.## .###...#.##.##.#.. #..##.#.#####..#.. ####..#..####..### #.#..###.#.##.#### .#.###.#.##.##....
output:
15
result:
ok 1 number(s): "15"
Test #70:
score: 0
Accepted
time: 1ms
memory: 5740kb
input:
36 25 .#....................... ....#####..#.#.#######... .....############..##.##. ####.#.#.###..##.##.###.. .#####.####...........#.. #.##.##...............##. #............#.###...###. .#......#.#########..###. ##...##.##..##.####..###. #...#########.....#...#.. ##..#.#..##..#.##........ .#..##.#...
output:
8
result:
ok 1 number(s): "8"
Test #71:
score: 0
Accepted
time: 0ms
memory: 5796kb
input:
50 40 .#.##.##..#.#........................... ###..##.####.......#####.#####.#.#..#... .#######.#.#....##...###.##.#.#######.#. ###.#######...###..####.########.#####.. ..####.##......####.########.####.##.##. .###..###....#####.####.#.#.##.######... ..#####.##..#.##.###.###........##..###. .#...##...
output:
9
result:
ok 1 number(s): "9"
Test #72:
score: 0
Accepted
time: 1ms
memory: 5644kb
input:
50 43 .#......#.#..#.####..#.#.#.....#.#.#.#..... ..#....##.###.##..###.#.#..#......#..#....# ..###...#.#....##...##.....#.#######...#.## ..#......##.##....##.####..##.#.###.#.#..#. ...###.#..###....#....#.#....#.#.####..#### .....#.#..##...##..#..#..........##.#....## ....#....#####..####...#.........
output:
5
result:
ok 1 number(s): "5"
Test #73:
score: 0
Accepted
time: 1ms
memory: 5904kb
input:
50 50 #.##.....#............###.##...........#.....#.... ..##..#..#..####.###..#.####..#.....#............. ..##..#..#..#.........###.##..#..#.....#..#..#..#. .#.#..#...............###.##..#..#..#.....#..#..#. .##......#........#..#.##..#..#..#..#..#.......... ..#......#..##..############........#.....
output:
7
result:
ok 1 number(s): "7"
Test #74:
score: 0
Accepted
time: 0ms
memory: 5716kb
input:
36 25 .......................#. ##....##.#.##.#....#.#... ....#.#..#...#....#.#.... #..#..........#......##.. .................#......# ##...........##.........# ....#.#..##...........#.. #.###.#....#.........#..# .......#....##...#.#...## ........##......#.#.....# .#..##...#....##...#.#.#. #....#.....
output:
10
result:
ok 1 number(s): "10"
Test #75:
score: 0
Accepted
time: 3ms
memory: 7792kb
input:
44 50 .##.#..#.##..##......#.##.##....##.#.#####.#..#### ...#.########..##..#.#.#...#.#####.#......#.#.#### .#..#...#....####..........####...####........#.## #.#.#....#...##.##.###.#....#..###.#.....##...###. #.######......#..#.##.##.#.....###.##..#####...##. .....#.###...##.#.##.####...####.######...
output:
42
result:
ok 1 number(s): "42"
Test #76:
score: 0
Accepted
time: 3ms
memory: 5708kb
input:
50 50 ....############.....######......########....##### ##..###########....######.....##########....###### ....##########....#####......##########....###...# ...#....####....#####......###...#####....###....# ..#.....##.....#####.....###.....###....####....## .....#..#.....#####....###......###.......
output:
19
result:
ok 1 number(s): "19"
Extra Test:
score: 0
Extra Test Passed