백준 15552_빠른 A+B[C++]
본문 바로가기
Algorithm/Python, C++

백준 15552_빠른 A+B[C++]

by liveloper jay 2022. 1. 13.

문제

 

풀이

문제에 주어진 힌트를 이용하여 문제를 풀어주면 쉽게 해결할 수 있는 문제입니다. (주어진 힌트를 이용하지 않을 시 시간초과가 발생하여 틀리게 됩니다.)

 

 

 

소스코드

#include <iostream>
using namespace std;


int main()
{
    cin.tie(NULL);
    ios::sync_with_stdio(false);
    int n, a, b;
    
    cin >> n;
    int result[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a >> b;
        result[i] = a+b;
    }
    for (int j = 0; j < n; j++)
    {
        cout << result[j] << '\n';
    }
}

'Algorithm > Python, C++' 카테고리의 다른 글

백준 10951_A+B - 4[C++]  (0) 2022.01.15
백준 1110_더하기 사이클[C++]  (0) 2022.01.15
백준 11022_A+B - 8[C++]  (0) 2022.01.13
백준 11021_A+B - 7[C++]  (0) 2022.01.13
백준 10950_A+B - 3[C++]  (0) 2022.01.13

댓글