版本比较
题解:P6757 [BalticOI2013] Tracks in the Snow
正文
增加 5 行删除 5 行
11 行未改动1213141516161718192017 行未改动383940414242434445467 行未改动5455565758585960616250 行未改动11311411511611711811711811912012112255 行未改动11 行未改动代码:```cpp#include<bits/stdc++.h>using namespace std;#define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于在填充时进行取反 #define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于在填充时进行取反char a[4010][4010];int n, m;int filled; //记录每次填充的面积int now; //记录当前填充的面积17 行未改动 filled = 0; dfs(1, 1, a[1][1]); ++ans; } while(filled > now); //验证是否与上一次重合,如果是,则跳出循环 cout << ans - 1; //由于需要多花一次填充来判断是否结束,所以输出时应减一 cout << ans - 1; //由于需要多花一次填充来判断是否结束,所以输出时应减一 return 0;}```然而结果不尽人意,只有可怜的[ 55 分](https://www.luogu.com.cn/record/179478055)。7 行未改动代码如下:```cpp#include<bits/stdc++.h>using namespace std;#define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于将足迹取反 #define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于将足迹取反struct point { int x, y;};char a[4010][4010];50 行未改动#define I return#define AK 0#define IOI ;using namespace std;#define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于将足迹取反 struct point { //定义结构体,便于入栈 #define chg(x) (x == 'R'? 'F' : 'R') //宏定义,便于将足迹取反struct point { //定义结构体,便于入栈 int x, y;};char a[4010][4010]; //读入的矩阵bool vis[4010][4010]; //用以标记搜过的位置(这应该不用过多解释吧)55 行未改动