結果

問題 No.459 C-VS for yukicoder
ユーザー Hoi_koroHoi_koro
提出日時 2016-12-13 21:31:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,049 bytes
コンパイル時間 1,257 ms
コンパイル使用メモリ 125,676 KB
実行使用メモリ 6,704 KB
最終ジャッジ日時 2023-08-20 02:23:24
合計ジャッジ時間 9,078 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <complex>
#include <bitset>
#include <numeric>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n) ;++(i))
#define REPN(i,a,n) FOR((i),(a),(a)+(n))
#define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i))
#define PB push_back
#define MP make_pair
#define SE second
#define FI first
#define DBG(a) cerr<<(a)<<endl;
#define dump(a) cerr<<#a <<' '<< a <<endl;
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;  typedef pair<LL, LL> PLL; typedef vector<LL> VLL;
typedef pair<int,int>PI; typedef vector<int> VI;
const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7;

void out(vector<int> &a){
    REP(i,3){
        REP(j,3){
            if(a[j]>i)cout << '#';
            else cout << '.';
        }
        cout << endl;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w,n;
    cin >> h >> w >> n;
    VI field(w),cnt(n);
    vector<vector<PI>> c(w);
    vector<VI> ans(n,VI(3));
    REP(i,h){
        string s;
        cin >> s;
        REP(j,w) if(s[j]=='#') field[j]++;
    }
    REP(i,n){
        int tmp; cin >>tmp;
        FOR(j,tmp,tmp+3){
            c[j].emplace_back(j-tmp,i);
        }
    }
    REP(i,w)sort(ALL(c[i]));
    REP(i,w){
        for(int j=0; j<c[i].size();++j){
            auto &b=c[i][j];
            if(b.FI==0 or cnt[b.SE]==0){
                ans[b.SE][b.FI]=min(field[i],max(1,field[i]-3*((int)c[i].size()-j-1)));
            }else{
                ans[b.SE][b.FI]=max(0,field[i]-3*((int)c[i].size()-j-1));
            }
            cnt[b.SE]+=ans[b.SE][b.FI];
            field[i]-=ans[b.SE][b.FI];
        }
    }
    REP(i,n) out(ans[i]);

    return 0;
}
0