From a876572fb95a72e90ecb32853cdcf7e7a90cf15b Mon Sep 17 00:00:00 2001 From: Gyuhyeok99 Date: Thu, 1 Jan 2026 18:02:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Week01]=20BOJ=202750:=20=EC=88=98=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gyuhyeok99.cpp" | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "weekly/week01/BOJ_2750_\354\210\230 \354\240\225\353\240\254\355\225\230\352\270\260/gyuhyeok99.cpp" diff --git "a/weekly/week01/BOJ_2750_\354\210\230 \354\240\225\353\240\254\355\225\230\352\270\260/gyuhyeok99.cpp" "b/weekly/week01/BOJ_2750_\354\210\230 \354\240\225\353\240\254\355\225\230\352\270\260/gyuhyeok99.cpp" new file mode 100644 index 0000000..8375f82 --- /dev/null +++ "b/weekly/week01/BOJ_2750_\354\210\230 \354\240\225\353\240\254\355\225\230\352\270\260/gyuhyeok99.cpp" @@ -0,0 +1,27 @@ +#include +#include +#include + +using namespace std; + +int n; +vector v; +int main() { + ios::sync_with_stdio(false); + cin.tie(NULL); cout.tie(NULL); + + cin >> n; + for (int i = 0; i < n; i++) { + int x; + cin >> x; + v.push_back(x); + } + + sort(v.begin(), v.end()); + + for (int num : v) { + cout << num << '\n'; + } + + return 0; +} From daa039a4fe14d1c0336fbcb5d3bcce9a8dc935a7 Mon Sep 17 00:00:00 2001 From: Gyuhyeok99 Date: Thu, 1 Jan 2026 18:08:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Week01]=20BOJ=2010828:=20=EC=8A=A4?= =?UTF-8?q?=ED=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gyuhyeok99.py" | 13 ----- .../gyuhyeok99.cpp" | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+), 13 deletions(-) delete mode 100644 "weekly/week01/BOJ_0000_\354\230\210\354\213\234\353\254\270\354\240\234/gyuhyeok99.py" create mode 100644 "weekly/week01/BOJ_10828_\354\212\244\355\203\235/gyuhyeok99.cpp" diff --git "a/weekly/week01/BOJ_0000_\354\230\210\354\213\234\353\254\270\354\240\234/gyuhyeok99.py" "b/weekly/week01/BOJ_0000_\354\230\210\354\213\234\353\254\270\354\240\234/gyuhyeok99.py" deleted file mode 100644 index f393568..0000000 --- "a/weekly/week01/BOJ_0000_\354\230\210\354\213\234\353\254\270\354\240\234/gyuhyeok99.py" +++ /dev/null @@ -1,13 +0,0 @@ -# BOJ 0000: 예시 문제 -# https://www.acmicpc.net/problem/0000 - -# 문제 풀이 -# 알고리즘: 구현 -# 시간 복잡도: O(n) - -def solution(): - # 여기에 풀이 코드를 작성합니다 - pass - -if __name__ == "__main__": - solution() diff --git "a/weekly/week01/BOJ_10828_\354\212\244\355\203\235/gyuhyeok99.cpp" "b/weekly/week01/BOJ_10828_\354\212\244\355\203\235/gyuhyeok99.cpp" new file mode 100644 index 0000000..dd7c834 --- /dev/null +++ "b/weekly/week01/BOJ_10828_\354\212\244\355\203\235/gyuhyeok99.cpp" @@ -0,0 +1,53 @@ +#include +#include + +using namespace std; + +stack s; +int n; +int main() { + ios::sync_with_stdio(false); + cin.tie(NULL); cout.tie(NULL); + + cin >> n; + for(int i = 0; i < n; i++) { + string cmd; + int x; + cin >> cmd; + + if (cmd == "push") { + cin >> x; + s.push(x); + } + else if (cmd == "pop") { + + if (s.empty()) { + cout << -1 << endl; + } + + else { + cout << s.top() << endl; + s.pop(); + } + } + else if(cmd == "size") { + cout << s.size() << endl; + } + else if(cmd == "empty") { + if(s.empty()) { + cout << 1 << endl; + }else { + cout << 0 << endl; + } + } + else if(cmd == "top") { + if(s.empty()) { + cout << -1 << endl; + } + else { + cout << s.top() << endl; + } + } + } + return 0; +}