problemcutter

导航

SPOJ Problem 2727:Army Strength

题目在此  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");
    }
}

 

posted on 2015-03-07 08:43  problemcutter  阅读(112)  评论(0)    收藏  举报