結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
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 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 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 3 ms
4,380 KB
testcase_26 AC 4 ms
4,376 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 3 ms
4,376 KB
testcase_29 AC 6 ms
4,376 KB
testcase_30 AC 4 ms
4,376 KB
testcase_31 WA -
testcase_32 AC 2 ms
4,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 2 ms
4,380 KB
testcase_36 WA -
testcase_37 AC 2 ms
4,380 KB
testcase_38 WA -
testcase_39 AC 2 ms
4,376 KB
testcase_40 WA -
testcase_41 AC 2 ms
4,380 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 3 ms
4,380 KB
testcase_47 AC 2 ms
4,376 KB
testcase_48 WA -
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 3 ms
4,376 KB
testcase_54 WA -
testcase_55 AC 2 ms
4,380 KB
testcase_56 WA -
testcase_57 AC 2 ms
4,376 KB
testcase_58 WA -
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,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] >= ct[c[i]+j])
                {
                    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