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 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 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