首页 > 其他 > 详细

SPOJ Problem 2727:Army Strength

时间:2015-03-07 08:59:58      阅读:333      评论:0      收藏:0      [点我收藏+]

题目在此  http://www.spoj.com/problems/ARMY/

总体来说就是求最大值。。

#include<cstdio>
#include<cstring>
int x,n,t,i,a,b;
int max,pos;
int main(){
    scanf("%d",&t);
    while(t--){
        scanf("%d%d",&a,&b);
        max=0;
        for (i=1;i<=a;i++){
            scanf("%d",&x);
            if (x>max){max=x;pos=1;}
        }
        for (i=1;i<=b;i++){
            scanf("%d",&x);
            if (x>max){max=x;pos=2;}
        }
        if (pos==1)printf("Godzilla\n");else printf("MechaGodzilla\n");
    }
}

 

SPOJ Problem 2727:Army Strength

原文:http://www.cnblogs.com/moris/p/4319702.html

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