結果

問題 No.459 C-VS for yukicoder
ユーザー zimphazimpha
提出日時 2017-12-14 23:15:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 858 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 85,308 KB
最終ジャッジ日時 2023-08-21 04:52:32
合計ジャッジ時間 17,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
70,828 KB
testcase_01 WA -
testcase_02 AC 65 ms
70,948 KB
testcase_03 AC 68 ms
71,100 KB
testcase_04 AC 66 ms
71,188 KB
testcase_05 AC 66 ms
71,180 KB
testcase_06 WA -
testcase_07 AC 67 ms
71,180 KB
testcase_08 AC 67 ms
70,864 KB
testcase_09 AC 67 ms
70,888 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 65 ms
71,244 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 75 ms
75,832 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 155 ms
79,236 KB
testcase_26 AC 156 ms
79,400 KB
testcase_27 AC 135 ms
78,544 KB
testcase_28 AC 146 ms
79,668 KB
testcase_29 WA -
testcase_30 AC 157 ms
79,516 KB
testcase_31 WA -
testcase_32 AC 78 ms
76,208 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 86 ms
76,320 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 79 ms
76,148 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 124 ms
77,896 KB
testcase_47 AC 93 ms
76,124 KB
testcase_48 WA -
testcase_49 AC 81 ms
76,280 KB
testcase_50 WA -
testcase_51 AC 89 ms
76,072 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 AC 81 ms
76,204 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, n = map(int, input().split())
s = [input() for i in range(h)]
cnt = [0] * w
for i in range(h):
  for j in range(w):
    cnt[j] += s[i][j] == '#'
ret = [[0] * 3 for i in range(n)]
empty = [False] * n
cell = [[] for i in range(w)]
for i in range(n):
  c = int(input())
  cell[c].append(i)
for i in range(w):
  cells = []
  if i >= 2: cells.extend([(x, 2) for x in cell[i - 2]])
  if i >= 1: cells.extend([(x, 1) for x in cell[i - 1]])
  cells.extend([(x, 0) for x in cell[i]])
  for x, y in cells:
    if not cnt[i]: break
    if empty[x]:
      ret[x][y] += 1
      cnt[i] -= 1
  for x, y in cells:
    r = min(cnt[i], 3 - ret[x][y])
    ret[x][y] += r
    cnt[i] -= r
for e in ret:
  r = [['.'] * 3 for i in range(3)]
  for i in range(3):
    for j in range(e[i]):
      r[j][i] = '#'
  for i in range(3):
    r[i] = ''.join(r[i])
  print(*r, sep='\n')
0