inline void dfs(int x, int y, int z){
if(now * po[z] + base[z] <= ans) return ;
ans = max(ans, now);
for(int i = 0;i < 4;i = -~i){
int tx = x + dx[i], ty = y + dy[i];
if(tx < 1 || ty < 1 || tx > n || ty > m || mark[tx][ty] || c[tx][ty] == '#') continue;
mark[tx][ty] = true, now = now * 10 + (c[tx][ty] - '0');
dfs(tx, ty, z - 1), mark[tx][ty] = false, now /= 10;
}
return ;
}
今天卡时,发现把自己卡T了。
本来 AC(500ms) ,加上卡时之后 TLE(1200ms) 。
clock() 的复杂度究竟是多少,求大佬解答。