結果
| 問題 | No.455 冬の大三角 |
| コンテスト | |
| ユーザー |
tookunn_1213
|
| 提出日時 | 2017-09-24 09:55:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 918 bytes |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 13,056 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-11-14 07:03:39 |
| 合計ジャッジ時間 | 3,736 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 53 WA * 1 |
ソースコード
H,W = map(int,input().split())
S = [list(input()) for i in range(H)]
p = []
for i in range(H):
for j in range(W):
if S[i][j] == '*':
p.append((i,j))
di,dj = p[0][0] - p[1][0],p[0][1] - p[1][1]
ni,nj = p[0][0] + di,p[0][1] + dj
ny,nx = p[0][0] - di,p[0][1] - dj
ok = [[True for j in range(W)] for i in range(H)]
ok[p[0][0]][p[0][1]] = False
ok[p[1][0]][p[1][1]] = False
while ni < H and nj < W and ni >= 0 and nj >= 0:
ok[ni][nj] = False
ni += di
nj += dj
while ny < H and nx < W and ny >= 0 and nx >= 0:
ok[ny][nx] = False
ny -= di
nx -= dj
if p[0][0] == p[1][0]:
for i in range(W):
ok[p[0][0]][i] = False
if p[0][1] == p[1][1]:
for i in range(H):
ok[i][p[1][1]] = False
for i in range(H):
flag = False
for j in range(W):
if ok[i][j]:
S[i][j] = '*'
flag = True
break
if flag:
break
#print('')
#print(''.join([str(i%10) for i in range(W)]))
for i in range(H):
print(''.join(S[i]))
tookunn_1213