# 请问大神们，这个预处理指令有何作用#ifdef __LOCAL_WONZY__

0
[已解决问题] 解决于 2020-03-18 22:49

__LOCAL_WONZY__有什么特殊含义吗？

# ifdef LOCAL_WONZY

``freopen("2.txt", "r", stdin);``

# include <bits/stdc++.h>

using namespace std;

const int MAXN = 305;
int T, R, C, K, V[MAXN][MAXN], ans;
int dp[2][MAXN][MAXN];

int main() {

# ifdef LOCAL_WONZY

``freopen("2.txt", "r", stdin);``

# endif

``````cin >> T;
for(int cas = 1; cas <= T; ++cas) {
cin >> R >> C >> K;
memset(dp, 0, sizeof(dp));
for(int i = 1; i <= R; ++i) {
for(int j = 1; j <= C; ++j) {
cin >> V[i][j];
}
}
ans = R;
for(int i = 1; i <= R; ++i) {
for(int j = 1; j <= C; ++j) {
int maxv = V[i][j];
int minv = V[i][j];
int f = i & 1;
dp[f][j][1] = 1;
for(int k = 2; k <= j; ++k) {
minv = min(minv, V[i][j-k+1]);
maxv = max(maxv, V[i][j-k+1]);
if(maxv - minv > K) break;
dp[f][j][1] = k;
}
ans = max(ans, dp[f][j][1]);
for(int k = 2; k <= i; ++k) {
dp[f][j][k] = min(dp[f][j][1], dp[f^1][j][k - 1]);
ans = max(ans, dp[f][j][k] * k);
}
}
}
printf("Case #%d: %d\n", cas, ans);
}
return 0;``````

}

0

jakio6 | 小虾三级 |园豆：1268 | 2020-01-24 00:27

您需要登录以后才能回答，未注册用户请先注册