[Python] ๋ฐฑ์ค€ 11047 - ๋™์ „ 0
ยท
Algorithm
๋ฌธ์ œ ์ค€๊ทœ๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋™์ „์€ ์ด N์ข…๋ฅ˜์ด๊ณ , ๊ฐ๊ฐ์˜ ๋™์ „์„ ๋งค์šฐ ๋งŽ์ด ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. ๋™์ „์„ ์ ์ ˆํžˆ ์‚ฌ์šฉํ•ด์„œ ๊ทธ ๊ฐ€์น˜์˜ ํ•ฉ์„ K๋กœ ๋งŒ๋“ค๋ ค๊ณ  ํ•œ๋‹ค. ์ด๋•Œ ํ•„์š”ํ•œ ๋™์ „ ๊ฐœ์ˆ˜์˜ ์ตœ์†Ÿ๊ฐ’์„ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ž…๋ ฅ ์ฒซ์งธ ์ค„์— N๊ณผ K๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ N ≤ 10, 1 ≤ K ≤ 100,000,000) ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์— ๋™์ „์˜ ๊ฐ€์น˜ Ai๊ฐ€ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ Ai ≤ 1,000,000, A1 = 1, i ≥ 2์ธ ๊ฒฝ์šฐ์— Ai๋Š” Ai-1์˜ ๋ฐฐ์ˆ˜) ์ถœ๋ ฅ ์ฒซ์งธ ์ค„์— K์›์„ ๋งŒ๋“œ๋Š”๋ฐ ํ•„์š”ํ•œ ๋™์ „ ๊ฐœ์ˆ˜์˜ ์ตœ์†Ÿ๊ฐ’์„ ์ถœ๋ ฅํ•œ๋‹ค. ์ •๋‹ต N, K = map(int, input().split()) coin = [] count = 0 for i in range(N): coin.append(int(i..