안녕하세요. 오늘은 상금을 탈거예요.

문제

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

아이디어

이 문제는.. 그냥 배열 쓰면 됩니다.
(자세한건 코드 참고)

소스코드

#include <iostream>
using namespace std;

int main(void)
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int first[101] = { 0,500,300,300,200,200,200,50,50,50,50,30,30,30,30,30,10,10,10,10,10,10 };
    int second[65] = { 0,512,256,256,128,128,128,128,64,64,64,64,64,64,64,64,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 };

    int T, a, b;
    cin >> T;
    while (T--)
    {
        cin >> a >> b;
        cout << (first[a] + second[b]) * 10000 << "\n";
    }
}


감사합니다.

0개의 댓글