Title Link: Https://www.nowcoder.com/acm/contest/76/D
Did not notice "no matter which lattice appears" in the question. The question does not indicate that a lattice can only pass once, in fact, there is no imagination complex.
Judge if the bottom or right of the point can not go, the number of portals +1. There's only one '. ' Number of portals is 0
Code:
#include <bits/stdc++.h>using namespacestd;Charmp[1004][1004];intMain () {intN, M, I, J; while(~SCANF ("%d%d", &m, &N)) {intAns =0, sum =0; for(i =0; I < m; i++) scanf ("%s", Mp[i]); for(i =0; I < m; i++) for(j =0; J < N; J + +) { if(Mp[i][j] = ='.') {sum++; if((mp[i+1][J] = ='#'|| i = = m1) && (mp[i][j+1] =='#'|| j = = N1)) Ans++; } } if(Sum = =1) ans =0; printf ("%d\n", ans); } return 0;}
"2018 National multi-school algorithm winter training Camp Practice Competition (fourth)-D" Xiao Ming's mining trip