結果
| 問題 |
No.1434 Make Maze
|
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2021-03-19 22:24:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 360 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 83,996 KB |
| 最終ジャッジ日時 | 2024-11-18 23:10:53 |
| 合計ジャッジ時間 | 6,517 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 21 |
ソースコード
n,m,x=map(int,input().split())
r=((m-1)//2)*((n-1)//2)*2
if x>m*n-1-r or x<m+n-2 or (x-(m+n-2))%4!=0:
print(-1)
exit()
ans=[]
for i in range(n):
ans.append([])
for j in range(m):
if i%2 and j%2:
ans[-1].append('#')
else:
ans[-1].append('.')
stock=(m*n-1-r-x)//4
count=0
for i in range(1,n,2):
if count%2:
for j in range(1,m,2):
if stock:
ans[i][j-1]='#'
stock-=1
else:
ans[i][j+1]='#'
else:
for j in range(m-2,0,-2):
if stock:
ans[i][j+1]='#'
stock-=1
else:
ans[i][j-1]='#'
count+=1
for i in range(n):
print(''.join(ans[i]))
yuusanlondon