MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon 128

#2720 - python

๐Ÿ’ก ์ฝ”๋“œt = int(input()) #ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งŒํผ ๋Œ๋ ค์ค€๋‹ค.for _ in range(t): money = int(input()) #๊ฑฐ์Šค๋ฆ„๋ˆ์„ ํ•˜๋‚˜ ๋ฐ›์•„์ฃผ๊ณ  for i in [25, 10, 5, 1]: #๋ฆฌ์ŠคํŠธ๊ฐ’ 4๊ฐœ ํ•˜๋‚˜์”ฉ ๋Œ๋ ค์ค€๋‹ค. print(money//i, end=' ') #๊ฑฐ์Šค๋ฆ„๋ˆ // i => ๋™์ „ ๊ฐœ์ˆ˜ money = money%i # ๋‹ค์Œ ๊ฐ’์€ money % i ์˜ ๋‚˜๋จธ์ง€ ๊ฐ’์ด ๋˜์–ด์•ผํ•จ     ๐Ÿ’ก์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ถ„์„ !!T = (int(input()))ํ…Œ์ŠคํŠธ ๊ฐœ์ˆ˜ ๊ฐ€์ ธ์˜ค๊ธฐ for i in range (T): a = input() aa.append(a)๊ฐœ์ˆ˜๋งŒํผ ๊ฑฐ์Šค๋ฆ„๋ˆ ๋ฐ›์•„์˜ค๊ธฐ coin_types = [25,10,5,1]๋‹จ์œ„๊ฐ€ ์„ผํŠธ๋กœ ๋˜์–ด์žˆ๋‹ค. ์ฟผํ„ฐ,๋‹ค์ž„,๋‹ˆ์ผˆ,ํŽ˜๋‹ˆ๋„ ์„ผ..

#11005 ์ง„๋ฒ• ๋ณ€ํ™˜ 2- python

๐Ÿ’ก 10์ง„์ˆ˜ -> N์ง„์ˆ˜ ๋ณ€ํ™˜๋ฒ•    ๐Ÿ’ก 10์ง„์ˆ˜ -> N์ง„์ˆ˜ ๋ณ€ํ™˜๋ฒ•์„ ์ฝ”๋“œ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด ์•Œ์•„์•ผ ํ•  ๊ฒƒ N, B = map(int,input().split())str = [] arr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"while N != 0: str.append(arr[N%B]) N = N // Bprint(*str[::-1], sep="") ๐Ÿ’ฌ arr[index] : ์ธ๋ฑ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น ์œ„์น˜์˜ ์š”์†Œ๋ฅผ ์„ ํƒํ•œ๋‹ค.๐Ÿ’ฌ str[::-1] : ๋ฆฌ์ŠคํŠธ๋‚˜ ๋ฌธ์ž์—ด์„ ๊ฑฐ๊พธ๋กœ ๋’ค์ง‘๋Š”๋‹ค.๐Ÿ’ฌ append() : ๋ฆฌ์ŠคํŠธ์— ์ƒˆ๋กœ์šด ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฉ”์„œ๋“œ  ๐Ÿ’ก ์ง„๋ฒ• ๋ณ€ํ™˜ 2 ์ƒ์„ธ์„ค๋ช… !! 0)  10์ง„์ˆ˜๋Š” 0~9 ๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ , 16์ง„์ˆ˜๋Š” 0~ F ๊นŒ์ง€ , 36์ง„์ˆ˜..

#2745 ์ง„๋ฒ• ๋ณ€ํ™˜ - python

N, B = input().split()result = 0N= N[::-1]ary = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"for i in range (len(N)) : result += (int(B) ** i) * (ary.index(N[i])) print(result) ๐Ÿ’ก  B์ง„๋ฒ• ์ˆ˜  N ์„ 10์ง„์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ•๊ฐ ์ž๋ฆฌ๊ฐ’๊ณผ ๊ฐ€์ค‘์น˜๊ฐ’์„ ๊ณฑํ•ด์„œ b^0 b^1 b^2 ๋”ํ•œ๋‹ค    ๐Ÿ’ก ์ง„๋ฒ• ๋ณ€ํ™˜ ์ƒ์„ธ์„ค๋ช… !! 0)  10์ง„์ˆ˜๋Š” 0~9 ๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ , 16์ง„์ˆ˜๋Š” 0~ F ๊นŒ์ง€ , 36์ง„์ˆ˜๋Š” 0~Z ๊นŒ์ง€์‚ฌ์šฉํ•˜๋ฏ€๋กœ arr ๋ฅผ ํ†ตํ•ด์„œ 0~Z๋ฅผ ๋ฏธ๋ฆฌ ์ง€์ •ํ•ด์ค€๋‹ค.1) ๊ฐ ์ž๋ฆฌ๊ฐ’์„ ์•Œ๊ธฐ ์œ„ํ•ด์„œ len (N) ์„ ํ†ตํ•ด์„œ ๊ธธ์ด๋ฅผ ์•Œ์•„๋‚ธ๋‹ค. 2) ๊ฐ ์ž๋ฆฌ ๊ฐ’ * ๊ฐ€์ค‘์น˜ ๊ฐ’  =>..