페이지

4435번: 중간계 전쟁

https://www.acmicpc.net/problem/4435


$O(t)$


#include<cstdio>
int f[] = { 1,2,3,3,4,10 }, g[] = { 1,2,2,2,3,5,10 }, t;
int main() {
    scanf("%d", &t);
    for (int i = 1; i <= t; i++) {
        int a = 0, b = 0, x;
        for (int j = 0; j<6; j++) scanf("%d", &x), a += f[j] * x;
        for (int j = 0; j<7; j++) scanf("%d", &x), b += g[j] * x;
        printf("Battle %d: %s\n", i, a^b ? a<b ? "Evil eradicates all trace of Good" : "Good triumphs over Evil" : "No victor on this battle field");
    }
    return 0;
}

댓글 없음 :

댓글 쓰기