-
What would life be If we had no courage to attemp anything?
[baekjoon]python #5014 ์คํํธ ๋งํฌ
[baekjoon]python #5014 ์คํํธ ๋งํฌ https://www.acmicpc.net/problem/5014 5014๋ฒ: ์คํํธ๋งํฌ ์ฒซ์งธ ์ค์ F, S, G, U, D๊ฐ ์ฃผ์ด์ง๋ค. (1 ≤ S, G ≤ F ≤ 1000000, 0 ≤ U, D ≤ 1000000) ๊ฑด๋ฌผ์ 1์ธต๋ถํฐ ์์ํ๊ณ , ๊ฐ์ฅ ๋์ ์ธต์ F์ธต์ด๋ค. www.acmicpc.net import sys from collections import deque input = sys.stdin.readline F,S,G,U,D = map(int,input().split()) # ๊ฑด๋ฌผ๋์ด, ๊ฐํธ, ํ๊ฒ, ์, ์๋ queue = deque() queue.append((S,0)) # ๊ฐํธ์ ์์น, count visit = [0]*(F+1) # ๋ฉ..
2023. 1. 26.
[baekjoon]python #14494 ๋ค์ด๋๋ฏน์ด ๋ญ์์?
https://www.acmicpc.net/problem/14494 14494๋ฒ: ๋ค์ด๋๋ฏน์ด ๋ญ์์? (1, 1)์์ (n, m)์ ๋๋ฌํ๋ ๊ฒฝ์ฐ์ ์๋ฅผ ๊ตฌํ์ฌ๋ผ. ๋จ, ๊ฒฝ์ฐ์ ์๊ฐ ์์ฒญ ์ปค์ง ์ ์์ผ๋ฏ๋ก ๊ฒฝ์ฐ์ ์๋ฅผ 1,000,000,007(=109+7)๋ก ๋๋ ๋๋จธ์ง๋ฅผ ์ถ๋ ฅํ๋ค. www.acmicpc.net n,m = map(int,input().split()) arr = [[0]*(m+1) for _ in range(n+1)] arr[1][1] = 1 for y in range(1,n+1): for x in range(1,m+1): if x==1 and y==1:continue arr[y][x] = arr[y][x-1]+arr[y-1][x]+arr[y-1][x-1] print(arr[n][m]%10..
2022. 5. 18.