48th ICPC B
作者:
死鱼蛋味粽子
,
2024-09-19 17:51:06
,
所有人可见
,
阅读 4
#include <iostream>
#include <cstring>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int a[100][1000];
int b[105];
typedef long long ll;
int main(){
int n,k;
cin>>n>>k;
map<ll, int> mapp;
for (int i = 0; i < n; i ++ ){
for (int j = 0; j < k; j ++ ){
cin>>a[i][j];
mapp[a[i][j]]++;
}
}
for (int i = 0; i < n; i ++ ){
for (int j = 0; j < k; j ++ ){
if(mapp[a[i][j]] == 1){
b[i] = 1;
}
}
}
int num = 0;
for (int i = 0; i < n; i ++ ){
if(b[i] == 1) num++;
}
double ans = (1/(double)num);
for (int i = 0; i < n; i ++ ){
if(b[i] == 1){
printf("%.9f\n", ans);
}
else{
printf("0.000000000\n");
}
}
}