Tanky WooRSS

HDOJ 2078 复习时间

06 Aug 2010
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

题目地址:

http://acm.hdu.edu.cn/showproblem.php?pid=2078


不知道这题算不算贪心,只能说是水题~~~~

#include 
using namespace std;
int theMax, theMin;
int main() 
{
    int nCases;
    int m, n;
    cin >> nCases;
    while(nCases--)
    {
        theMax = 0; 
        theMin = 101;
        cin >> n >> m;
        int num;
        for(int i=0; i> num;
           if(num < theMin)
              theMin = num;
           if(num > theMax)
              theMax = num;
        }
        if((theMax-theMin)*(theMax-theMin) < (100-theMin)*(100-theMin))
           printf("%d\n", (100-theMin)*(100-theMin));
        else
           printf("%d\n", (theMax-theMin)*(theMax-theMin));
     }
     return 0; 
}