๋ชฉ๋ก์œผ๋กœ
๋ฐฑ์ค€

BOJ - [Basic Algebra - 5063 TGN] - BronzeIII๐Ÿฅ‰

https://www.acmicpc.net/problem/5063 ๊ด‘๊ณ ๋ฅผ ํ•˜์ง€์•Š์•˜์„๋–„ ์ˆ˜์ต๊ณผ ๊ด‘๊ณ ๋ฅผ ํ–ˆ์„๋•Œ ์ˆœ์ด์ต(๊ด‘๊ณ ๋ฅผ ํ–ˆ์„๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์ด์ต - ๊ด‘๊ณ  ๋น„์šฉ)์˜ ํฌ๊ธฐ๋ฅผ ๋น„๊ตํ•ด [advertise],[do not advertise],[does not matter]๋กœ ํŒ๋‹จ ๊ฒฐ๊ณผ๋ฅผ ํ‘œ์‹œ...

1๋ถ„ ์ฝ๊ธฐ

๋ฌธ์ œ

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

์„ค๋ช…

๊ด‘๊ณ ๋ฅผ ํ•˜์ง€์•Š์•˜์„๋–„ ์ˆ˜์ต๊ณผ ๊ด‘๊ณ ๋ฅผ ํ–ˆ์„๋•Œ ์ˆœ์ด์ต(๊ด‘๊ณ ๋ฅผ ํ–ˆ์„๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์ด์ต - ๊ด‘๊ณ  ๋น„์šฉ)์˜ ํฌ๊ธฐ๋ฅผ ๋น„๊ตํ•ด [advertise],[do not advertise],[does not matter]๋กœ ํŒ๋‹จ ๊ฒฐ๊ณผ๋ฅผ ํ‘œ์‹œํ•ด๋‹ฌ๋ผ๋Š” ๊ฒƒ์ด ์กฐ๊ฑด์ธ ๋ฌธ์ œ์˜€๋‹ค. ๋ฐ˜๋ณต๋ฌธ์œผ๋กœ ์ž…๋ ฅ์„๋ฐ›๊ณ  ํŒ๋‹จ์„ํ•˜๊ณ  ๋ฐ”๋กœ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•˜๋Š”๊ฒƒ ์™ธ์— ๋ณ„ ํŠน๋ณ„ํ•œ ๊ฒƒ์ด ์—†๋‹ค.

์ฝ”๋“œ

#include <stdio.h>

int main() {
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        int n_benefit, y_benefit, adv_cost;
        scanf("%d %d %d",&n_benefit, &y_benefit, &adv_cost);
        if(n_benefit<y_benefit-adv_cost)
            printf("advertise");
        else if (n_benefit == y_benefit-adv_cost)
            printf("does not matter");
        else if (n_benefit > y_benefit-adv_cost)
            printf("do not advertise");
        printf("\n");
    }
    return 0;
}

๋Œ“๊ธ€