正文
增加 2 行删除 2 行
114 行未改动全部展开11511611711811912012112212314 行未改动13813914014114214314414514613 行未改动114 行未改动全部展开using namespace std;const int N = 1e5 + 5;int t, n, m, ans, a[10][10], f[10][10];int dx[10] = {-1, -1, -1, 1, 1, 1, 0, 0};int dy[10] = {-1, 0, 1, -1, 0, 1, -1, 1};void dfs(int x, int y, int sum){if(y > m) x++, y = 1;if(x > n){ans = max(ans, sum);//更新ans14 行未改动f[nx][ny]--;}//回溯}//选dfs(x, y + 1, sum);//不选}int main(){cin >> t;while(t--){ans = 0;13 行未改动114 行未改动全部展开11511611711811912012112212314 行未改动13813914014114214314414514613 行未改动114 行未改动全部展开using namespace std;const int N = 1e5 + 5;int t, n, m, ans, a[10][10], f[10][10];int dx[10] = {-1, -1, -1, 1, 1, 1, 0, 0};int dy[10] = {-1, 0, 1, -1, 0, 1, -1, 1};void dfs(int x, int y, int sum){if(y > m) x++, y = 1;if(x > n){ans = max(ans, sum);//更新ans14 行未改动f[nx][ny]--;}//回溯}//选dfs(x, y + 1, sum);//不选}int main(){cin >> t;while(t--){ans = 0;13 行未改动