码迷,mamicode.com
首页 > 其他好文 > 详细

SPOJ Problem 2727:Army Strength

时间:2015-03-07 09:02:25      阅读:176      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!