Python coding questions

Asked 2 years ago, Updated 2 years ago, 80 views

https://www.acmicpc.net/problem/10994

This is the question about shooting stars Please tell me how to code with Python Please let me know

I'm frustrated because it's so hard.ㅜ<

python print-asterisk

2022-09-22 15:04

1 Answers

Did you learn high school math? Let's solve some of the equivalent sequences problems and find the general term.

1. When N is entered, which line is the middle line of ?

1 → 1  
2 → 3
3 → 5  
4 → 7
N → ?

2. When N is entered, what rule is the star of the middle line taken?

1 → 1 shot
2 → 1 shot, 1 space on each side, and 1 more shot on each side
3 → Take one, one space on each side, one more space on each side, one space on each side, and one more space on each side
4 → 1 shot, 1 space from each side, 1 space from each side, 1 space from each side, 1 space from each side, 1 space from each side, 1 space from each side, and 1 space from each side
N → ?

3. When N is entered, what rules are the right upper and lower lines of the middle line taken by stars?

1 → Not filmed
2 → Take the same one as the line in the middle, but there is no star in the middle
3 → Take the same one as the line in the middle, but there is no star in the middle
4 → I take the same one as the line in the middle, but there is no star in the middle (why only one?)
N → ?

4. When N is entered, what rules are the two lines above and two lines below in the middle of taken by stars?

1 → Not filmed
2 → Take the same one as the upper line (lower line) in the middle, but fill in the middle with 3 stars instead
3 → Take the same one as the upper line (lower line) in the middle, but fill in the middle with 3 stars instead
4 → Take the same one as the upper line (lower line) in the middle, but fill in the middle with 3 stars instead (why 3?)
N → ?

There's no answer! Define regularity and implement it! The definition was then implemented.


2022-09-22 15:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.