| 记录编号 | 
        38356 | 
        评测结果 | 
        AAATTTTATW | 
    
    
        | 题目名称 | 
        772.矩阵 | 
        最终得分 | 
        40 | 
            
    
    
        | 用户昵称 | 
         TBK | 
        是否通过 | 
        未通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        5.574 s  | 
    
    
        | 提交时间 | 
        2012-04-17 19:40:01 | 
        内存使用 | 
        27.71 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include <iostream> 
#include <cmath> 
#include <cstring> 
#include <string> 
#include <cstdio> 
#include <cstdlib> 
#include <iomanip> 
#include <set> 
#include <algorithm> 
using namespace std; 
set<int> s;
int a[2000][2000],b,c,d,l,m,n,k,r[200],f[2000][2000];
int main(void) 
{    
    freopen("matrixa.in","r",stdin); 
    freopen("matrixa.out","w",stdout); 
    while (scanf("%d%d",&b,&c)==2)
    {
        for (l=0;l<b;l++)
            for (m=0;m<c;m++)
                scanf("%d",&a[l][m]);
        for (l=0;l<b;l++)
            for (m=0;m<c;m++)
            {
                s.clear();
                for (d=l;d>=0;d--) 
                    for (n=m;n>=0;n--)
                        s.insert(a[d][n]);
                f[l][m]=s.size();
            }
        for (l=0;l<b;l++)
        {
            for (m=0;m<c;m++) printf("%d ",f[l][m]);
            printf("\n");
        }
    }
    fclose(stdin); 
    fclose(stdout); 
    return 0; 
}