Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 18e9ffa

Browse files
add #75
1 parent 6c05132 commit 18e9ffa

File tree

4 files changed

+75
-1
lines changed

4 files changed

+75
-1
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
<img src="./doc/quiz.png">
1+
<img src="./doc/quiz.png">
2+
3+
4+
https://quera.org/problemset/234249
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import sys
2+
3+
4+
"""
5+
dimensions = n×ばつ(2n−1)
6+
each line = 2*n-1
7+
https://quera.org/problemset/220669
8+
9+
dimensions: 8*(2*n-1)
10+
max = 8 * 2 - 1
11+
in: 8
12+
.......D.......
13+
......D.D......
14+
.....D...D.....
15+
....D.....D....
16+
...D.......D...
17+
..D.........D..
18+
.D...........D.
19+
D.D.D.D.D.D.D.D
20+
21+
in: 3
22+
..D..
23+
.D.D.
24+
D.D.D
25+
26+
"""
27+
28+
29+
def main():
30+
n = int(input(""))
31+
if n > 30 or n < 3:
32+
sys.exit("Invalid n")
33+
34+
M_CHAR = (n * 2) - 1
35+
36+
for i in range(n):
37+
38+
for before in range(i, (M_CHAR//2)): # before
39+
print(".", end="")
40+
41+
for inner in range((M_CHAR//2)-i, n):
42+
if i == n-1:
43+
if inner == 0:
44+
print("D.", end="")
45+
elif inner == n-1:
46+
print("D", end="")
47+
else:
48+
print("D.", end="")
49+
else:
50+
if inner == (M_CHAR//2)-i and i != 0:
51+
print("D.", end="")
52+
elif inner == n-1:
53+
print("D", end="")
54+
else:
55+
if inner != 0:
56+
for dot in range(2):
57+
print(".", end="")
58+
else:
59+
print(".", end="")
60+
61+
for after in range(i, (M_CHAR//2)): # after
62+
print(".", end="")
63+
64+
print()
65+
66+
67+
if __name__ == '__main__':
68+
main()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<img src="./doc/quiz.png">
2+
3+
https://quera.org/problemset/220669
49 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /