From 1c23b52613ff0ef8b41ef8bf3b615d2b56756587 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 2 Dec 2024 17:38:26 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#411=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 --- .../K\353\262\210\354\247\270\354\210\230.cpp" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 "Programmers/K\353\262\210\354\247\270\354\210\230.cpp" diff --git "a/Programmers/K\353\262\210\354\247\270\354\210\230.cpp" "b/Programmers/K\353\262\210\354\247\270\354\210\230.cpp" new file mode 100644 index 0000000..161bbd1 --- /dev/null +++ "b/Programmers/K\353\262\210\354\247\270\354\210\230.cpp" @@ -0,0 +1,17 @@ +#include +#include +#include + +using namespace std; + +vector solution(vector array, vector> commands) { + vector answer; + + for (vector command : commands) { + vector list(array.begin() + command[0] - 1, array.begin() + command[1]); + sort(list.begin(), list.end()); + answer.push_back(list[command[2] - 1]); + } + + return answer; +} \ No newline at end of file