版本比较
2026寒假编程第五讲错题总结
正文
增加 2 行删除 2 行
114 行未改动全部展开11511611711811911912012112212314 行未改动13813914014114214214314414514613 行未改动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}; 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 行未改动