結果

問題 No.459 C-VS for yukicoder
ユーザー imulanimulan
提出日時 2016-12-10 02:23:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,728 bytes
コンパイル時間 1,590 ms
コンパイル使用メモリ 168,612 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-19 06:53:25
合計ジャッジ時間 6,130 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

int main()
{
    int h,w,n;
    cin >>h >>w >>n;
    vector<string> s(h);
    rep(i,h) cin >>s[i];
    vector<int> c(n);
    rep(i,n) cin >>c[i];

    // その列に積み上がっているブロックの個数
    vector<int> num(w);
    rep(x,w)
    {
        rep(y,h)
        {
            if(s[y][x]=='#')
            {
                num[x]=h-y;
                break;
            }
        }
    }

    // その列にブロックを落とせる回数
    vector<int> ct(w,0);
    rep(i,n)rep(j,3) ++ct[c[i]+j];

    // rep(i,w) printf(" i=%d : num= %d, ct=%d\n", i,num[i],ct[i]);

    rep(i,n)
    {
        int b[3]={};
        bool all_zero=true;
        rep(j,3)
        {
            if((ct[c[i]+j]-1)*3 < num[c[i]+j])
            {
                b[j] = num[c[i]+j]-(ct[c[i]+j]-1)*3;
                all_zero=false;
                assert(b[j]>0);
                assert(b[j]<=3);
            }
        }

        if(all_zero)
        {
            rep(j,3)
            {
                if(num[c[i]+j] > 0)
                {
                    b[j]=1;
                    break;
                }
            }
        }

        // output
        rep(j,3)
        {
            rep(k,3)
            {
                if(j<b[k]) printf("#");
                else printf(".");
            }
            printf("\n");
        }

        rep(j,3) --ct[c[i]+j];
        rep(j,3) num[c[i]+j]-=b[j];
    }

    return 0;
}
0