[Python] - Coding Test / 6098 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 👉 Output → 👉 Source Code grid = [list(map(int, input().split())) for _ in range(10)] i = 1 j = 1 grid[i][j] = 9 while grid[i][j] != 2: if grid[i][j + 1] != 1: if grid[i][j + 1] == 2: grid[i][j + 1] = 9 break grid[i][j + 1] = 9 j += 1 continue if grid[i + 1][j] != 1: if grid[i + 1][j] == 2: grid[i + 1][j] = 9 break grid[i + 1][j] = 9 i += 1 else: break for i in.. 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6097 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 👉 Output → 👉 Source Code h, w = map(int, input().split()) n = int(input()) grid = [list(0 for _ in range(w)) for _ in range(h)] for i in range(n): l , d, x, y = map(int, input().split()) x -= 1 y -= 1 # 가로 if d == 0: for j in range(l): grid[x][y + j] = 1 else: for j in range(l): grid[x + j][y] = 1 for i in range(h): print(*grid[i]) # * 연산자 사용하여 list 형태 없애고 1개씩.. 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6095 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 3 5 👉 Output → 👉 Source Code n = int(input()) num = list(list(map(int,input().split())) for _ in range(n)) # list 2번 감싸줘야 됨 for i in range(1, 20): for j in range(1, 20): if [i, j] in num: print(1, end = ' ') else: print(0, end = ' ') print() 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6092 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 10 → 1 3 2 2 5 6 7 4 5 9 👉 Output → 1 2 1 1 2 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 👉 Source Code n = int(input()) num = list(map(int, input().split())) result = list(0 for _ in range(24)) for i in range(n): result[num[i]]+=1 for i in range(1, 24): print(result[i], end = ' ') 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6084 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 44100 16 2 10 👉 Output → 1.7 MB 👉 Source Code h, b, c, s = map(int, input().split()) print("{:0.1f}".format(h * b * c * s / 8 / 1024 / 1024), "MB") 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6080 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 2 3 👉 Output → 1 1, 1 2, 1 3, 2 1, 2 2, 2 3 👉 Source Code n, m = map(int, input().split()) for i in range(1, n + 1): for j in range(1, m + 1): print(i, j) 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6079 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 55 👉 Output → 10 👉 Source Code n = int(input()) sum = 0; for i in range(1, 1001): sum += i if sum >= n: break print(i) 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6071 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 7 4 2 3 0 1 5 6 9 10 8 👉 Output → 7 4 2 3 👉 Source Code n = int(input()) while n != 0: print(n) n = int(input()) 알고리즘 예제/Python 2022.03.06
[Python] - Coding Test / 6062 문제 ✍ CodeUp 문제 / 출처 : Codeup 👉 Input → 3 5 👉 Output → 6 👉 Source Code a, b = map(int, input().split()) print(a ^ b) 알고리즘 예제/Python 2022.03.06