【CodeForces】[658A]Bear and Reverse Radewoosh

【CodeForces】[658A]Bear and Reverse Radewoosh_第1张图片

根据题意分别计算两人的分值
进行比较就好了

#include
int main() {
    int n,c;
    while(scanf("%d %d",&n,&c)!=EOF) {
        int a[55],q[55];
        for(int i=0; i"%d",&a[i]);
        for(int i=0; i"%d",&q[i]);
        int sum1=0,sum2=0;
        int tq=0;
        for(int i=0; iq[i];
            int t=a[i]-c*tq;
            if(t>0)
                sum1+=t;
        }
        tq=0;
        for(int i=n-1; i>=0; i--) {
            tq+=q[i];
            int t=a[i]-c*tq;
            if(t>0)
                sum2+=t;
        }
        if(sum1>sum2)
            printf("Limak\n");
        else if(sum1printf("Radewoosh\n");
        else
            printf("Tie\n");
    }
    return 0;
}

题目地址:【CodeForces】[658A]Bear and Reverse Radewoosh

你可能感兴趣的:(CodeForces)