F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-02 09:23:16, Gzip enabled