結果

問題 No.459 C-VS for yukicoder
ユーザー pekempeypekempey
提出日時 2016-12-10 00:25:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,177 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 176,020 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-05-06 13:35:15
合計ジャッジ時間 10,804 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main() {
    int h, w, n;
    cin >> h >> w >> n;

    vector<int> cnt(w);
    for (int i = 0; i < h; i++) {
        char s[10001];
        scanf("%s", s);
        for (int j = 0; j < w; j++) {
            if (s[j] == '#') {
                cnt[j]++;
            }
        }
    }

    vector<string> g(n * 3, string(3, '.'));

    vector<pair<int, int>> c(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &c[i].first);
        c[i].second = i;
    }

    sort(c.begin(), c.end());

    int j = 0;
    for (int i = 0; i < n; i++) {
        while (j < c[i].first || cnt[j] == 0) {
            j++;
        }
        g[i * 3][j - c[i].first] = '#';
        cnt[j]--;
    }
    for (int j = 0; j < w; j++) {
        for (int i = 0; i < n; i++) {
            for (int k = 0; k < 3; k++) {
                if (cnt[j] > 0 && c[i].first <= j && j < c[i].first + 3 && g[i * 3 + k][j - c[i].first] == '.') {
                    g[i * 3 + k][j - c[i].first] = '#';
                    cnt[j]--;
                }
            }
        }
    }

    for (int i = 0; i < n * 3; i++) {
        printf("%s\n", g[i].data());
    }
}
0