首页 > 其他 > 详细

HDU 4505

时间:2015-03-16 22:46:07      阅读:192      评论:0      收藏:0      [点我收藏+]

哈哈哈哈哈哈哈哈哈,省赛,一等奖,一定的一定的一定的一定的。。。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

const int N=110;

bool flag[N];

int main(){
    int T,n,cnt,maxh,t;
    scanf("%d",&T);
    while(T--){
        cnt=0; maxh=0;
        memset(flag,false,sizeof(flag));
        scanf("%d",&n);
        for(int i=1;i<=n;i++){
            scanf("%d",&t);
            if(!flag[t]){
                cnt++;
                flag[t]=true;
            }
            maxh=max(maxh,t);
        }
        int ans=6*maxh+4*maxh+cnt*5+n;
        printf("%d\n",ans);
    }
    return 0;
}

 

HDU 4505

原文:http://www.cnblogs.com/jie-dcai/p/4342953.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!