結果

問題 No.3420 Letter Loading
コンテスト
ユーザー SnowBeenDiding
提出日時 2026-01-11 14:27:34
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
RE  
実行時間 -
コード長 1,216 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,208 ms
コンパイル使用メモリ 424,948 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2026-01-11 14:27:46
合計ジャッジ時間 11,247 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

vector<pair<char, int>> run_length_str(string &a) {
    int n = a.size();
    vector<pair<char, int>> ret;
    int now = 1;
    rep(i, 0, n - 1) {
        if (a[i] == a[i + 1])
            now++;
        else {
            ret.push_back(make_pair(a[i], now));
            now = 1;
        }
    }
    ret.push_back(make_pair(a.back(), now));
    return ret;
}

void solve() {
    int n, w, h;
    string s;
    cin >> n >> w >> h >> s;
    vector ans(h, vector<char>(w, 'x'));
    auto rl = run_length_str(s);
    vector<int> a;
    int idx = 0;
    for (auto [c, l] : rl) {
        if (c == 'l') {
            idx += l;
            continue;
        }
        a.emplace_back(l);
    }
    rep(i, 0, w) rep(j, 0, a[i]) ans[j][i] = 'o';
    reverse(ans.begin(), ans.end());
    rep(i, 0, h) {
        rep(j, 0, w) cout << ans[i][j];
        cout << endl;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}
0