結果

問題 No.459 C-VS for yukicoder
ユーザー titiatitia
提出日時 2023-09-13 04:47:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 792 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 15,860 KB
最終ジャッジ日時 2023-09-13 04:47:44
合計ジャッジ時間 7,343 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 AC 16 ms
7,924 KB
testcase_02 AC 27 ms
7,824 KB
testcase_03 AC 16 ms
7,896 KB
testcase_04 AC 17 ms
7,780 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 16 ms
7,856 KB
testcase_07 AC 17 ms
7,780 KB
testcase_08 AC 16 ms
7,752 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 16 ms
7,892 KB
testcase_11 AC 16 ms
7,784 KB
testcase_12 AC 16 ms
7,896 KB
testcase_13 AC 16 ms
7,864 KB
testcase_14 AC 16 ms
7,852 KB
testcase_15 AC 22 ms
8,352 KB
testcase_16 AC 20 ms
8,352 KB
testcase_17 AC 18 ms
8,332 KB
testcase_18 AC 17 ms
8,248 KB
testcase_19 AC 17 ms
8,332 KB
testcase_20 AC 17 ms
8,328 KB
testcase_21 AC 304 ms
15,860 KB
testcase_22 AC 234 ms
15,620 KB
testcase_23 AC 257 ms
14,956 KB
testcase_24 AC 96 ms
10,928 KB
testcase_25 AC 62 ms
9,244 KB
testcase_26 AC 67 ms
9,768 KB
testcase_27 AC 62 ms
9,044 KB
testcase_28 AC 49 ms
9,324 KB
testcase_29 AC 95 ms
11,304 KB
testcase_30 AC 54 ms
9,924 KB
testcase_31 AC 63 ms
9,752 KB
testcase_32 AC 20 ms
8,332 KB
testcase_33 AC 67 ms
9,804 KB
testcase_34 AC 84 ms
10,200 KB
testcase_35 AC 23 ms
8,240 KB
testcase_36 AC 82 ms
10,060 KB
testcase_37 AC 22 ms
8,332 KB
testcase_38 AC 70 ms
9,804 KB
testcase_39 AC 25 ms
8,292 KB
testcase_40 AC 61 ms
9,600 KB
testcase_41 AC 19 ms
8,188 KB
testcase_42 AC 61 ms
9,520 KB
testcase_43 AC 82 ms
10,080 KB
testcase_44 AC 29 ms
8,576 KB
testcase_45 AC 27 ms
8,564 KB
testcase_46 AC 28 ms
8,616 KB
testcase_47 AC 23 ms
8,256 KB
testcase_48 AC 82 ms
10,120 KB
testcase_49 AC 22 ms
8,180 KB
testcase_50 AC 66 ms
9,812 KB
testcase_51 AC 21 ms
8,340 KB
testcase_52 AC 42 ms
9,076 KB
testcase_53 AC 26 ms
8,424 KB
testcase_54 AC 70 ms
9,808 KB
testcase_55 AC 49 ms
8,760 KB
testcase_56 AC 65 ms
9,592 KB
testcase_57 AC 20 ms
8,344 KB
testcase_58 AC 87 ms
10,164 KB
testcase_59 AC 29 ms
8,444 KB
testcase_60 AC 43 ms
9,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

C=[[int(input())]+[i] for i in range(N)]
C.sort()

LIST=[0]*W

for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            LIST[j]+=1

ANS=[[0,0,0] for i in range(N)]

for i in range(N):
    w,ind=C[i]

    for j in range(3):
        if LIST[w+j]>0:
            ANS[ind][j]+=1
            LIST[w+j]-=1
            break

for i in range(N):
    w,ind=C[i]

    for j in range(3):
        while LIST[w+j]>0 and ANS[ind][j]<3:
            ANS[ind][j]+=1
            LIST[w+j]-=1

for i in range(N):
    MAP=[["."]*3 for j in range(3)]

    for j in range(3):
        for k in range(ANS[i][j]):
            MAP[k][j]="#"

    for m in MAP:
        print("".join(m))


0