x만큼 간격이 있는 n개의 숫자 : 문제 링크
- x는 -10000000 이상, 10000000 이하인 정수이다.
- n은 1000 이하인 자연수이다.
#include <vector>
using namespace std;
vector<long long> solution(int x, int n) {
vector<long long> answer;
int start = x;
for(int i = 0; i < n; ++i) {
answer.push_back(start);
start += x;
}
return answer;
}