結果

問題 No.455 冬の大三角
ユーザー tookunn_1213tookunn_1213
提出日時 2017-09-24 09:28:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-26 17:28:20
合計ジャッジ時間 4,306 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 28 ms
10,752 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 30 ms
10,880 KB
testcase_09 AC 30 ms
10,880 KB
testcase_10 AC 29 ms
10,752 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 WA -
testcase_14 AC 29 ms
10,880 KB
testcase_15 AC 29 ms
10,880 KB
testcase_16 AC 29 ms
10,752 KB
testcase_17 AC 29 ms
10,880 KB
testcase_18 AC 28 ms
10,752 KB
testcase_19 WA -
testcase_20 AC 28 ms
10,880 KB
testcase_21 AC 28 ms
10,752 KB
testcase_22 AC 28 ms
10,752 KB
testcase_23 AC 28 ms
10,880 KB
testcase_24 WA -
testcase_25 AC 30 ms
10,752 KB
testcase_26 AC 29 ms
10,880 KB
testcase_27 AC 28 ms
10,880 KB
testcase_28 AC 29 ms
10,752 KB
testcase_29 AC 29 ms
10,752 KB
testcase_30 AC 29 ms
10,752 KB
testcase_31 AC 30 ms
10,880 KB
testcase_32 AC 30 ms
10,880 KB
testcase_33 AC 29 ms
10,880 KB
testcase_34 AC 30 ms
10,752 KB
testcase_35 AC 30 ms
10,880 KB
testcase_36 AC 30 ms
10,752 KB
testcase_37 AC 30 ms
10,880 KB
testcase_38 AC 29 ms
10,880 KB
testcase_39 AC 29 ms
10,880 KB
testcase_40 AC 29 ms
10,752 KB
testcase_41 AC 28 ms
10,752 KB
testcase_42 AC 28 ms
10,752 KB
testcase_43 AC 28 ms
10,880 KB
testcase_44 AC 28 ms
10,880 KB
testcase_45 AC 28 ms
10,880 KB
testcase_46 AC 28 ms
10,880 KB
testcase_47 AC 29 ms
10,752 KB
testcase_48 AC 28 ms
10,752 KB
testcase_49 AC 28 ms
10,880 KB
testcase_50 AC 29 ms
10,880 KB
testcase_51 AC 29 ms
10,752 KB
testcase_52 WA -
testcase_53 AC 29 ms
10,752 KB
testcase_54 AC 28 ms
10,880 KB
testcase_55 AC 28 ms
10,752 KB
testcase_56 AC 29 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int,input().split())
S = [list(input()) for i in range(H)]

d = [
		[(1,0),(-1,0)],
		[(0,1),(1,0)],
		[(1,-1),(-1,1)],
		[(-1,-1),(1,1)]
]
flag = False
for i in range(H):
	for j in range(W):
		if S[i][j] == '*':
			continue
		flag = False
		for k in d:
			a,b = k[0],k[1]
			ni,nj = i + a[0],j + a[1]
			ny,nx = i + b[0],j + b[1]
			cnt = 0
			while ni < H and nj < W and ni >= 0 and nj >= 0:
				if S[ni][nj] == '*':
					cnt+=1
				ni += a[0]
				nj += a[1]
			while ny < H and nx < W and ny >= 0 and nx >= 0:
				if S[ny][nx] == '*':
					cnt+=1
				nx += b[0]
				ny += b[1]
			if cnt == 2:
				flag = True
		if not flag:
			S[i][j] = '*'
			break
	if not flag:
		break
for i in range(H):
	print(''.join(S[i]))
0