zoukankan      html  css  js  c++  java
  • POJ 2092

     1 #include <iostream>
     2 #include <algorithm>
     3 #define MAXN  10005
     4 using namespace std;
     5 
     6 int _m[MAXN];
     7 int c[MAXN];
     8 bool op(int a,int b);
     9 
    10 int main()
    11 {
    12     //freopen("acm.acm","r",stdin);
    13     int m;
    14     int n;
    15     int i;
    16     int j;
    17     int tem;
    18     while(cin>>m>>n)
    19     {
    20         if(m == 0 && n == 0)
    21         {
    22             break;
    23         }
    24         memset(_m,0,sizeof(_m));
    25         for(i = 0; i < m; ++ i)
    26         {
    27             for(j = 0; j < n; ++ j)
    28             {
    29                 cin>>tem;
    30                 ++ _m[tem];
    31             }
    32         }
    33         copy(_m,_m+MAXN,c);
    34         sort(c,c+MAXN,op);
    35         tem = c[0];
    36         for(i = 0; i < MAXN; ++ i)
    37         {
    38             if(c[i] != tem)
    39             {
    40                 tem = c[i];
    41                 break;
    42             }
    43         }
    44     //    cout<<c[i]<<endl;
    45         for(i = 0; i < MAXN; ++ i)
    46         {
    47             if(_m[i] == tem)
    48             {
    49                 cout<<i<<" ";
    50             }
    51         }
    52 
    53         cout<<endl;
    54     }
    55 }
    56 
    57 bool op(int a,int b)
    58 {
    59     if(a > b)
    60     {
    61         return true;
    62     }
    63     return false;
    64 }

    关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

    技术网站地址: vmfor.com

  • 相关阅读:
    CF Spreadsheets (数学)
    CF Theatre Square
    CF Error Correct System
    CF Playing with Paper
    HDU 3533 Escape (BFS + 预处理)
    nginx配置文件
    nginx配置文件详解
    Jenkins+maven+gitlab+shell实现项目自动化部署
    jenkins升级
    jenkins相关下载链接
  • 原文地址:https://www.cnblogs.com/gavinsp/p/4566648.html
Copyright © 2011-2022 走看看