From e5886536e3f240b907d9b047a9af139e7cb550c8 Mon Sep 17 00:00:00 2001 From: ChangZero Date: Fri, 6 Jan 2023 16:52:52 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EA=B0=9C=EB=B0=9C?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60\353\212\245\352\260\234\353\260\234.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" diff --git "a/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" "b/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" new file mode 100644 index 0000000..03f045a --- /dev/null +++ "b/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" @@ -0,0 +1,21 @@ + +import math + +def solution(progresses, speeds): + answer = [] + items = [] + for i in range(len(progresses)): + item = (100 - progresses[i]) / speeds[i] + items.append(math.ceil(item)) + std = items.pop(0) + count = 1 + while items: + item = items.pop(0) + if std < item: + std = item + answer.append(count) + count = 1 + else: + count += 1 + answer.append(count) + return answer \ No newline at end of file From 52370e9075bcd84a8f5cf2bed088a13a49452e1b Mon Sep 17 00:00:00 2001 From: ChangZero Date: Sat, 7 Jan 2023 19:47:27 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85?= =?UTF-8?q?=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\355\224\210\354\261\204\355\214\205.py" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" diff --git "a/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" "b/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" new file mode 100644 index 0000000..d00f033 --- /dev/null +++ "b/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" @@ -0,0 +1,24 @@ +def solution(record): + user_dict = dict() + answer = [] + for chat in record: + if len(chat.split(" ")) == 3: + cmd, uid, name = chat.split(" ") + user_dict[uid] = name + else: + cmd, uid = chat.split(" ") + for chat in record: + if len(chat.split(" ")) == 3: + cmd, uid, name = chat.split(" ") + else: + cmd, uid = chat.split(" ") + + if cmd == "Enter": + ans = f"{user_dict[uid]}님이 들어왔습니다." + answer.append(ans) + elif cmd == "Leave": + ans = f"{user_dict[uid]}님이 나갔습니다." + answer.append(ans) + else: + pass + return answer \ No newline at end of file From ef0b6e9a11ae4cdf9ba2b385f18d47911f02bf65 Mon Sep 17 00:00:00 2001 From: ChangZero Kim Date: Sat, 7 Jan 2023 19:48:52 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Delete=20=EC=98=A4=ED=94=88=EC=B1=84?= =?UTF-8?q?=ED=8C=85.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\355\224\210\354\261\204\355\214\205.py" | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 "programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" diff --git "a/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" "b/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" deleted file mode 100644 index d00f033..0000000 --- "a/programmers/\354\230\244\355\224\210\354\261\204\355\214\205.py" +++ /dev/null @@ -1,24 +0,0 @@ -def solution(record): - user_dict = dict() - answer = [] - for chat in record: - if len(chat.split(" ")) == 3: - cmd, uid, name = chat.split(" ") - user_dict[uid] = name - else: - cmd, uid = chat.split(" ") - for chat in record: - if len(chat.split(" ")) == 3: - cmd, uid, name = chat.split(" ") - else: - cmd, uid = chat.split(" ") - - if cmd == "Enter": - ans = f"{user_dict[uid]}님이 들어왔습니다." - answer.append(ans) - elif cmd == "Leave": - ans = f"{user_dict[uid]}님이 나갔습니다." - answer.append(ans) - else: - pass - return answer \ No newline at end of file From abc6b2e63ca1bae8d21a5d42841c9f9f3f2a889b Mon Sep 17 00:00:00 2001 From: ChangZero Kim Date: Mon, 9 Jan 2023 14:16:53 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Update=20programmers/=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 감사합니다! Co-authored-by: Kim dong hyun, 김동현 --- .../\352\270\260\353\212\245\352\260\234\353\260\234.py" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" "b/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" index 03f045a..6887bfb 100644 --- "a/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" +++ "b/programmers/\352\270\260\353\212\245\352\260\234\353\260\234.py" @@ -18,4 +18,5 @@ def solution(progresses, speeds): else: count += 1 answer.append(count) - return answer \ No newline at end of file + return answer + \ No newline at end of file