| 记录编号 | 
        38369 | 
        评测结果 | 
        AAAATTTWTW | 
    
    
        | 题目名称 | 
        772.矩阵 | 
        最终得分 | 
        40 | 
            
    
    
        | 用户昵称 | 
         201101 | 
        是否通过 | 
        未通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        4.227 s  | 
    
    
        | 提交时间 | 
        2012-04-17 21:31:13 | 
        内存使用 | 
        3.70 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		/*
UID:cheepok
PID:matrixa
*/
 
#include<stdio.h>
#include<set>
 
using namespace std;
 
set <int> s[1001],s1;
 
int n,m,a[1001][1001];
 
int main()
{
    freopen("matrixa.in","r",stdin);
    freopen("matrixa.out","w",stdout);
    int i,j;
    while(scanf("%d%d",&n,&m)==2)
    {
        for(i=1;i<=n;i++)for(j=1;j<=m;j++)scanf("%d",&a[i][j]);
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=m;j++)
            {
                s[j].insert(a[i][j]);
            }
            s1.clear();
            for(j=1;j<=m;j++)
            {
                set <int> :: iterator it;
                for(it=s[j].begin();it!=s[j].end();it++)
                {
                    s1.insert(*it);
                }
                printf("%d ",s1.size());
            }
            printf("\n");
        }
    }
    return 0;
}