0_0_23318297_3551.cpp:1:841: fatal error: GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stdc++.h>typede: Invalid argument
#include<bits/stdc++.h>typedef long long ll;using namespace std;const int MAXN = 1e2 + 10;int n, m;int c[MAXN][MAXN];ll fun(int x, int y) {ll sum = 0;int L = 1, R = m;for(int i = x; i >= 1; i--) {if(i != x && c[i][y] == c[x][y]) break;int l = 1, r = m;for(int j = y - 1; j >= 1; j--) {if(c[i][j] == c[x][y]) {l = j + 1;break;}}if(i != x) {for(int j = y + 1; j <= R; j++) {if(c[i][j] == c[x][y]) {r = j - 1;break;}}}L = max(L, l);R = min(R, r);sum += 1LL * (y - L + 1) * (R - y + 1) * (n - x + 1);}return sum;}int main() {int T;scanf("%d", &T);while(T--) {scanf("%d%d", &n, &m);for(int i = 1; i <= n; i++) {for(int j = 1; j <= m; j++) {scanf("%d", &c[i][j]);}}ll sum = 0, num = 0;for(int i = 1; i <= n; i++) {for(int j = 1; j <= m; j++) {sum += 1LL * (n - i + 1) * (m - j + 1);num += fun(i, j);}}printf("%.9f\n", 1.0 * num / sum);}return 0;}
^
compilation terminated.
|