C++编译器编译出现
[Error] invalid types 'long long unsigned int[int]' for array subscript
代码是这样的
#include<bits/stdc++.h>
using namespace std;
const int N=100009;
int main() {
unsigned long long n, m, a, b, c, d, s[N][N], f[N][N];
freopen("reward0.in", "r", stdin);
freopen("reward0.out", "w", stdout);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
cin >> f[i][j];
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
s[i][j] = f[i][j] + s[i][j - 1];
int ans = INT_MIN;
cin >> m;
for (int k = 1; k <= m; k++) {
cin >> a >> b >> c >> d;
int cnt = 0;
for (int i = a; i <= c; i++)
cnt += s[i][d] - s[i][b - 1];
ans = max(ans, cnt);
}
cout << ans << endl;
return 0;
}