ํ์ด์ฌ์ ์
๋ ฅ ๊ฐ ๋ฐ๊ธฐ
์
๋ ฅ๊ฐ ๋ถ๋ฆฌํด ๋ฐ๊ธฐ A,B = map( int, input().split("")) ์
๋ ฅ ์ฒ๋ฆฌ hello bye A : hello B : bye ์
๋ ฅ ๋ฌธ์ ๋ฐฐ์ด๋ก ๋ฐ๊ธฐ arr = list(input()) ์
๋ ฅ ์ฒ๋ฆฌ hi [ 'h' , 'i' ] ์ฌ๋ฌ ์ค ์
๋ ฅ ์ด์ค๋ฐฐ์ด๋ก ๋ฐ๊ธฐ arr = [ list(input()) for _ in range (width) ] ์
๋ ฅ ์ฒ๋ฆฌ 1110 1101 [ ['1', '1', '1', '0'], ['1','1','0','1'] ]
2021. 3. 20.
๋ฐฑ์ค15652๋ฒ ํ์ด์ฌ N๊ณผM4 #13-4) ๋ฐฑํธ๋ํน
๋ด ํ์ด def back(d,n,m,k): if d==m: print(*ans) return for i in range(k,n): ans.append(i+1) back(d+1,n,m,i) ans.pop() n,m=map(int,input().split()) ans=[] back(0,n,m,0) ์ต๋ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์จ๋ณด๊ฒ ๋ค๋ ์์ง...? depth ๋ก ์กฐ๊ฑด ๊ฑธ ํ์ ์์ด, i๋ฅผ k๋ก ๋ฃ์ด์ฃผ๋ฉด ๋๋ ๊ฑฐ์์!!!!!!!!!! ๊ทธ๋ผ ํฉ๋ฆฌ์ ์ธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ๋ฒ์ ์์๋ณด์๋ฉด~^^ ๋ด ํ์ด 2 from itertools import product n,m=map(int,input().split()) num=[] nnum=[] ans=[] for i in range(n): num.append(i+1) for i in ..
2020. 10. 20.
๋ฐฑ์ค15651๋ฒ ํ์ด์ฌ N๊ณผM 3 #13-3) ๋ฐฑํธ๋ํน
๋ด ํ์ด def back(d,n,m): if d==m: print(*ans) return for i in range(n): if not visit[i]: ans.append(i+1) back(d+1,n,m) visit[i]=False ans.pop() if __name__=='__main__': n,m=map(int,input().split()) ans=[] visit=[False]*n back(0,n,m) ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉํ ๊ฒฝ์ฐ from itertools import product n,m=map(int,input().split()) num=[]#n๊น์ง์ ์ซ์ nnum=[]#m๊ฐ์ nnum ans=[]#nnum์์ list ๋ชจ๋ ์กฐํฉ for i in range(n): num.append(i+1) for ..
2020. 10. 20.