시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 85 | 54 | 42 | 65.625% |
Pascal’s triangle is a marvel of the combinatorical world, and what’s more you can easily build one for yourself at home.
The lowest row has n numbers. The next row is staggered and has n − 1 numbers, where the ith is the sum of the ith and the i + 1th on the previous row.
You can choose any positive integers for the lowest row, but the single cell on the top row needs to be equal to a given x. Is this possible?
If a pyramid can be constructed, output all of the numbers on each row, starting from the top. Every number must be greater than or equal to 1.
Otherwise, output impossible.
3 15
15 8 7 3 5 2
6 789
789 394 395 209 185 210 117 92 93 117 70 47 45 48 69 45 25 22 23 25 44
20 1
impossible
ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2019 I번