Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
44674 teacher_lu 宝藏图 C++ Accepted 1 MS 252 KB 360 2024-04-02 16:40:39

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main(){ int m, n; cin >> m >> n; int a[m+1][n+1]; double x = 0, y = 0; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++){ cin >> a[i][j]; if(a[i][j]==1) x++; if(a[i][j]==-1) y++; } } cout << x / (n*m) << " " << y / (n*m) << endl; }


Judgement Protocol: