結果

問題 No.459 C-VS for yukicoder
ユーザー compass19compass19
提出日時 2016-12-10 00:58:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,202 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 29,124 KB
最終ジャッジ日時 2023-08-19 06:39:34
合計ジャッジ時間 5,053 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,604 KB
testcase_01 AC 17 ms
8,260 KB
testcase_02 AC 17 ms
8,352 KB
testcase_03 AC 16 ms
8,248 KB
testcase_04 AC 17 ms
8,236 KB
testcase_05 AC 16 ms
8,236 KB
testcase_06 AC 17 ms
8,204 KB
testcase_07 AC 18 ms
8,372 KB
testcase_08 AC 17 ms
8,240 KB
testcase_09 AC 17 ms
8,180 KB
testcase_10 AC 18 ms
8,220 KB
testcase_11 AC 17 ms
8,348 KB
testcase_12 AC 16 ms
8,192 KB
testcase_13 AC 17 ms
8,232 KB
testcase_14 AC 17 ms
8,248 KB
testcase_15 AC 26 ms
8,524 KB
testcase_16 AC 22 ms
8,500 KB
testcase_17 AC 18 ms
8,432 KB
testcase_18 AC 18 ms
8,288 KB
testcase_19 AC 17 ms
8,400 KB
testcase_20 AC 18 ms
8,232 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,n = map(int, input().split())
s = [0 for _ in range(w)]
for i in range(h):
	for k, elm in enumerate(list(input())): 
		if elm == '#': 
			s[k] += 1

c = sorted([(_, int(input())) for _ in range(n)], key=lambda x: x[1])
c_index = [elm[0] for elm in c]
c = [elm[1] for elm in c]

column_list = [list() for _ in range(w)]
for index, k in enumerate(c):
	column_list[k].append(index)
	column_list[k+1].append(index)
	column_list[k+2].append(index)

dic = {}
for i in range(n):
	dic[i] = dict()
	dic[i]['left_index'] = c[i]
	dic[i]['elm'] = [0, 0, 0]
	dic[i]['sum'] = 0

for column in range(w):
	sorted_temp_list = sorted(column_list[column], \
							  key=lambda x: dic[x]['sum'])
	stock = s[column]
	while stock != 0:
		for k in sorted_temp_list:
			left_index = dic[k]['left_index']
			dic[k]['elm'][column-left_index] += 1
			dic[k]['sum'] += 1
			stock -= 1
			if stock == 0:
				break

def pack_print(_list):
	left, center, right = _list
	for _ in range(3):
		s = str()
		s += '#' if left > 0 else '.'
		s += '#' if center > 0 else '.'
		s += '#' if right > 0 else '.'
		print(s)
		left -= 1
		center -= 1
		right -= 1


for i in range(n):
	index = c_index.index(i)
	pack_print(dic[index]['elm'])
0