From efe585025c373d32d7b03c04d5ad180bc264742f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 26 Nov 2024 06:09:50 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#390=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=86=94=EB=A3=A8=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._\354\210\230\354\235\230_\355\225\251.cpp" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "Programmers/\354\227\260\354\206\215\353\220\234_\354\210\230\354\235\230_\355\225\251.cpp" diff --git "a/Programmers/\354\227\260\354\206\215\353\220\234_\354\210\230\354\235\230_\355\225\251.cpp" "b/Programmers/\354\227\260\354\206\215\353\220\234_\354\210\230\354\235\230_\355\225\251.cpp" new file mode 100644 index 0000000..4eec349 --- /dev/null +++ "b/Programmers/\354\227\260\354\206\215\353\220\234_\354\210\230\354\235\230_\355\225\251.cpp" @@ -0,0 +1,18 @@ +#include +#include + +using namespace std; + +vector solution(int num, int total) { + vector result; + + // 첫 번째 수 계산 + int start = (total - (num * (num - 1) / 2)) / num; + + // 연속된 수를 계산하여 결과에 추가 + for (int i = 0; i < num; ++i) { + result.push_back(start + i); + } + + return result; +} \ No newline at end of file