euisblue
12954. x만큼 간격이 있는 n개의 숫자

Level 1 x만큼 간격이 있는 n개의 숫자

시간 복잡도: O(N)

1#include <string> 2#include <vector> 3using namespace std; 4 5vector<long long> solution(int x, int n) { 6 vector<long long> answer(n, 0); 7 answer[0] = x; 8 9 for(int i=1; i<n; ++i) answer[i] = answer[i-1] + x; 10 return answer; 11}