From a862e81dacde131b6f29f7348a88f8707ded7248 Mon Sep 17 00:00:00 2001 From: Jaeseok Park Date: Mon, 27 Feb 2023 22:49:57 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[solve=20:=20OX=20=ED=80=B4=EC=A6=88]=20?= =?UTF-8?q?=EB=B0=95=EC=9E=AC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OX\355\200\264\354\246\210/jaeseok.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git "a/problems/programmers/lv0/OX\355\200\264\354\246\210/jaeseok.py" "b/problems/programmers/lv0/OX\355\200\264\354\246\210/jaeseok.py" index e69de29..30dd36d 100644 --- "a/problems/programmers/lv0/OX\355\200\264\354\246\210/jaeseok.py" +++ "b/problems/programmers/lv0/OX\355\200\264\354\246\210/jaeseok.py" @@ -0,0 +1,21 @@ +# solution 1 +def solution(quiz): + answer = [] + for i in range(quiz): + res = quiz[i].split() + if res[1] == '+': + if int(res[0]) + int(res[2]) == int(res[4]): + answer.append('O') + else: + answer.append('X') + if res[1] == '-': + if int(res[0]) - int(res[2]) == int(res[4]): + answer.append('O') + else: + answer.append('X') + return answer + +# solution 2 +# eval 함수는 매개변수로 받은 expression(우리가 아는 일반적인 사칙연산 '식')을 문자열로 받아서, 실행하는 함수다. +def solution(quiz): + return ['O' if eval(i.replace('=', '==')) else 'X' for i in quiz] \ No newline at end of file From 531d4328764591d28ac3ce8542293dcb77cd1655 Mon Sep 17 00:00:00 2001 From: Jaeseok Park Date: Tue, 28 Feb 2023 00:16:44 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[solve=20:=20=EB=B0=B1=EC=A4=80=202869]=20?= =?UTF-8?q?=EB=B0=95=EC=9E=AC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jaeseok.py" | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git "a/problems/baekjoon/2869_\353\213\254\355\214\275\354\235\264\353\212\224 \354\230\254\353\235\274\352\260\200\352\263\240 \354\213\266\353\213\244/jaeseok.py" "b/problems/baekjoon/2869_\353\213\254\355\214\275\354\235\264\353\212\224 \354\230\254\353\235\274\352\260\200\352\263\240 \354\213\266\353\213\244/jaeseok.py" index e69de29..663dc82 100644 --- "a/problems/baekjoon/2869_\353\213\254\355\214\275\354\235\264\353\212\224 \354\230\254\353\235\274\352\260\200\352\263\240 \354\213\266\353\213\244/jaeseok.py" +++ "b/problems/baekjoon/2869_\353\213\254\355\214\275\354\235\264\353\212\224 \354\230\254\353\235\274\352\260\200\352\263\240 \354\213\266\353\213\244/jaeseok.py" @@ -0,0 +1,8 @@ +a, b, v = map(int, input().split()) + +# 도달하는 날 x일, 총 올라는 횟수 x번, 내려오는 횟수 (x-1)번 +# ax - b(x-1) = v +# x = (v - b) / (a - b) +k = (v - b) / (a - b) +res = int(k) if k == int(k) else int(k) + 1 # 삼항 연산자 사용 +print(res) \ No newline at end of file From 6d2557a43e0f6cd2eb9195eb2d34bc46f1be1d20 Mon Sep 17 00:00:00 2001 From: Jaeseok Park Date: Tue, 28 Feb 2023 08:28:46 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[solve=20:=20=EB=B0=B1=EC=A4=80=202303]=20?= =?UTF-8?q?=EB=B0=95=EC=9E=AC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jaeseok.py" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git "a/problems/baekjoon/2303_\354\210\253\354\236\220 \352\262\214\354\236\204/jaeseok.py" "b/problems/baekjoon/2303_\354\210\253\354\236\220 \352\262\214\354\236\204/jaeseok.py" index e69de29..4e55cca 100644 --- "a/problems/baekjoon/2303_\354\210\253\354\236\220 \352\262\214\354\236\204/jaeseok.py" +++ "b/problems/baekjoon/2303_\354\210\253\354\236\220 \352\262\214\354\236\204/jaeseok.py" @@ -0,0 +1,18 @@ +n = int(input()) +score = [] + +for _ in range(n): + card = list(map(int, input().split())) + max_score = 0 + for one in range(5): + for two in range(one+1, 5): + for three in range(two+1, 5): + first = (card[one] + card[two] + card[three]) % 10 + if max_score < first: + max_score = first + score.append(max_score) + +for i in range(n-1, -1, -1): + if score[i] == max(score): + print(i+1) + break \ No newline at end of file