From 48c614e13b9df26544695d3dea4aa381913d2dc1 Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Sat, 23 Dec 2023 16:38:59 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Update=20P17298=5F=EC=98=A4=ED=81=B0?= =?UTF-8?q?=EC=88=98.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../P17298_\354\230\244\355\201\260\354\210\230.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\354\236\220\353\243\214\352\265\254\354\241\260/P17298_\354\230\244\355\201\260\354\210\230.py" "b/\354\236\220\353\243\214\352\265\254\354\241\260/P17298_\354\230\244\355\201\260\354\210\230.py" index 9657e39..1be10f2 100644 --- "a/\354\236\220\353\243\214\352\265\254\354\241\260/P17298_\354\230\244\355\201\260\354\210\230.py" +++ "b/\354\236\220\353\243\214\352\265\254\354\241\260/P17298_\354\230\244\355\201\260\354\210\230.py" @@ -1,3 +1,4 @@ +import sys n = int(input()) ans = [0] * n A = list(map(int, input().split())) From c15e948a685e631fe945907e373f06f1370bda5c Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:16:25 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Update=20P1874=5F=EC=8A=A4=ED=83=9D?= =?UTF-8?q?=EC=88=98=EC=97=B4.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\355\203\235\354\210\230\354\227\264.py" | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git "a/\354\236\220\353\243\214\352\265\254\354\241\260/P1874_\354\212\244\355\203\235\354\210\230\354\227\264.py" "b/\354\236\220\353\243\214\352\265\254\354\241\260/P1874_\354\212\244\355\203\235\354\210\230\354\227\264.py" index dfdf34c..5e73e58 100644 --- "a/\354\236\220\353\243\214\352\265\254\354\241\260/P1874_\354\212\244\355\203\235\354\210\230\354\227\264.py" +++ "b/\354\236\220\353\243\214\352\265\254\354\241\260/P1874_\354\212\244\355\203\235\354\210\230\354\227\264.py" @@ -1,30 +1,28 @@ -N = int(input()) +N = int(input()); A = [0]*N for i in range(N): - A[i] = int(input()) + A[i] = int(input()); stack = [] num = 1 result = True -answer = "" +answer = [] for i in range(N): su = A[i] - if su >= num: #현재 수열 값 >= 오름차순 자연수: 값이 같아질 때까지 push() 수행 + if su >= num: while su >= num: stack.append(num) - num += 1 - answer += "+\n" + num+=1 + answer.append('+') stack.pop() - answer += "-\n" - else: #현재 수열 값 < 오름차순 자연수: pop()을 수행해 수열 원소를 꺼냄 + answer.append('-') + else: n = stack.pop() - if n > su: #스택의 가장 위의 수가 만들어야 하는 수열의 수보다 크면 수열을 출력할 수 없음 + if n > su: print("NO") result = False break else: - answer += "-\n" + answer.append('-') if result: - print(answer) - - - + for i in answer: + print(i) From 7ffc988723a927eaba135dd9708a6ae77cfdeb81 Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:55:38 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Update=20P1325=5F=ED=9A=A8=EC=9C=A8?= =?UTF-8?q?=EC=A0=81=EC=9D=B8=ED=95=B4=ED=82=B9.py=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=B4=88=EA=B3=BC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\354\240\201\354\235\270\355\225\264\355\202\271.py" | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git "a/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" "b/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" index 5edebdf..7b0f15f 100644 --- "a/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" +++ "b/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" @@ -7,6 +7,7 @@ def BFS(v): + visited = [False] * (N + 1) queue = deque() queue.append(v) visited[v] = True @@ -19,18 +20,14 @@ def BFS(v): queue.append(i) -for _ in range(M): +for i in range(M): S, E = map(int, input().split()) A[S].append(E) for i in range(1, N + 1): # 모든 노드에서 BFS 실행 - visited = [False] * (N + 1) BFS(i) -maxVal = 0 -for i in range(1, N + 1): - maxVal = max(maxVal, answer[i]) - +maxVal = max(answer) for i in range(1, N + 1): if maxVal == answer[i]: print(i, end=' ') From 2e48a5331aae6a7a00ea083583de8efab0349d9b Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Fri, 31 Oct 2025 01:24:19 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Rename=20P1377=5F=EB=B2=84=EB=B8=94?= =?UTF-8?q?=EC=86=8C=ED=8A=B81.py=20to=20P1377=5F=EB=B2=84=EB=B8=94?= =?UTF-8?q?=EC=A0=95=EB=A0=AC1.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" => "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" (95%) diff --git "a/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" "b/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" similarity index 95% rename from "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" rename to "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" index 406b09b..a4a0d93 100644 --- "a/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" +++ "b/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" @@ -10,4 +10,4 @@ for i in range(N): if Max < sorted_A[i][1] - i: # 정렬 전 index - 정렬 후 index 계산의 최댓값 저장하기 Max = sorted_A[i][1] - i -print(Max + 1) \ No newline at end of file +print(Max + 1) From 2e7b26934af4f9ffc881cf19a166fea0e5814af6 Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Fri, 31 Oct 2025 01:24:36 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Rename=20P1517=5F=EB=B2=84=EB=B8=94?= =?UTF-8?q?=EC=86=8C=ED=8A=B82.py=20to=20P1517=5F=EB=B2=84=EB=B8=94?= =?UTF-8?q?=EC=A0=95=EB=A0=AC2.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\206\214\355\212\2702.py" => "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" (100%) diff --git "a/\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\206\214\355\212\2702.py" "b/\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" similarity index 100% rename from "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\206\214\355\212\2702.py" rename to "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" From dfb8ee001d4bdf55536954fb8613419752fdd2a4 Mon Sep 17 00:00:00 2001 From: doitcodingtest <108266421+doitcodingtest@users.noreply.github.com> Date: Fri, 31 Oct 2025 01:30:53 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Rename=20P1206=5FDFS=EC=99=80BFS.py=20to=20?= =?UTF-8?q?P1260=5FDFS=EC=99=80BFS.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../P1260_DFS\354\231\200BFS.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\355\203\220\354\203\211/P1206_DFS\354\231\200BFS.py" => "\355\203\220\354\203\211/P1260_DFS\354\231\200BFS.py" (100%) diff --git "a/\355\203\220\354\203\211/P1206_DFS\354\231\200BFS.py" "b/\355\203\220\354\203\211/P1260_DFS\354\231\200BFS.py" similarity index 100% rename from "\355\203\220\354\203\211/P1206_DFS\354\231\200BFS.py" rename to "\355\203\220\354\203\211/P1260_DFS\354\231\200BFS.py"